Skip to content

Commit

Permalink
use linbo_reboot bypassing the grub menu if linbo_warmstart is switch…
Browse files Browse the repository at this point in the history
…ed off.
  • Loading branch information
HappyBasher committed Nov 25, 2023
1 parent f9d7c66 commit 5635826
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
18 changes: 18 additions & 0 deletions linbofs/usr/bin/linbo_reboot
@@ -0,0 +1,18 @@
#!/bin/sh
#
# linbo_reboot
# thomas@linuxmuster.net
# 20231125
#

source /usr/share/linbo/shell_functions || exit 1
source /conf/linbo || exit 1

linbo_mountcache || exit 1

FORCEGRUB="yes"

mk_boot "$cache" "linbo64" "linbofs64" "$kerneloptions" | tee -a /tmp/linbo.log ; RC="$?"
[ "$RC" = "0" ] || exit 1

/sbin/reboot -f
32 changes: 20 additions & 12 deletions linbofs/usr/bin/linbo_warmstart
Expand Up @@ -2,7 +2,7 @@
#
# linbo_warmstart
# thomas@linuxmuster.net
# 20231122
# 20231125
#

# get environment
Expand All @@ -25,15 +25,23 @@ if [ ! -s "$KERNEL" -o ! -s "$INITRD" ]; then
exit 1
fi

echo "Initiating linbo warmstart ..."
if warmstart; then

# load linbo kernel
if ! $KEXEC --type="bzImage64" --reuse-cmdline --initrd="$INITRD" --load "$KERNEL"; then
echo "Failed to load kernel!"
exit 1
fi
# execute linbo kernel
if ! $KEXEC -e; then
echo "Failed to execute kernel!"
exit 1
fi
echo "Initiating linbo warmstart ..."

# load linbo kernel
if ! $KEXEC --type="bzImage64" --reuse-cmdline --initrd="$INITRD" --load "$KERNEL"; then
echo "Failed to load kernel!"
exit 1
fi
# execute linbo kernel
if ! $KEXEC -e; then
echo "Failed to execute kernel!"
exit 1
fi

else

linbo_reboot

fi

0 comments on commit 5635826

Please sign in to comment.