LINUX.ORG.RU

Загрузка rootfs с флешки, U-boot

 , ,


0

1

Приветствую. Есть плата с процессором A40i и 8Гб eMMC. Для производственных задач требуется запустить на этой плате Alt Workstation. Для этого был скачан rootfs alt-workstation-mcom02-9.1-armh.tar.xz и загружен на второй раздел eMMC. Система запускается и работает, но оставшегося свободного места недостаточно. Подскажите, пожалуйста, как можно запустить систему, например, с флешки. Пробовал rootfs Alt Linux’a распаковывать на флешку и в bootargs вместо root=/dev/mmcblk2p2 указывать root=/dev/sda1. В /proc/cmdline остается root=/dev/mmcblk2p2.

Upd: Проблема решена. u-boot собирался buildroot’ом. Boot argumets определялись в файле boot.cmd из папки, определенной конфигом buildroot’а. После корректировки файла (вместо root=/dev/mmcblk2p2 указал PARTUUID раздела на флешке) была выполнена команда:

make host-uboot-tools-rebuild

Полученный файл boot.scr из /output/images/ был загружен в первый раздел eMMC.



Последнее исправление: sedlexx (всего исправлений: 1)

Там наверное uboot. Вываливайся в его меню во время загрузки и там меняй параметры.

vbr ★★★★
()
Ответ на: комментарий от vbr

в первом разделе mmc: boot.scr sun8i-a40i-sk.dtb uboot.env zImage

=> printenv arch=arm baudrate=115200 board=sunxi board_name=sunxi boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr} boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi boot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf} boot_net_usb_start=usb start boot_prefixes=/ /boot/ boot_script_dhcp=boot.scr.uimg boot_scripts=boot.scr.uimg boot.scr boot_syslinux_conf=extlinux/extlinux.conf boot_targets=fel mmc_auto scsi0 usb0 pxe dhcp bootargs=console=ttySO,115299 earlyprintk root=/dev/sda1 rootwait bootcmd=run distro_bootcmd bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z «${fdtfile}» -a -n «${soc}»; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci; bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo ‘(FEL boot)’; source ${fel_scriptaddr}; fi bootcmd_mmc0=devnum=0; run mmc_boot bootcmd_mmc1=devnum=1; run mmc_boot bootcmd_mmc_auto=if test ${mmc_bootdev} -eq 1; then run bootcmd_mmc1; run bootcmd_mmc0; elif test ${mmc_bootdev} -eq 0; then run bootcmd_mmc0; run bootcmd_mmc1; fi bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi bootcmd_scsi0=devnum=0; run scsi_boot bootcmd_usb0=devnum=0; run usb_boot bootdelay=2 bootm_size=0xa000000 console=ttyS0,115200 cpu=armv7 dfu_alt_info_ram=kernel ram 0x42000000 0x1000000;fdt ram 0x43000000 0x100000;ramdisk ram 0x43400000 0x4000000 distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_${target}; done efi_dtb_prefixes=/ /dtb/ /dtb/current/ ethaddr=02:53:a0:1e:d0:92 fdt_addr_r=0x43000000 fdtcontroladdr=7bf51150 fdtfile=sun8i-a40i-sodimm-sk.dtb fdtoverlay_addr_r=0x43300000 kernel_addr_r=0x42000000 load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile} loadaddr=0x42000000 mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi mmc_bootdev=1 partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system}; pxefile_addr_r=0x43200000 ramdisk_addr_r=0x43400000 scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}…; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi; scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplist scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z «${fdtfile}» -a -n «${soc}»; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing…; fi; setenv efi_fdtfile scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing…; fi scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing…; fi; done scriptaddr=0x43100000 scsi_boot=run scsi_init; if scsi dev ${devnum}; then devtype=scsi; run scan_dev_for_boot_part; fi scsi_init=if ${scsi_need_init}; then scsi_need_init=false; scsi scan; fi serial#=16554153a01ed092 soc=sunxi stderr=serial@1c28000 stdin=serial@1c28000 stdout=serial@1c28000 usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi uuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93b uuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3

Environment size: 4992/65532 bytes

sedlexx
() автор топика
Ответ на: комментарий от vbr

cat ./uboot.env

▒▒▒?arch=armbaudrate=115200board=sunxiboard_name=sunxiboot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fiboot_efi_bootmgr=if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fiboot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}boot_net_usb_start=usb startboot_prefixes=/ /boot/boot_script_dhcp=boot.scr.uimgboot_scripts=boot.scr.uimg boot.scrboot_syslinux_conf=extlinux/extlinux.confboot_targets=fel mmc_auto scsi0 usb0 pxe dhcp bootargs=console=ttySO,115299 earlyprintk root=/dev/sda1 rootwaitbootcmd=run distro_bootcmdbootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z «${fdtfile}» -a -n «${soc}»; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo ‘(FEL boot)’; source ${fel_scriptaddr}; fibootcmd_mmc0=devnum=0; run mmc_bootbootcmd_mmc1=devnum=1; run mmc_bootbootcmd_mmc_auto=if test ${mmc_bootdev} -eq 1; then run bootcmd_mmc1; run bootcmd_mmc0; elif test ${mmc_bootdev} -eq 0; then run bootcmd_mmc0; run bootcmd_mmc1; fibootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fibootcmd_scsi0=devnum=0; run scsi_bootbootcmd_usb0=devnum=0; run usb_bootbootdelay=2bootm_size=0xa000000console=ttyS0,115200cpu=armv7dfu_alt_info_ram=kernel ram 0x42000000 0x1000000;fdt ram 0x43000000 0x100000;ramdisk ram 0x43400000 0x4000000distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_${target}; doneefi_dtb_prefixes=/ /dtb/ /dtb/current/ethaddr=02:53:a0:1e:d0:92fdt_addr_r=0x43000000fdtcontroladdr=7bf51150fdtfile=sun8i-a40i-sodimm-sk.dtbfdtoverlay_addr_r=0x43300000kernel_addr_r=0x42000000load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}loadaddr=0x42000000mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fimmc_bootdev=1partitions=name=loader1,start=8k,size=32k,uuid=${uuid_gpt_loader1};name=loader2,size=984k,uuid=${uuid_gpt_loader2};name=esp,size=128M,bootable,uuid=${uuid_gpt_esp};name=system,size=-,uuid=${uuid_gpt_system};pxefile_addr_r=0x43200000ramdisk_addr_r=0x43400000scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}…; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done; setenv devplistscan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z «${fdtfile}» -a -n «${soc}»; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing…; fi; setenv efi_fdtfilescan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing…; fiscan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing…; fi; donescriptaddr=0x43100000scsi_boot=run scsi_init; if scsi dev ${devnum}; then devtype=scsi; run scan_dev_for_boot_part; fiscsi_init=if ${scsi_need_init}; then scsi_need_init=false; scsi scan; fiserial#=16554153a01ed092soc=sunxistderr=serial@1c28000stdin=serial@1c28000stdout=serial@1c28000usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fiuuid_gpt_esp=c12a7328-f81f-11d2-ba4b-00a0c93ec93buuid_gpt_system=69dad710-2ce4-4e3c-b16c-21a1d49abed3#

sedlexx
() автор топика
Ответ на: комментарий от vbr

Также пробовал установить переменную distro_bootcmd=scsi_need_init=; for target in ${boot_targets}; do run bootcmd_usb0; done В результате появился выбор:

ALT Boot Options
1:      linux
2:      4.4.189.1-mcom02-alt1
Вне зависимости от выборы система зависает после Starting kernel ...

CPU:   Allwinner R40 (SUN8I 1701)
Model: Starterkit SK-A40i-SODIMM
DRAM:  1 GiB
Core:  35 devices, 18 uclasses, devicetree: separate
WDT:   Not starting watchdog@1c20c90
MMC:   mmc@1c11000: 1, mmc@1c12000: 2
Loading Environment from FAT... OK
In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Net:   phy interface0
eth0: ethernet@1c50000
Hit any key to stop autoboot:  0
starting USB...
Bus usb@1c19000: USB EHCI 1.00
Bus usb@1c19400: USB OHCI 1.0
Bus usb@1c1c000: USB EHCI 1.00
Bus usb@1c1c400: USB OHCI 1.0
scanning bus usb@1c19000 for devices... 1 USB Device(s) found
scanning bus usb@1c19400 for devices... 4 USB Device(s) found
scanning bus usb@1c1c000 for devices... 1 USB Device(s) found
scanning bus usb@1c1c400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Device 0: Vendor: Generic  Rev: 8.07 Prod: Flash Disk
            Type: Removable Hard Disk
            Capacity: 15000.0 MB = 14.6 GB (30720000 x 512)
... is now current device
Scanning usb 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
ALT Boot Options
1:      linux
2:      4.4.189.1-mcom02-alt1
Enter choice: 2
2:      4.4.189.1-mcom02-alt1
Retrieving file: /boot/initrd-4.4.189.1-mcom02-alt1.img
Retrieving file: /boot/vmlinuz-4.4.189.1-mcom02-alt1
append: root=UUID=93e796a1-f1bf-421a-b5cb-5087bb605ff5 ro console=ttyS0,115200 video=HDMI:1920x1080
Kernel image @ 0x42000000 [ 0x000000 - 0x428c60 ]
## Flattened Device Tree blob at 7bf51150
   Booting using the fdt blob at 0x7bf51150
   Loading Ramdisk to 49c02000, end 49fff6af ... OK
   Loading Device Tree to 49bf7000, end 49c01d6f ... OK

Starting kernel ...
sedlexx
() автор топика
Для того чтобы оставить комментарий войдите или зарегистрируйтесь.