Make troubleshoot work with dracut ramdisks
Currently, calling the troubleshoot function in a ramdisk script doesn't work as expected on dracut ramdisks. This adds an alternate troubleshoot implementation that will behave as intended. I did not make it conditional on a kernel param as was done in the original because dracut can behave strangely if you allow it to continue after an error. Always dropping to a shell immediately should be less confusing. Change-Id: I98000f4ac6d7890b1f44fe4d10394ac0ea332fcb
This commit is contained in:
parent
7917e7416b
commit
ffe825113e
@ -11,8 +11,6 @@ rootok=1
|
|||||||
# Dracut doesn't correctly parse the ip argument passed to us.
|
# Dracut doesn't correctly parse the ip argument passed to us.
|
||||||
# Override /proc/cmdline to rewrite it in a way dracut can grok.
|
# Override /proc/cmdline to rewrite it in a way dracut can grok.
|
||||||
sed 's/\(ip=\S\+\)/\1:::off/' /proc/cmdline > /run/cmdline
|
sed 's/\(ip=\S\+\)/\1:::off/' /proc/cmdline > /run/cmdline
|
||||||
# Map the existing "troubleshoot" kernel param to the Dracut equivalent.
|
|
||||||
sed -i 's/troubleshoot=/rd.shell=/' /run/cmdline
|
|
||||||
mount -n --bind -o ro /run/cmdline /proc/cmdline
|
mount -n --bind -o ro /run/cmdline /proc/cmdline
|
||||||
# Force Dracut to re-read the cmdline args
|
# Force Dracut to re-read the cmdline args
|
||||||
CMDLINE=
|
CMDLINE=
|
||||||
|
7
elements/dracut-ramdisk/init.d/00-override-troubleshoot
Normal file
7
elements/dracut-ramdisk/init.d/00-override-troubleshoot
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# NOTE(bnemec): Dracut provides its own emergency shell, and it doesn't
|
||||||
|
# seem to allow directly starting bash as the existing troubleshoot function
|
||||||
|
# does.
|
||||||
|
function troubleshoot() {
|
||||||
|
echo "Starting troubleshooting shell."
|
||||||
|
emergency_shell
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user