How to create sd2emmc IMG from AOSP build lineageOS-14.1

Moderators: mdrjr, odroid

How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby swalter » Wed Sep 13, 2017 3:42 pm

After compiling LineageOS 14.1 for an Odroid XU-4 with
Code: Select all
./build.sh odroidxu3

I have the following files in my /tmp folder
Code: Select all
root@fractal:/tmp/odroidxu3# ls
system  system.img  update  update.zip  update.zip.md5sum


However, I'm at loss how to flash the Odroid XU-4 now.

* How can I create an sd2emmc image such as provided on https://oph.mdrjr.net/voodik/5422/ODROI ... _04.07.17/ ?
* Alternatively, how can I flash the created images directly? Is fastboot available on the Odroid XU4?
swalter
 
Posts: 3
Joined: Wed Sep 13, 2017 3:27 pm
languages_spoken: english

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby voodik » Wed Sep 13, 2017 10:01 pm

You can help me buy new PC Here ;)
BTC: 3AB1bcKpvsobcjaSxG2iTLDGft2Rqsh7an
User avatar
voodik
 
Posts: 1214
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby codewalker » Fri Sep 15, 2017 10:37 am

https://wiki.odroid.com/odroid-xu4/soft ... ease_image

swalter wrote:After compiling LineageOS 14.1 for an Odroid XU-4 with
Code: Select all
./build.sh odroidxu3

I have the following files in my /tmp folder
Code: Select all
root@fractal:/tmp/odroidxu3# ls
system  system.img  update  update.zip  update.zip.md5sum


However, I'm at loss how to flash the Odroid XU-4 now.

* How can I create an sd2emmc image such as provided on https://oph.mdrjr.net/voodik/5422/ODROI ... _04.07.17/ ?
* Alternatively, how can I flash the created images directly? Is fastboot available on the Odroid XU4?
User avatar
codewalker
 
Posts: 453
Joined: Mon Feb 25, 2013 11:03 am
languages_spoken: english
ODROIDs: all

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby swalter » Tue Sep 19, 2017 10:36 pm

Thanks for the link. This is what I've been looking for.

However, after some trial and error, I still can't get it to work.

From make_recovery_images.sh and the AOSP build output in /tmp/odroidxu3
I conjecture that I should copy/paste the update/ folder to the xu4_installer working directory.

However, running make_recovery_images.sh did not work.
First fix was
Code: Select all
-echo "sudo parted /dev/loop0 mkpart primary fat32 105 525"
-sudo parted /dev/loop0 mkpart primary fat32 90 525
+echo "sudo parted /dev/loop0 mkpart primary fat32 105 100%"
+sudo parted /dev/loop0 mkpart primary fat32 90 100%


Then I had to mkdir /media/root/fat32

and finally to get rid of the errors

Code: Select all
cp: error writing '/media/root/fat32/userdata_64.img': No space left on device
cp: error writing '/media/root/fat32/userdata_8.img': No space left on device
cp: error writing '/media/root/fat32/zImage-dtb': No space left on device
etc.


I applied

Code: Select all
-echo "dd if=/dev/zero of=./installer.img count=1024000"
-dd if=/dev/zero of=./installer.img count=1024000
+echo "dd if=/dev/zero of=./installer.img bs=1MB count=2000"
+dd if=/dev/zero of=./installer.img bs=1MB count=2000


Now there are no errors. So I flashed the image to my sdcard via
Code: Select all
pv < sd2emmc/sd2emmc.img > /dev/sde

set the switch to micro sdcard on the odroid xu4 and powered the board.
The fan turns on, red and blue LED are on, just as expected, but it never shuts off.

Something is wrong. Is there a way to check that the created images are correct?
Maybe I'm doing something wrong?


Update:
I flashed the official sd2emmc image of lineageOS-14.1 and installed it successfully on the odroid xu4.
Then I tried to use the odroid xu4 updater as explained on https://wiki.odroid.com/odroid-xu4/soft ... id_updater
md5checksum and everything else looks good.
However, after the update, the board doesnt boot up. I I guess something is wrong with the image? Is it possible that the xu4_installer is incompatible with the lineageOS-14.1 image?
swalter
 
Posts: 3
Joined: Wed Sep 13, 2017 3:27 pm
languages_spoken: english

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby voodik » Wed Sep 20, 2017 12:30 am

So you need USB-UART kit to understand why your Android doesn't boot.
BTW when you power on your board your FAN is running or no ?
You can help me buy new PC Here ;)
BTC: 3AB1bcKpvsobcjaSxG2iTLDGft2Rqsh7an
User avatar
voodik
 
Posts: 1214
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby voodik » Wed Sep 20, 2017 12:43 am

For create selfinstall images with new Mainline u-boot.
You need two more tricks. First cd to update directory and split system.img to 128MB chunks
Code: Select all
split --bytes=128M system.img system_
rm system.img

Because lineage-14.1 is bigger than Kitkat you need edit boot.ini in sd sd2emmc and emmc subfolders to set it propper load all chunks.
Depending count of chunks you get after split please set
Code: Select all
fatload mmc 0:1 40000000 system_aa
fatload mmc 0:1 48000000 system_ab
fatload mmc 0:1 50000000 system_ac
fatload mmc 0:1 58000000 system_ad
fatload mmc 0:1 60000000 system_ae
fatload mmc 0:1 68000000 system_af

fatload mmc 0:1 71000000 cache.img

fastboot flash system 40000000 1
fastboot flash cache 71000000 1


Also set cache image load address to 71000000 to avoid overlaps.
You can help me buy new PC Here ;)
BTC: 3AB1bcKpvsobcjaSxG2iTLDGft2Rqsh7an
User avatar
voodik
 
Posts: 1214
Joined: Sat Dec 07, 2013 2:36 am
languages_spoken: english,russian

Re: How to create sd2emmc IMG from AOSP build lineageOS-14.1

Unread postby swalter » Wed Sep 20, 2017 11:45 pm

I don't have a USB-UART adapter, I'm afraid. I'll order one as soon as possible.
In the meantime, I'll give the spliting approach a try. Thanks for the input!

P.S. yes, the fan turns on when I power up an sd2emmc prepared sdcard, but it never turns off.
swalter
 
Posts: 3
Joined: Wed Sep 13, 2017 3:27 pm
languages_spoken: english


Return to Android

Who is online

Users browsing this forum: No registered users and 2 guests