android-rpi / device_arpi_rpi4

Device build-config for Raspberry Pi 4
216 stars 87 forks source link

USB boot support? #28

Closed lohriialo closed 3 years ago

lohriialo commented 4 years ago

I've updated my rpi4 firmware to the latest stable(June 15th) which now has official support for USB boot. I'm able to USB boot Raspberry Pi OS for example but when I attempt to boot android-rpi, I can see that rainbow screen but it boot loop. Any help/pointers on how to get it to work?

AaronDewes commented 4 years ago

Try to use this as fstab.rpi4 and rebuild:

#<src>                  <mnt_point>         <type>    <mnt_flags and options>                               <fs_mgr_flags>

/dev/block/sda2    /system             ext4      ro,barrier=1                                          wait,first_stage_mount
/dev/block/sda3    /vendor             ext4      ro,barrier=1                                          wait,first_stage_mount
/dev/block/sda4    /data               ext4      noatime,nosuid,nodev,nomblk_io_submit,errors=panic    wait
lohriialo commented 4 years ago

@AaronDewes thanks, works perfectly with USB boot but won't boot in sdcard mode, not sure if there's a good way to have both at the same time

AaronDewes commented 4 years ago

Please try this fstab:

#<src>                         <mnt_point>         <type>    <mnt_flags and options>                                <fs_mgr_flags>

/dev/block/by-name/system       /system             ext4      ro,barrier=1                                          wait,first_stage_mount
/dev/block/by-name/vendor       /vendor             ext4      ro,barrier=1                                          wait,first_stage_mount
/dev/block/by-name/userdata      /data              ext4      noatime,nosuid,nodev,nomblk_io_submit,errors=panic    wait,first_stage_mount

This may result in a bootloop, but please try it. If it does, run find /dev with adb shell on an older build. Please make sure the partition names are correct, this detects them by names.

AaronDewes commented 3 years ago

@lohriialo Any progress?

lohriialo commented 3 years ago

I haven't had a chance to rebuild and test it yet, for now I'm sticking with USB boot as I already have some other stuffs going on in the current build

Road-Drum commented 3 years ago

@AaronDewes I could probably test this. Just patch the fstab in latest arpi-10 source right?

AaronDewes commented 3 years ago

Yes, Thank you!

Road-Drum commented 3 years ago

I'll try building tonight, natively compile on my pi 4 lol

AaronDewes commented 3 years ago

I don't think that will work, android uses x64 prebuilts while building

Road-Drum commented 3 years ago

I don't think that will work, android uses x64 prebuilts while building

could I override those prebuilts and recompile them from scratch? I recall there's an option to not use prebuilts and compile from scratch

AaronDewes commented 3 years ago

I think you can, but I don't know.

Road-Drum commented 3 years ago

so far the current script is to build arm and on my Pi 4, it's currently running Manjaro ARM which I need to get gcc-arm since Manjaro ARM is shipped with arm64 arch by default. I'm just toying around so I won't delve too deep, but ARCH=arm make zImage partially successful since gcc-arm64 doesn't recognize some gcc-arm specific options

maybe I'll have more success on RPi OS, will try to spin a kvm or lxd to run arm version of that, though I'm not sure how to setup kvm that targets arm. is it armhf or armv7l-neon? arm architecture is kinda messed up imo lol

AaronDewes commented 3 years ago

I don't know.

AaronDewes commented 3 years ago

I've tried building this on my RPi, while building android, my sd card broke because it used it too much. It also required 16GB of RAM, so I had to use swap.

lohriialo commented 3 years ago

USB boot works as suggested above by @AaronDewes

Road-Drum commented 3 years ago

Does it works both for sd card and USB? If then you should consider pull request for the fstab on android-rpi device repo as well

On Fri, 18 Sep 2020, 14:10 Lohrii Alo, notifications@github.com wrote:

USB boot works as suggested above by @AaronDewes https://github.com/AaronDewes

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/android-rpi/device_arpi_rpi4/issues/28#issuecomment-694675924, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNSKCB5XX6O2WESMWTJ6STSGL2WXANCNFSM4OMFVD3Q .

lohriialo commented 3 years ago

No, it doesn't work both ways, I guess it has to be either SdCard or USB