Skip to content

6.3 Fixing up the u boot environment

Ferry Toth edited this page Nov 7, 2017 · 1 revision

6.3 Fixing up the u-boot environment

U-boot uses a sort of macro's that you can run after you have interrupted the boot process (see run do_force_flash_os above).

Inside u-boot you can see this environment by using the command:

    printenv

From when running linux and logged into the Edison you can see the environment using:

    fw_printenv

You can change a line by using setenv/fw_setenv.

  • The following lines need to be changed since the keyword mmc has changed to raw. For example inside u-boot:

    setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7"
    setenv do_dfu_alt_info_ifwi 'setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2"'
    setenv do_dfu_alt_info_mmc 'setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7"'
    
  • Inside linux replace setenv with fw_setenv.

  • Inside u-boot you will want to permanently store the above using saveenv. Inside linux, the environment is automatically stored.

  • Further on you will like to boot the new kernel. Add the following commands:

    fw_setenv edsboot 'setenv bootargs ${bootargs_edsboot}; run load_edsboot; run boot_edsboot'
    fw_setenv bootargs_edsboot 'tty1 console=ttyS2,115200n8 root=/dev/mmcblk1 rootfstype=ext4 systemd.unit=multi-user.target hardware_id=00'
    fw_setenv load_edsboot 'load mmc 0:9 0x100000 bzImage-initramfs'
    fw_setenv boot_edsboot 'zboot 0x100000'  
    
  • When we're done you you be able to boot the new system using the command: run edsboot

    The parameters root and rootfstype tell the initramfs init script to mount mmcblk1 (this should be your sdcard). It will wait for 30 seconds and search for /sbin/init on the rootfs. If the rootfs does not appear or init is not found it will mount all partitions possible and then fall back to a prompt for you to investigate the situation. The remaining parameters are passed on to the new init (systemd).