Bananian

How do I use an initramfs with Bananian?

6 3523
Hi!

How do I create and use an initramfs with Bananian?

Thanks in advance.
Phantasmagorium

e

Edited by MeskiBear at Wed Sep 30, 2015 05:25

a late answer is better than no answer: just came across the same question and found the answer in the sunxi wiki :

My root partition is labeled SYSp, using an uInitrd make it possible to assign root=LABEL=SYSp as bootargs instead of the real block device:

# install the necessary tools:
apt-get install initramfs-tools u-boot-tools fsprotect

# build initramfs:
update-initramfs -ck $(uname -r)

# convert it to an uInitrd:
mkimage -A arm -T ramdisk -C none -n uInitrd -d /boot/initrd.img-$(uname -r) /boot/uInitrd

# add a boot.cmd
cat <<EOT > /boot/boot-bananapi-initrd.cmd
ext2load mmc 0 0x43000000 sun7i-a20-bananapi.dtb
ext2load mmc 0 0x41000000 uImage
ext2load mmc 0 0x45000000 uInitrd
setenv initrd_high 0xffffffff
setenv bootargs console=tty1 root=LABEL=SYSp rootfstype=ext4 rootwait panic=10 ${extra}
bootm 0x41000000 0x45000000 0x43000000
EOT

# convert it to a boot.scr
mkimage -C none -A arm -T script -d /boot/boot-bananapi-initrd.cmd /boot/boot.scr

Done! Reboot! Works with a mainline kernel and a recent u-boot.

Edited by yurikhan at Jun 07, 2016 12:22

Thanks! With initramfs set up according to the above recipe, I was able to boot with my root filesystem on lvm. (root=/dev/mapper/lvm-system)

r_knipp  
Hi yurikhan,

could you please tell me in detail what you've done to get it working?
I've tried it with raspbian and bananian on a banana pi M1 with no success.
Thanks very much in advance.

Regards,
Robert

igorpec  
Check armbian, initrd is installed by default.

Hi all,
above boot.cmd doesn't work anymore with mainline kernel (vmlinuz-4.4.34-bananian).I tried the recommended addresses...


  1. setenv bootargs console=ttyS0,115200 console=tty0 console=tty1 root=/dev/mapper/langate-root rootfstype=ext4 elevator=deadline rootwait
  2. load mmc 0:1 0x43000000 uImage-next
  3. load mmc 0:1 0x41000000 uInitrd-next
  4. load mmc 0:1 0x45000000 dtb/
  5. setenv initrd_high 0xffffffff
  6. bootm 0x43000000 0x41000000 0x45000000
Copy the Code


... as well as the addresses published in  sunxi Mainline Kernel HowTo


  1. setenv bootargs console=ttyS0,115200 console=tty0 console=tty1 root=/dev/mapper/langate-root rootfstype=ext4 elevator=deadline rootwait
  2. load mmc 0:1 0x46000000 uImage-next
  3. load mmc 0:1 0x41000000 uInitrd-next
  4. load mmc 0:1 0x49000000 dtb/
  5. setenv initrd_high 0xffffffff
  6. bootm 0x46000000 0x41000000 0x49000000
Copy the Code


The result is the same:


  1. Scanning mmc 0:1...
  2. Found U-Boot script /boot.scr
  3. reading /boot.scr
  4. 1835 bytes read in 49 ms (36.1 KiB/s)
  5. ## Executing script at 43100000
  6. reading uImage-next
  7. 5681864 bytes read in 9763 ms (567.4 KiB/s)
  8. reading uImage-next
  9. 5681864 bytes read in 21000 ms (263.7 KiB/s)
  10. reading uInitrd-next
  11. 4003533 bytes read in 14839 ms (262.7 KiB/s)
  12. reading dtb/
  13. 0 bytes read in 34 ms (0 Bytes/s)
  14. ## Booting kernel from Legacy Image at 46000000 ...
  15.    Image Name:   Linux-4.4.34-bananian
  16.    Image Type:   ARM Linux Kernel Image (uncompressed)
  17.    Data Size:    5681800 Bytes = 5.4 MiB
  18.    Load Address: 40008000
  19.    Entry Point:  40008000
  20.    Verifying Checksum ... OK
  21. ## Loading init Ramdisk from Legacy Image at 41000000 ...
  22.    Image Name:   uInitrd
  23.    Image Type:   ARM Linux RAMDisk Image (uncompressed)
  24.    Data Size:    4003469 Bytes = 3.8 MiB
  25.    Load Address: 00000000
  26.    Entry Point:  00000000
  27.    Verifying Checksum ... OK
  28. ERROR: Did not find a cmdline Flattened Device Tree
  29. Could not find a valid device tree
  30. SCRIPT FAILED: continuing...
  31. scanning bus for devices...
Copy the Code


igorpec  
  1. load mmc 0:1 0x49000000 dtb/xxxxxxxxxxxxx
Copy the Code


you miss something here, like sun7i-bananapipro.dtb

You have to log in before you can reply Login | Sign Up

Points Rules