Skip to content

Commit 50db98e

Browse files
byu343yxieca
authored andcommitted
[arista]: Fix convertfs condition for booting from EOS (#4139)
Fix the issue of incorrectly skipping the convertfs hook when fast-reboot from EOS, by adding an extra kernel cmdline param "prev_os" to differentiate fast-reboot from EOS and from SONiC. This is because we still do disk conversion for fast reboot from eos to sonic, like format the disk.
1 parent eb93ad4 commit 50db98e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

files/Aboot/boot0.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ write_boot_configs() {
307307
}
308308

309309
run_kexec() {
310-
local cmdline="$(cat $cmdline_image | tr '\n' ' ')"
310+
local cmdline="$(cat $cmdline_image | tr '\n' ' ') $ENV_EXTRA_CMDLINE"
311311
local kernel="${KERNEL:-$(find $image_path/boot -name 'vmlinuz-*' -type f | head -n 1)}"
312312
local initrd="${INITRD:-$(find $image_path/boot -name 'initrd.img-*' -type f | head -n 1)}"
313313

files/initramfs-tools/arista-convertfs.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ flash_dev=''
1818
block_flash=''
1919
aboot_flag=''
2020
backup_file=''
21+
prev_os=''
22+
sonic_fast_reboot=''
2123

2224
# Wait until get the fullpath of flash device, e.g., /dev/sda
2325
wait_get_flash_dev() {
@@ -133,12 +135,21 @@ for x in "$@"; do
133135
docker_inram=*)
134136
docker_inram="${x#docker_inram=}"
135137
;;
138+
prev_os=*)
139+
prev_os="${x#prev_os=}"
140+
;;
141+
SONIC_BOOT_TYPE=warm*|SONIC_BOOT_TYPE=fast*)
142+
sonic_fast_reboot=true
143+
;;
136144
esac
137145
done
138146

139147
#Check aboot
140148
[ -z "$aboot_flag" ] && exit 0
141149

150+
# Skip this script for warm-reboot/fast-reboot from sonic
151+
[ "$sonic_fast_reboot" == true ] && [ "$prev_os" != eos ] && exit 0
152+
142153
# Get flash dev name
143154
if [ -z "$block_flash" ]; then
144155
echo "Error: flash device info is not provided"

0 commit comments

Comments
 (0)