summaryrefslogtreecommitdiff
path: root/package/fwupdate
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2017-02-09 04:01:36 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2017-02-09 04:01:57 +0100
commit571d99e74d42fac830069c2ca2fbd5f505613dc6 (patch)
treedb2700a1dd94b5b6760ee19573ef7395e6e1d901 /package/fwupdate
parentfdfd165799d762acd6cf5871bfcb1493da1359e9 (diff)
add dual-boot / fwupdate for systems with grub-support
Diffstat (limited to 'package/fwupdate')
-rw-r--r--package/fwupdate/Makefile3
-rwxr-xr-xpackage/fwupdate/src/fwupdate16
2 files changed, 16 insertions, 3 deletions
diff --git a/package/fwupdate/Makefile b/package/fwupdate/Makefile
index 729ea6def..8cf897ed4 100644
--- a/package/fwupdate/Makefile
+++ b/package/fwupdate/Makefile
@@ -8,8 +8,11 @@ PKG_VERSION:= 1.0
PKG_RELEASE:= 1
PKG_DESCR:= update firmware
PKG_SECTION:= base/adk
+PKG_DEPENDS:= mke2fs
PKG_URL:= http://www.openadk.org
+PKG_CFLINE_FWUPDATE:= select BUSYBOX_SHA256SUM@
+
NO_DISTFILES:= 1
include $(ADK_TOPDIR)/mk/package.mk
diff --git a/package/fwupdate/src/fwupdate b/package/fwupdate/src/fwupdate
index 7a73115e0..1efe08339 100755
--- a/package/fwupdate/src/fwupdate
+++ b/package/fwupdate/src/fwupdate
@@ -44,7 +44,7 @@ CHECK_SUM_NEW_SYSTEM=$(tar -xf $FIRMWARE $FW_NAME -O | sha256sum - |cut -d\ -f1
echo "Compare the checksums ..."
if [ "X$CHECK_SUM_NEW_SYSTEM" = "X$CHECK_SUM_UPDATE_FILE" ]; then
- echo "Checksum verified (they match): "
+ echo "Checksum verified (they match) ..."
else
echo "Checksum does not match!"
echo "${CHECK_SUM_UPDATE_FILE} "
@@ -130,8 +130,18 @@ fi
cd /
umount $MOUNTPART
-mount -o remount,rw /boot
+grep /boot /proc/mounts 2>/dev/null
+if [ $? -eq 0 ]; then
+ mount -o remount,rw /boot
+else
+ mount /dev/sda1 /boot
+fi
grub-reboot $OS
-mount -o remount,ro /boot
+grep /boot /proc/mounts 2>/dev/null
+if [ $? -eq 0 ]; then
+ mount -o remount,ro /boot
+else
+ umount /boot
+fi
sync
echo "Reboot now to the updated system $OS"