diff --git a/Linux/README.md b/Linux/README.md index b72d3d6..8d82b53 100644 --- a/Linux/README.md +++ b/Linux/README.md @@ -251,6 +251,12 @@ Here are the availble *initrd variables*: ## Changelog +### master (unreleased) + +* Add custom parameters to the cmdline when KEXECing with `KEXEC_APPEND=xxx` ([#168](https://github.com/scaleway/initrd/issues/168)) + +[full commits list](https://github.com/scaleway/initrd/compare/v3.12...master) + ### 3.12 (2016-10-19) * kexec improvements diff --git a/Linux/tree-common/init b/Linux/tree-common/init index a325a40..4a915fe 100755 --- a/Linux/tree-common/init +++ b/Linux/tree-common/init @@ -257,7 +257,8 @@ else if [ "$(get_any KEXEC_KERNEL 'default')" != "default" -a "$(get_any KEXEC_INITRD 'default')" != "default" ]; then KEXEC_KERNEL="$(get_any KEXEC_KERNEL default)" KEXEC_INITRD="$(get_any KEXEC_INITRD default)" - esuccess "kexec: kernel=${KEXEC_KERNEL} initrd=${KEXEC_INITRD}" + KEXEC_APPEND="$(get_any KEXEC_APPEND '')" + esuccess "kexec: kernel=${KEXEC_KERNEL} initrd=${KEXEC_INITRD} append='${KEXEC_APPEND}'" # get kernel and initrd mkdir -p /boot @@ -281,9 +282,9 @@ else if [ -f /boot/initrd ]; then # detach nbd devices detach_nbd_devices - + # kexec - kexec -l /boot/kernel --initrd=/boot/initrd --append="$(cat /proc/cmdline) is_in_kexec=yes" -f + kexec -l /boot/kernel --initrd=/boot/initrd --append="$(cat /proc/cmdline) is_in_kexec=yes ${KEXEC_APPEND}" -f else ewarn "kexec: initrd not found" fi