[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
no way to compare when less than two revisions
Diferencias
Muestra las diferencias entre dos versiones de la página.
— | es:howtos:hardware:arm:sone_u-boot_hints [2019/03/17 23:45 (UTC)] (actual) – creado rramp | ||
---|---|---|---|
Línea 1: | Línea 1: | ||
+ | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | ||
+ | ====== Making it easy for u-boot to find uImage and uinitrd ====== | ||
+ | I often fiddle with testing root images, kernels and initrd on my kirkwood based systems by using usb flash sticks. I found that although Jeff did a brilliant job on uboot, at the time I started fiddling with custom boot images on my dosckstar, his default environment was unable to directly boot all my testing images that were rapidly changing in layout. To work around this I started making canges to his environment. | ||
+ | I made myself a custom environment that was more flexible and allowed me to boot from any usb port as long as the following limitations are met: | ||
+ | * the kernel must be called uImage or must be linked with that name | ||
+ | * the initrd must be called uinitrd or must be linked with that name | ||
+ | * uImage and uinitrd must be contained in the first 4 detected usb devices | ||
+ | * uImage and uinitrd must be in the root or in a boot sub-directory in the device that holds them | ||
+ | * the root filesystem bust be labelled " | ||
+ | |||
+ | Heres the environment dumped from fw_printenv: | ||
+ | |||
+ | arcNumber=< | ||
+ | baudrate=115200 | ||
+ | boot_flash_kernel=nand read $flash_kernel_load_addr $flash_kernel_offest $flash_kernel_size; | ||
+ | bootargs=console=ttyS0, | ||
+ | bootcmd=run usb_scan; run set_flash_bootargs; | ||
+ | bootdelay=3 | ||
+ | console=console=ttyS0, | ||
+ | ethact=egiga0 | ||
+ | ethaddr=< | ||
+ | flash_kernel_load_addr=0x6400000 | ||
+ | flash_kernel_offest=0x100000 | ||
+ | flash_kernel_size=0x300000 | ||
+ | flash_root_fs=root=/ | ||
+ | flash_root_fstype=rootfstype=jffs2 | ||
+ | led_error=orange blinking | ||
+ | led_exit=green off | ||
+ | led_init=green blinking | ||
+ | mainlineLinux=yes | ||
+ | mtdids=nand0=orion_nand | ||
+ | mtdparts=mtdparts=orion_nand: | ||
+ | partition=nand0, | ||
+ | root_fs=root=LABEL=root | ||
+ | rootfstype=rootfs=ext3 | ||
+ | sb_scan_1=usb=0: | ||
+ | set_flash_bootargs=setenv bootargs ${console} ${mtdparts} ${flash_root_fs} ro ${flash_root_fstype} | ||
+ | set_usb_bootargs=setenv bootargs ${console} ${mtdparts} ${root_fs} ro ${root_fstype} | ||
+ | stderr=serial | ||
+ | stdin=serial | ||
+ | stdout=serial | ||
+ | usb_boot_6=setenv root_fs root=/ | ||
+ | usb_dev_list=3 2 1 0 | ||
+ | usb_dev_part=1 | ||
+ | usb_part_list=4 3 2 1 | ||
+ | usb_scan=usb start; setenv usb_boot_dev none; for dev in $usb_dev_list; | ||
+ | |||
+ | |||
+ | Labeling the root filesystem was a workaround when I started getting issues on device namings changes as I began using the SATA drives for NAS storage. In practice what was happening was that uboot thought that root was on sda but once the kernel booted it would detect the SATA drives before that and name the usb memory stick to after the last SATA drive causing a kernel panic as initrd attempts to mount the root filesystem. | ||
+ | I thus changed the u-boot environment to pass the root device as a label rather then a device path. This allows me to boot my GoFlexNet correctly from any usb stick (even trough a usb hub) regardless of the presence of the SATA drives. | ||
+ | |||
+ | To my understanding the latest uboot environments actually do more then this now ... so here's my last hybrid environment: | ||
+ | |||
+ | arcNumber=3089 | ||
+ | baudrate=115200 | ||
+ | bifsload=0x800000 / | ||
+ | bootargs=${console} ${mtdparts} ${root_fs} ro ${rootfstype} | ||
+ | bootcmd=usb start; run force_rescue_bootcmd; | ||
+ | bootdelay=3 | ||
+ | console=ttyS0, | ||
+ | ethact=egiga0 | ||
+ | ethaddr=xx: | ||
+ | force_rescue=0 | ||
+ | force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 / | ||
+ | initrd=uinitrd | ||
+ | kernel=uImage | ||
+ | led_error=orange blinking | ||
+ | led_exit=green off | ||
+ | led_init=green blinking | ||
+ | mainlineLinux=yes | ||
+ | mtdids=nand0=orion_nand | ||
+ | mtdparts=mtdparts=orion_nand: | ||
+ | partition=nand0, | ||
+ | pogo_bootcmd=if fsload uboot-original-mtd0.kwb; | ||
+ | rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; | ||
+ | rescue_installed=0 | ||
+ | rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0: | ||
+ | root_fs=root=LABEL=root | ||
+ | rootfstype=rootfs=ext3 | ||
+ | safearcNumber=2097 | ||
+ | setbootargs=setenv bootargs console=${console} ${mtdparts} ${root_fs} ro ${rootfstype} | ||
+ | stderr=serial | ||
+ | stdin=serial | ||
+ | stdout=serial | ||
+ | ubifs_bootcmd=run ubifs_set_bootargs; | ||
+ | ubifs_mtd=3 | ||
+ | ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0: | ||
+ | usb_dev_list=3 2 1 0 | ||
+ | usb_part_list=4 3 2 1 | ||
+ | usb_rootdelay=10 | ||
+ | usb_scan=sleep 5; setenv usb_boot_dev none; for dev in $usb_dev_list; | ||
+ | |||
+ | ====== Sources ====== | ||
+ | <!-- If you are copying information from another source, then specify that source --> | ||
+ | <!-- * Original source: [[http:// | ||
+ | <!-- Authors are allowed to give credit to themselves! --> | ||
+ | <!-- * Originally written by [[wiki: | ||
+ | <!-- * Contributions by [[wiki: | ||
+ | |||
+ | <!-- Please do not modify anything below, except adding new tags.--> | ||
+ | <!-- You must remove the tag-word " | ||
+ | {{tag> |