diff options
Diffstat (limited to 'libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install')
-rw-r--r-- | libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install b/libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install index 51b209923..4419c21af 100644 --- a/libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install +++ b/libre/uboot4extlinux-sunxi/uboot4extlinux-sunxi.install @@ -1,16 +1,27 @@ +flash_instructions() { + echo "# dd if=/boot/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8" +} + extlinux_warning() { echo "==> WARNING: Remember to set up your kernels in /boot/extlinux/extlinux.conf" } flash_uboot() { - echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0." - echo "Do you want to do this now? [y|N]" - read -r shouldwe - if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then - dd if=/boot/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 + root=$(mount | awk '/ on \/ / { print $1; }') + if [[ $root =~ ^/dev/mmcblk.*$ ]]; then + root=${root:0:12} + echo "A new U-Boot version needs to be flashed onto $root." + echo "Do you want to do this now? [y|N]" + read -r shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + dd if=/boot/u-boot-sunxi-with-spl.bin of=$root bs=1024 seek=8 + else + echo "You can do this later by running:" + flash_instructions + fi else - echo "You can do this later by running:" - echo "# dd if=/boot/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8" + echo "Flash the new U-Boot version onto your boot device. For example:" + flash_instructions fi extlinux_warning } |