Skip to content

Commit

Permalink
recovery-sign: tweak colors, add reboot
Browse files Browse the repository at this point in the history
  • Loading branch information
osresearch committed Aug 22, 2020
1 parent 6a73606 commit f05a4be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 5 additions & 2 deletions initramfs/scripts/safeboot-bootmode
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ mount -t efivarfs none /sys/firmware/efi/efivars


cat >&2 <<'EOF'
[1;35m
[1;44;35m
____ __ _ _ _ ____
/ / /__ __ _ / _| ___| |__ ___ ___ | |_ __| | _____ __/ / /
/ / / __|/ _` | |_ / _ \ '_ \ / _ \ / _ \| __| / _` |/ _ \ \ / / / /
/ / /\__ \ (_| | _| __/ |_) | (_) | (_) | |_ | (_| | __/\ V / / /
/_/_/ |___/\__,_|_| \___|_.__/ \___/ \___/ \__(_)__,_|\___| \_/_/_/
[41;34m
[1;41;35m
_ __ ___ ___ _____ _____ _ __ _ _ _ __ ___ ___ __| | ___
| '__/ _ \/ __/ _ \ \ / / _ \ '__| | | | | '_ ` _ \ / _ \ / _` |/ _ \
| | | __/ (_| (_) \ V / __/ | | |_| | | | | | | | (_) | (_| | __/
Expand All @@ -92,6 +92,9 @@ Useful commands:
safeboot linux-sign
safeboot pcrs-sign
# Unmount all filesystems and reboot into normal Linux
safeboot reboot
EOF

SAFEBOOT="recovery"
Expand Down
12 changes: 11 additions & 1 deletion sbin/safeboot
Original file line number Diff line number Diff line change
Expand Up @@ -1181,10 +1181,20 @@ reboot() {
umount /boot/efi
umount /boot
mount -o ro,remount "$ROOTDEV"
sync ; sync ; sync

warn "Initiating reboot!"
sleep 2
/sbin/reboot
sync ; sync ; sync

if [ -x "/usr/bin/reboot" ]; then
# busybox reboot, no init to go through
exec /usr/bin/reboot -f
fi
if [ -x "/sbin/reboot" ]; then
# normal reboot process
exec /sbin/reboot
fi
}

########################################
Expand Down

0 comments on commit f05a4be

Please sign in to comment.