From 4cef4ea92ac0f3be3974e8a334ad4a20e359939f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E9=91=AB?= Date: Fri, 4 Aug 2023 07:14:18 +0000 Subject: [PATCH] =?UTF-8?q?Revert=20"TSG-16020:=20=E9=80=9A=E8=BF=87kexec?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=BF=AB=E9=80=9F=E5=86=85=E6=A0=B8=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E8=B7=B3=E8=BF=87=E7=A1=AC=E4=BB=B6=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=8A=A0=E5=BF=AB=E5=8D=87=E7=BA=A7=E6=B5=81=E7=A8=8B"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit fc5aae23fea8074563d2bd329ca7d4a873043477 --- installer/install.sh | 19 +------------ rootconf/sysroot-bin/onie-reboot-install | 36 ++++-------------------- 2 files changed, 6 insertions(+), 49 deletions(-) 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