nicksydney has quit [Remote host closed the connection]
naobsd has quit [Quit: naobsd]
nicksydney has joined #radxa
hramrach has joined #radxa
naobsd has joined #radxa
<fleeky>
just going to repeat my question : running the dual boot image on a radxa lite, but it boots straight into ubuntu and doesn't give an option for booting into android. any ideas ?
<Astralix>
Then, why do you build u-boot as you can boot any linux from NAND or SD by using the original Loader from RK
<Astralix>
There is no need to build u-boot and putting the image parts to your SD card.
<Astralix>
The original Loader is working fine.
<basil1x>
Then why is that all over the website?
field^Mop has quit [Ping timeout: 265 seconds]
<Astralix>
So if you just donwload a matching SD-Image from dl.radxa.com and unpack it on your computer you can exchange kernel or rootfs with another distribution as you like.
<Astralix>
Then you repack the image and dd it to your SD just following the instructions on wiki.radxa.com
<basil1x>
That sounds lovely. How do i go about doing that?
<Astralix>
The web site describing u-boot is for low level developers and experienced programmers. It is not for production use of those boards
<basil1x>
I thought if I could get the SD finished before it showed up, I'd have an easier time once it got here.
<basil1x>
But I don't want any of those images.
<basil1x>
I want Fedora.
<Astralix>
Unfortunately only Android and ubuntu have an SD Image
<Astralix>
Yes, but the Distro only differs by content of rootfs
<basil1x>
Which is why I was trying to follow the uboot instructions
<Astralix>
Ok, you have two parts of Linux that have to work together:
<Astralix>
Bootloader + Kernel on one side that is hardware-specific
<basil1x>
With you
<Astralix>
rootfs with your distro on the other hand, that is distro-specific
<basil1x>
following
<Astralix>
So the complicated part to split Loader and kernel and put them to special locations on the SD-card is already done, if you use a workign SD-card Image
<Astralix>
What I did, to make the ubuntu desktop image work on my generation 1 rock preview board was:
<Astralix>
I downloaded the working server image that supports graphics on my hardware
<Astralix>
Then I dd it to my SD
<Astralix>
I mounted that SD on my computer
<Astralix>
Then I erased the content of the sd with mkfs.ext4 ...
<Astralix>
The Loader and kernel are still at the right places on the SD, cause they are located in front of the ext4 partiton
<Astralix>
Then I downloaded the desktop image and unpacked it to my computer
<Astralix>
An used rsync -avhc to copy the rootfs from the desktop version to the empty rootfs partiton on the SD
<Astralix>
Put the SD into rock, boots perfect
<Astralix>
So, what you need is a working image that boots ANY linux from SD on your rock-pro
<Astralix>
So you download rock-pro ubuntu desktop image
<Astralix>
Then you push that onto sd
<Astralix>
You open "sudo gparted [your sd-card]"
<Astralix>
You select "Change size" of the ext4 partition and extend it to the rest of the card
<Astralix>
You select "Format as ext4"
<Astralix>
You klick "run"
<Astralix>
Exit gparted and download a armhf fedora image
<Astralix>
extract the image and copy over the rootfs from that image to the SD
<Astralix>
ready you are
<Astralix>
I have not used fedora for 15 years now, so I do not know if there are any armhf releases. I use ubuntu or linaro images for embedded things
<Astralix>
May be linaro has a fedora image for armhf too? I don't knoe
<Astralix>
Looks like one of these are something you need
<Astralix>
To understand the idea of what I did is:
<Astralix>
The things causing troubles and misunderstandings are the placements of the loader and kernel on the raw sectors of the SD. So leave this work to other people that spent hours to optimize them
<Astralix>
By using dd you just copy a raw structure to the SD that already covers these tasks
<Astralix>
As a result you have Loader, kernel and rootfs, and you just exchange the rootfs by something you like to have, but leave loader and kernel alone
<basil1x>
Lemme see what gparted makes of this image, once it's burnt.
<basil1x>
gparted hasn't been liking gpt recently.
<Astralix>
You jsut extend the existing partiton, nothing else
<basil1x>
If it'll let me, I will...
<basil1x>
still DLing the image, this might take a bit of time.
<Astralix>
You might format it too, but do not move the partition or extend it to the beginning of the SD
<Astralix>
Just extend the partition to the end of the SD. The round about 40MB of free space at the beginning of the SD are used for Loader and Kernel.
<Astralix>
I am not sure if the rock-pro in my pocket has an SD-card, but let me check...
<Astralix>
Hmm... sorry no 4GB+ Card around my deskt today... Need to way till I get home
<basil1x>
Installing the image now.
<basil1x>
Then will try extending it.
<basil1x>
still dding
<basil1x>
Grrrrr... back in a bit. this thing is taking forever.
<basil1x>
gparted scannong now
<Astralix>
The performance of your linux is essentially influenced by the performance of the memory. If you flash that to a 5 year old 4GB SD card it will not make much fun.
<Astralix>
I bought a bunch of 30MB/s read speed cards for testing and a few 45MB/s read/write speed cards for "production".
<basil1x>
I think the problem is with my gparted.
<basil1x>
It went all crashy just now.
<basil1x>
and now it's frozen
<basil1x>
How very annoying.
<Astralix>
The thing is that dd is not very talkative. I made myself a little script that uses a tool to give some status.
<basil1x>
dd finished. Apparently correctly.
<Astralix>
pv -tpreb $1 | dd of=$2
<basil1x>
Gparted is being stroppy now.
<Astralix>
With this line (in ubuntu you have to install pv before using it) you get a progress bar for dd-ing.
<Astralix>
After that you can use "sync" command to force linux to write all data from buffers to the media
<basil1x>
what do I do with it? run it before dd?
<Astralix>
no
<Astralix>
pv is a tool that can be used to detect size and position of a stream
<basil1x>
ok
<basil1x>
do I run it in a second terminal then?
<Astralix>
"pv -tpreb $1 | dd of=$2" is part of a script, where $1 is the source image on your disc and $2 is the target partition where to dd the image
<Astralix>
Nope
<basil1x>
I get that. What I don't get is what to do with the script.
<Astralix>
you just run "sudo pv -tpreb my_ferdora.img | dd of=/dev/mmcblk0"
<basil1x>
no if= statement, then?
<Astralix>
after this you call "sync" to force write everything that is stiill in the buffers but not on the SD card
<Astralix>
no, pv sends a stream to dd by using the pipe symbol |
<Astralix>
In addition pv tells you the write speed of this transfer, so you get an idea of how fast your card is :)
<basil1x>
OK... it extended.
<basil1x>
took a while, though.
<basil1x>
Now what?
<basil1x>
Something about scooping the internals out of the Ubuntu partition, and replacing them with those from the Fedora arm thingie.
<Astralix>
Now you can format that partition ... with ext4
<Astralix>
Yes either just format this partition with ext4 or mount it and sudo -rf * in it
<Astralix>
You probably could have erased and recreated the partition in gparted, but before that you have to check the upper free space and such... This way now we are on the safe side, even repartitioning is slower.
<Astralix>
And after erasing that partition, you can copy over the fedora rootfs to the partition.
<basil1x>
kust the rootfs? not the kernel?
<Astralix>
Right
<basil1x>
<i>dumpe2fs 1.42.11 (09-Jul-2014)
<basil1x>
Journal superblock magic number invalid!</i>
<basil1x>
<i>Unable to read the contents of this file system!
<basil1x>
Because of this some operations may be unavailable.
<Astralix>
??
<Astralix>
Where does this come from?
<basil1x>
gparted
<basil1x>
it went all stroppy and threw up an orange triangle at me.
<Astralix>
It probably detects some loader or kernel things in the upper unformatted part as a filesystem with errors
<basil1x>
It sees that bit as unformatted.
<basil1x>
this is on the ext4 partition.
<Astralix>
You can quit gparted and use sudo mkfs.ext4 /dev/mmcblk0p1 if it is in an SD card reader, or /dev/sdX1 where X is your mounted SD card in an USB SD adapter
<basil1x>
Yup. i tried to mount it... and no
<basil1x>
sec
<Astralix>
Something went horribly wrong there
<basil1x>
no medium found
<basil1x>
gonna reformat the entire thing.
<basil1x>
start fresh
<Astralix>
Ok, I guess that is best. Then you can try to read out the location of the partition and note the beginning sector.
<basil1x>
Wait... it wasn't seated properly
<Astralix>
After that you erase the partition and recreate a big one that keeps at least as many free space in front as the original one.
<basil1x>
still can't mount it, but it's showing up now.
<Astralix>
ouch... then please try from beginning. If the card wasn't seated correctly, the results are totally unpredictable.
<Astralix>
I have to leave now, for going home. I'll be back in here in about 2h and then I can test some fedora remix on SD on my rock pro.
<basil1x>
OK. Thanks.
<Astralix>
After that we should document that thing a bit for others to follow.
<basil1x>
I'll be kicking this thing myself a bit as well.
<basil1x>
I'll be here.
Astralix is now known as Astralix|away
<basil1x>
Have the annoying triangle again
polymeris has joined #radxa
sunilmohan has joined #radxa
sunilmohan has joined #radxa
wickwire has quit [Read error: Connection reset by peer]
sunilmohan has quit [Ping timeout: 272 seconds]
Vutral has quit [Ping timeout: 264 seconds]
Astralix|away is now known as Astralix
<Astralix>
Hey
<Astralix>
So let me see... Need my rock-pro, an SD and some beer
Vutral has joined #radxa
<Astralix>
So, I do have an image flying around on my drive radxa_rock_pro_lite_ubuntu_14.04_desktop_fhd_141124_sdcard.zip
<Astralix>
I extract that one to my disk
<Astralix>
basil1x: are you still there?
<Astralix>
You can read the backlog...
<Astralix>
After extraction of the zip, I dd the image to my sdcard
Harallu_ has joined #radxa
Harallu has quit [Ping timeout: 264 seconds]
<Astralix>
Ok, this fedora image has three partitions inside
<Astralix>
First partition has some kernels, loaders and initramfs inside
<Astralix>
Second partition is not mountable, could be swap
<Astralix>
Third partition is rootfs
polymeris has quit [Remote host closed the connection]
<basil1x>
I'm here... was called away by family matters.
<basil1x>
Sorry, Astralix
<basil1x>
How'd you manage to see the partitions in the Fedora image?
<basil1x>
I have the .raw file, but no way to mount or open it.
<Astralix>
Sorry, was interrupted :) Family
<Astralix>
The raw image is a mirror of a "disk"
<Astralix>
if you do fdisk -l [file.raw] then you see the partitions inside
<Astralix>
If you like to look into these partitions, you need to save the start addresses of the partitions
<Astralix>
then you can create a temp mount pint like "mkdir /tmp/boot"
<Astralix>
Then you mount the partition inside the raw image by giving an offset to the first sector... but offset is givien as bytes, so we need a calculation:
<Astralix>
So if the boot parttion is at sector 2048 we do it like this:
<Astralix>
sudo mount -o loop,offset=$((2048*512)) image.raw /tmp/boot
<Astralix>
the $((2048*512)) does the calculation for us
<basil1x>
Might it just be possible to use the raw thingie on a µSD card as-is?
<basil1x>
I mean, will it boot on the Radxa?
<Astralix>
yes
<Astralix>
I am thinking about that too
<basil1x>
Though I'm having trouble with gparted right now. It sees the partitions on my µSD as corrupt. :(
<basil1x>
The ones made from those files, that is.
<Astralix>
the problem is to get the kernel onto the sd and could be you need to add / exchange some modules, however... probably the easiest way to boot up that fedora is to flash the kernel to radxa NAND
<Astralix>
and then modify the kernel command line to use sd card as initramfs and rootfs
<basil1x>
I was trying to avoid the NAND
<Astralix>
why? it works fine
<basil1x>
bcos I can't do anything about it until the box arrives. :(
<Astralix>
ok
<basil1x>
USPS are very... unspecific... about arrival dates.
<basil1x>
I was hoping to make a µSD I could put in the machine and have it working straight away.
<basil1x>
Thus saving lots of time once it arrives.
<Astralix>
Do you want to try and experiment with the board or do you want to set up a production system asap and then just use it?
<basil1x>
I was hoping to get this one up and running as close to at once as possible.
<basil1x>
Then, if I decide I love it, I can get another for playing.
<Astralix>
Ok... Unfortunately this might require some hard actions...
<basil1x>
I've already built a toolchain twice today, and a U-boot. How much worse can it get?
<Astralix>
Hmm... I am currently baking u-boot kernel and rootfs for an undocumented taiwan iMX6q device
<basil1x>
Do I need to go get the altar and nick the neighbour's baby?
<Astralix>
But I do not build toolchains... I use the current linaro 2014.11 gcc for armhf the 2015.1 u-boot and the 3.18.1 kernel
<basil1x>
The documentation I've fumbled through for the Radxa, and for Fedora ARM led me to believe I had to make U-boot, and stick it in the image somehow.
<Astralix>
But you probably hit worst-case condifions
<Astralix>
conditions
<basil1x>
You say unnecessary. Fine. Lovely. But if so, I don't want to be stuck with a 3GB linux on a 32GB µSD
<Astralix>
The fedora image is prepared for lots of devices that boot their kernel from a partition on the card
<basil1x>
And... this one doesn't?
<Astralix>
For u-boot to load kernel image and initramfs from a partiton like wandboard, sabrelite or beaglebone do, you need a relatively new u-boot
<Astralix>
But the RK u-boot for rk3188 is horribly crumbeld and outdated
<Astralix>
So even beeing able to build the u-boot will not solve your problem
<basil1x>
Building was simple.
<basil1x>
It's getting the thing into the blessed image that's giving me fits.
<Astralix>
that isn't to difficult... AFAIK hipboy or naobsd have made a script and some fair explanations...
<basil1x>
And those are?
<Astralix>
however this u-boot will not work for the fedora preconfigured image
* basil1x
feels like he's about to lose his rag.
<basil1x>
I have never... not once... encountered a system this stroppy.
<basil1x>
then tried to stick it in the fedora image, bcos I have no interest in building my own kernel.
<Astralix>
you can mix it up
<Astralix>
But that was what I was telling you before
<basil1x>
but I can't make it insert into the image. Even after I've dd'ed it to the card.
<basil1x>
bcos gparted says the partition I need to write to isn't valid.
<basil1x>
It won't mount.
<basil1x>
This has gone all circular.
<Astralix>
ok, rockchip u-boot requires the u-boot and the kernel to be in a location on the sd that is not a partition
<Astralix>
so the sd needs some 12..16 MB free at the very beginning
<basil1x>
so I can't write it myself.
<basil1x>
And Fedora will get *very angry* having its' kernel outside a partition.
<Astralix>
you can make your own image from the raw by expanding the free space in front of the image
<Astralix>
Then you put u-boot inside and kernel
<basil1x>
I don't know how to insert anything in an image. I have never used any image other than an ISO, not since 1994, any road.
<Astralix>
In current rockchip distros provided as imges to flash to nand or sd, the kernel and the initramfs are combined as one blob
<basil1x>
Saying you can do it is one thing. But how.
<basil1x>
blob? Now you've lost me. I'm getting flashbacks of Steve McQueen.
<Astralix>
lol
<Astralix>
Ok, modern kernel and uboot work together like this:
<Astralix>
u-boot loads the kernel and initramfs and another file (dtb). Then it calls the kernel boot code and tells him, hey use this address as initramfs and that address as dtb.
<Astralix>
But the rockchip u-boot is old, so it doesn't know about these nice features.
<Astralix>
For this the kernel has some workarounds installed. It can can be combined with initramfs inside or attached to its end and so it goes for dtb too.
<Astralix>
And you need to use this workaround way to build a u-boot-kernel-initramfs chain that works
<basil1x>
But how does updating the kernel with yum work if the kernel's playing around outside the partitions?
<Astralix>
Or you need to update u-boot to current version and copy the kernel to fedora's first partition and it works
<Astralix>
I am not sure if you do a kernel update for an arm device like you do it for you PC
<basil1x>
OK... so replace knackered uboot with pretty new one.
<basil1x>
Why not? a fresh ARM kernel should work as well as the old, yes?
<Astralix>
Ok, you write one, cause I have no time tonight?
<basil1x>
I thought that's what I did earlier, building the uboot.
<basil1x>
Or does this machine require its' own?
<Astralix>
I have built several version of u-boot for several SOCs, and I tried some first steps for rockchip
<Astralix>
It works quite well for RK3288 but not for the older chips.
<Astralix>
Yes and no...
<Astralix>
Most special functions today are inside the SOCs
<Astralix>
And even functions that are using only a simple GPIO are often sticking to one special GPIO.
<Astralix>
So even you can use any GPIO to detect SD-card is present or not, with modern SOCs only a few GPIO lines can be used as the others have special functions too
<Astralix>
Do starting an SOC and then getting some code from a SD is probably the easiest thing in the work of u-boot
<basil1x>
OK. I think I'm about to collapse from too many unfamiliar terms.
<Astralix>
There are many other things to do and these are complicated as many parts of modern SOCs are not documented or require you to get NDA to get details
<Astralix>
Jsut ask, if any term ist not clear
<Astralix>
GPIo is General Purpose Input Output
<Astralix>
It is a pin that can be set high or low or it can be read back by software
<Astralix>
SOC is System On Chip... As modern chips are more than only a CPU like in the old computers
<Astralix>
The hadrware that reads abd writes the SD is inside the chip as well as the HDMI or LCD or USB and so on
<basil1x>
I need something like the IBM Big Book
<Astralix>
Hmm... the RK3188 Big Book is 26MB as PDF and requires NDA
<basil1x>
Now I need three years to get up to speed.
<Astralix>
this does not include documentation of video decoders and graphics accelleration
<basil1x>
I think I should find a dark corner and whimper for a while.
<Astralix>
Hmm... Why don't you just try a debian image or ubuntu desktop?
<basil1x>
I'll install Ubuntu like a good boy, park the mabarrassing thing in my closet, and stick to my pre-UEFI laptop.
<Astralix>
Do you want to use it as a server or as a workstation?
<basil1x>
I did have hopes of it being a fileserver.
<basil1x>
But Ubuntu makes me uneasy.
<Astralix>
So this is super duper easy
<Astralix>
Nope in no way
<Astralix>
I mean, explaining you the tricks and treats of building your own rockchips specific image is a two weeks job
<basil1x>
Much more comfy with my RedHat based. But I can learn up the Ubuntu equivalents easily enough.
<Astralix>
But if you install the server image from radxa I can explain you how to set up your samba via text console in 15min
<Astralix>
I use text console only servers only
<Astralix>
So the difference is you use yum, I use apt-get... who cares
<basil1x>
It needs to have a DE as well, bcos it'll likely also be used to read mail usw.
<Astralix>
the samba.conf is the same
<basil1x>
oops... English... usw = etc
<Astralix>
You can install the light weight lubuntu desktop image and use the desktop to read email
<basil1x>
is there no xubuntu for radxa?
<Astralix>
I am using it only as a samba, upnp, svn, git and apache server
<basil1x>
lubuntu made me grumpy last time I used it.
<Astralix>
you can install the server image, then you follow th xubuntu instructions on their site to install the xubuntu desktop via apt-get
<basil1x>
Which, to be fair, was somewhere over Koala
<Astralix>
It cost me 3 runs to switch completely from windows to linux
<basil1x>
OK. I'll pop in again when the machine arrives.
<Astralix>
I started with SuSe, then tried Fedora and later again with ubuntu
<Astralix>
feel free to give me a ping
<Astralix>
however now I am free of windows all over the house
<basil1x>
I started with RedHat, switched to Fedora when it showed up.
<Astralix>
and in the company too :)
<basil1x>
then I went through a Windows period, bcos company laptop had it.
<basil1x>
Then came back... to Ubuntu, then SuSE, then Sabayon, then Fedora again... I had fun testing out the distros.
<Astralix>
I am developing AVR, Cortex-M, ARM and Cortex-A for company... it doesn't make sense to run windows
<Astralix>
all tools used are running under linux
<basil1x>
It would be very nice to have ARM work like normal linux.
<Astralix>
Ok, I continue to work on this iMX box and we meet the next days when the rock arrives?
<basil1x>
Aye.
<basil1x>
Thanks for taking the time.
<Astralix>
Oj, if you have a modern u-boot, or different loader working, it is almost the same
<basil1x>
See you then.
<Astralix>
Unfortunately many chinese manufacturers are very restrictive with the information you need to port u-boot
<basil1x>
Mebbe you can talk me through making this loader then. :P
<Astralix>
And not many people can or try to port u-boot
<Astralix>
See you these days.
<basil1x>
Enjoy your twiddlings. I'm going to make a giant salami sammy, and drown my sorrows in greasy meat.
<Astralix>
so enjoy that!
<Ullarah>
Before I reflash, does anybody know the difference between the standard android images, and the android tablet images here which are a later date? http://dl.radxa.com/rock_pro/images/android/
<naobsd>
there are 2 SDKs from Rockchip, one for box/stick, another for tablet