From 3e97fd7d71ceafaa4e755d679fd0888ed4891d47 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Sun, 24 Feb 2019 22:06:07 +0100 Subject: libre: uboot4extlinux-sunxi: sync with uboot4extlinux-am335x Signed-off-by: Denis 'GNUtoo' Carikli --- libre/uboot4extlinux-sunxi/PKGBUILD | 2 +- .../uboot4extlinux-sunxi.install | 25 ++++++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/libre/uboot4extlinux-sunxi/PKGBUILD b/libre/uboot4extlinux-sunxi/PKGBUILD index 16f895f44..b25bcc35c 100644 --- a/libre/uboot4extlinux-sunxi/PKGBUILD +++ b/libre/uboot4extlinux-sunxi/PKGBUILD @@ -26,7 +26,7 @@ pkgname=('uboot4extlinux-a10-olinuxino-lime' 'uboot4extlinux-orangepi_pc' 'uboot4extlinux-orangepi_plus') pkgver=2019.01 -pkgrel=1 +pkgrel=2 arch=('armv7h') url="http://git.denx.de/u-boot.git/" license=('GPL') 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 } -- cgit v1.2.3