From a0e4cae7c49449f0b788bf1f10089cc517cad742 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Thu, 8 Dec 2016 03:46:36 +0000 Subject: [PATCH] Support manual uninstall mode as a last resort. --- .../all/vendor-config-onl/src/sbin/uninstall | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/base/all/vendor-config-onl/src/sbin/uninstall b/packages/base/all/vendor-config-onl/src/sbin/uninstall index c76464d5..2fb1c9e0 100755 --- a/packages/base/all/vendor-config-onl/src/sbin/uninstall +++ b/packages/base/all/vendor-config-onl/src/sbin/uninstall @@ -3,13 +3,25 @@ set -e uninstall_x86_64() { + if [ "$1" = "manual" ]; then + # Clear any ONIE boot selection settings and default to Install + mkdir -p /mnt/onie-boot + mount `blkid -L ONIE-BOOT` /mnt/onie-boot + rm -rf /mnt/onie-boot/grubenv + umount /mnt/onie-boot + + # Force ONIE boot selection + onlfs mount boot --rw + echo "default=1" >> /mnt/onl/boot/grub/grub.cfg - if [ "$1" = "factory" ]; then - mode=uninstall else - mode=install + if [ "$1" = "factory" ]; then + mode=uninstall + else + mode=install + fi + onl-onie-boot-mode $mode fi - onl-onie-boot-mode $mode } uninstall_uboot()