diff --git a/installer/install.sh b/installer/install.sh index 1517c944..5fdb0245 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -369,21 +369,4 @@ umount ${distro_mnt} cd / echo "TSG-OS install successfully, need to reboot." -if grep -q "fastreboot=1" /proc/cmdline ; then - echo "os need fastboot" - mkdir -p /tmp/os - mount /dev/sda4 /tmp/os - - if [ -e /tmp/os/boot/vmlinuz ] && [ -e /tmp/os/boot/initrd.img ]; then - kexec -l /tmp/os/boot/vmlinuz --initrd=/tmp/os/boot/initrd.img \ - --append="$(cat /proc/cmdline | sed 's/fastboot=1 //')" - - kexec -e - else - echo "vmlinuz and initrd.img do not exist in /tmp/os/boot. Exiting." - exit 0 - fi -else - echo "Don't need fastboot" - exit 0 -fi \ No newline at end of file +exit 0 diff --git a/rootconf/sysroot-bin/onie-reboot-install b/rootconf/sysroot-bin/onie-reboot-install index 16463ded..5c6c64bd 100755 --- a/rootconf/sysroot-bin/onie-reboot-install +++ b/rootconf/sysroot-bin/onie-reboot-install @@ -4,36 +4,10 @@ # # SPDX-License-Identifier: GPL-2.0 +. /lib/onie/common-blkdev -# Check for --no-kexec argument -if [ "$1" = "--no-kexec" ] -then - . /lib/onie/common-blkdev +echo "Rebooting into ONIE (re)install mode..." - echo "Rebooting into ONIE (re)install mode..." - set_onie_next_boot - /mnt/onie-boot/onie/tools/bin/onie-boot-mode -q -o install - echo "Rebooting with reboot command..." - reboot -else - echo "Rebooting with kexec command..." - - # Find vmlinuz and initrd files in /mnt/onie-boot - vmlinuz_file=$(find /mnt/onie-boot -name 'vmlinuz*' | head -n 1) - initrd_file=$(find /mnt/onie-boot -name 'initrd*' | head -n 1) - - if [ -z "$vmlinuz_file" ] || [ -z "$initrd_file" ] - then - echo "Error: vmlinuz or initrd file not found. Falling back to reboot command." - reboot - else - # Get current kernel command line parameters - current_kernel_params=$(cat /proc/cmdline) - - # Load the kernel and initrd using kexec - kexec -l "$vmlinuz_file" --initrd="$initrd_file" --append="fastreboot=1 $current_kernel_params" - - # Execute kexec - kexec -e - fi -fi \ No newline at end of file +set_onie_next_boot +/mnt/onie-boot/onie/tools/bin/onie-boot-mode -q -o install +reboot