Skip to content

Commit

Permalink
Merge pull request #170 from moul/fix-168
Browse files Browse the repository at this point in the history
Add custom parameters to the cmdline when KEXECing
  • Loading branch information
Quentin Perez authored Oct 24, 2016
2 parents 0b342b1 + 824d3a7 commit d32379e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Linux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions Linux/tree-common/init
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d32379e

Please sign in to comment.