forked from pinecrypt/butterknife-provisioning-image
Updates and fixes
Some checks reported errors
continuous-integration/drone Build encountered an error
Some checks reported errors
continuous-integration/drone Build encountered an error
This commit is contained in:
@@ -6,7 +6,6 @@ action=$(dialog --menu "Advanced options, consider your warranty VOID!" 0 0 0 \
|
||||
shell "Drop to shell" \
|
||||
instance "Instance maintenance and recovery" \
|
||||
subvol "Delete instances/templates" \
|
||||
restore "Restore Windows master boot record" \
|
||||
2>&1 >$(tty))
|
||||
clear
|
||||
|
||||
@@ -72,19 +71,5 @@ case $action in
|
||||
umount $mountpoint
|
||||
rmdir $mountpoint
|
||||
;;
|
||||
restore)
|
||||
disk=$(butterknife-select-disk 2>&1 >$(tty))
|
||||
|
||||
# Select MBR type
|
||||
action=$(dialog --menu "What kind of master boot record would you like to restore? You might have to mark partition bootable using fdisk." 0 0 0 \
|
||||
mbr7 "Windows 7/8/10" \
|
||||
mbrvista "Windows Vista" \
|
||||
mbr "Windows 2000/XP/2003" \
|
||||
2>&1 >$(tty))
|
||||
|
||||
cmd="ms-sys --$action /dev/$disk"
|
||||
$cmd | dialog --programbox "$cmd" 10 76
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@@ -3,6 +3,19 @@
|
||||
# TODO: Make sure fdisk from busybox is NOT used, it's counting sectors incorrectly (?!)
|
||||
# TODO: Check connectivity with API server
|
||||
|
||||
#######################################
|
||||
### Check for presence of utilities ###
|
||||
#######################################
|
||||
for util in btrfs jq fdisk find ntfsresize udp-sender udp-receiver ntpdate curl mktemp sgdisk test true sort uniq dig; do
|
||||
if [ -z "$(which $util)" ]; then
|
||||
echo "Butterknife was unable to locate $util," \
|
||||
"are you sure the provisioning image was compiled properly?"
|
||||
exit 253
|
||||
else
|
||||
echo "Found $util..."
|
||||
fi
|
||||
done
|
||||
|
||||
BUTTERKNIFE_POOL_MOUNTPOINT=/var/lib/butterknife/pool
|
||||
TARGET_MOUNTPOINT=/mnt/target
|
||||
|
||||
|
@@ -42,6 +42,11 @@ if [ $bk_action == "provision" ]; then
|
||||
poweroff -f
|
||||
fi
|
||||
|
||||
if [ $bk_action == "poweroff" ]; then
|
||||
poweroff -f
|
||||
fi
|
||||
|
||||
|
||||
while [ 1 ]; do
|
||||
action=$(dialog --no-cancel --menu "What do you want to do" 0 0 0 \
|
||||
provision "Provision this machine" \
|
||||
|
Reference in New Issue
Block a user