Skip to content

Commit 451664d

Browse files
committed
change DEFAULT_GRUB_CMDLINE_LINUX according to var sonic_kdump_enable
1 parent e72d952 commit 451664d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

installer/x86_64/install.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ if [ "$install_env" = "onie" ]; then
125125
onie_initrd_tmp=/
126126
fi
127127

128+
enable_kdump="%%ENABLE_KDUMP%%"
129+
KDUMP_PARAM="crashkernel=256M"
130+
128131
# The build system prepares this script by replacing %%DEMO-TYPE%%
129132
# with "OS" or "DIAG".
130133
demo_type="%%DEMO_TYPE%%"
@@ -536,7 +539,11 @@ trap_push "rm $grub_cfg || true"
536539
[ -r ./platform.conf ] && . ./platform.conf
537540
538541
DEFAULT_GRUB_SERIAL_COMMAND="serial --port=${CONSOLE_PORT} --speed=${CONSOLE_SPEED} --word=8 --parity=no --stop=1"
539-
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet"
542+
if [ $enable_kdump = "y" ];then
543+
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 ${KDUMP_PARAM} quiet"
544+
else
545+
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet"
546+
fi
540547
GRUB_SERIAL_COMMAND=${GRUB_SERIAL_COMMAND:-"$DEFAULT_GRUB_SERIAL_COMMAND"}
541548
GRUB_CMDLINE_LINUX=${GRUB_CMDLINE_LINUX:-"$DEFAULT_GRUB_CMDLINE_LINUX"}
542549
export GRUB_SERIAL_COMMAND

onie-mk-demo.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ output_raw_image=$(cat onie-image.conf | grep OUTPUT_RAW_IMAGE | cut -f2 -d"=")
8989
output_raw_image=$(eval echo $output_raw_image)
9090

9191
# Tailor the demo installer for OS mode or DIAG mode
92-
if [ $sonic_kdump_enable = "y" ]; then
93-
sed -i "s/[^M] quiet/ crashkernel=256M quiet/" $tmp_installdir/install.sh
94-
fi
95-
sed -i -e "s/%%DEMO_TYPE%%/$demo_type/g" \
92+
sed -i -e "s/%%ENABLE_KDUMP%%/$sonic_kdump_enable/g" \
93+
-e "s/%%DEMO_TYPE%%/$demo_type/g" \
9694
-e "s/%%IMAGE_VERSION%%/$image_version/g" \
9795
-e "s/%%ONIE_IMAGE_PART_SIZE%%/$onie_image_part_size/" \
9896
-e "s/%%EXTRA_CMDLINE_LINUX%%/$EXTRA_CMDLINE_LINUX/" \

0 commit comments

Comments
 (0)