Skip to content
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ SONIC_BUILD_INSTRUCTION := make \
PLATFORM_ARCH=$(PLATFORM_ARCH) \
BUILD_NUMBER=$(BUILD_NUMBER) \
BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) \
SONIC_ENABLE_KDUMP=$(SONIC_ENABLE_KDUMP) \
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
Expand Down
9 changes: 9 additions & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,15 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get purge
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get clean -y
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get autoremove -y

# install kernel dump utility
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get install -y kdump-tools || true
sudo sed -i 's/\/MODULES=dep\//\/MODULES=most\//' $FILESYSTEM_ROOT/etc/kernel/postinst.d/kdump-tools
# TODO : this is a work around due to current kdump-tools package bug, should be removed when bug fixed
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get install -y kdump-tools
{% if sonic_kdump_enable == "y" %}
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get install -y crash
{% endif -%}

{% for file in installer_extra_files.split(' ') -%}
{% if file.strip() -%}
{% set src = file.split(':')[0] -%}
Expand Down
7 changes: 7 additions & 0 deletions files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@ if [ -f $FIRST_BOOT_FILE ]; then
mv /host/grub.cfg /host/grub/grub.cfg
fi

if `grep crashkernel=256M /proc/cmdline > /dev/null 2>&1`;
then
kdump-config unload
kdump-config symlinks `uname -r`
kdump-config load
fi

firsttime_exit
fi

Expand Down
9 changes: 8 additions & 1 deletion installer/x86_64/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ if [ "$install_env" = "onie" ]; then
onie_initrd_tmp=/
fi

enable_kdump="%%ENABLE_KDUMP%%"
KDUMP_PARAM="crashkernel=256M"

# The build system prepares this script by replacing %%DEMO-TYPE%%
# with "OS" or "DIAG".
demo_type="%%DEMO_TYPE%%"
Expand Down Expand Up @@ -536,7 +539,11 @@ trap_push "rm $grub_cfg || true"
[ -r ./platform.conf ] && . ./platform.conf

DEFAULT_GRUB_SERIAL_COMMAND="serial --port=${CONSOLE_PORT} --speed=${CONSOLE_SPEED} --word=8 --parity=no --stop=1"
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet"
if [ $enable_kdump = "y" ];then
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 ${KDUMP_PARAM} quiet"
else
DEFAULT_GRUB_CMDLINE_LINUX="console=tty0 console=ttyS${CONSOLE_DEV},${CONSOLE_SPEED}n8 quiet"
fi
GRUB_SERIAL_COMMAND=${GRUB_SERIAL_COMMAND:-"$DEFAULT_GRUB_SERIAL_COMMAND"}
GRUB_CMDLINE_LINUX=${GRUB_CMDLINE_LINUX:-"$DEFAULT_GRUB_CMDLINE_LINUX"}
export GRUB_SERIAL_COMMAND
Expand Down
3 changes: 2 additions & 1 deletion onie-mk-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ output_raw_image=$(cat onie-image.conf | grep OUTPUT_RAW_IMAGE | cut -f2 -d"=")
output_raw_image=$(eval echo $output_raw_image)

# Tailor the demo installer for OS mode or DIAG mode
sed -i -e "s/%%DEMO_TYPE%%/$demo_type/g" \
sed -i -e "s/%%ENABLE_KDUMP%%/$sonic_kdump_enable/g" \
-e "s/%%DEMO_TYPE%%/$demo_type/g" \
-e "s/%%IMAGE_VERSION%%/$image_version/g" \
-e "s/%%ONIE_IMAGE_PART_SIZE%%/$onie_image_part_size/" \
-e "s/%%EXTRA_CMDLINE_LINUX%%/$EXTRA_CMDLINE_LINUX/" \
Expand Down
2 changes: 2 additions & 0 deletions slave.mk
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ ifeq ($(SONIC_ROUTING_STACK),frr)
$(info "FRR_USER_UID" : "$(FRR_USER_UID)")
$(info "FRR_USER_GID" : "$(FRR_USER_GID)")
endif
$(info "ENABLE_KDUMP" : "$(SONIC_ENABLE_KDUMP)")
$(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)")
$(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)")
$(info "HTTP_PROXY" : "$(HTTP_PROXY)")
Expand Down Expand Up @@ -648,6 +649,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
export platform_common_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_COMMON_PY2))"
export redis_dump_load_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2))"
export install_debug_image="$(INSTALL_DEBUG_TOOLS)"
export sonic_kdump_enable="$(SONIC_ENABLE_KDUMP)"

$(foreach docker, $($*_DOCKERS),\
export docker_image="$(docker)"
Expand Down