Some debugging helpers

Install terminfo files so that less is useful.  Also, timeout mounting
the rootfs so that we can debug better
master
Jeremy Katz 2008-12-15 14:40:36 -05:00
parent 7a18688c32
commit ca9f625917
2 changed files with 7 additions and 0 deletions

View File

@ -33,6 +33,9 @@ for rule in /lib/udev/rules.d/40-redhat* /lib/udev/rules.d/60-persistent-storage
cp -v $rule $tmpdir/lib/udev/rules.d
done

# terminfo bits make things work better if you fall into interactive mode
for f in $(find /lib/terminfo -type f) ; do cp -v --parents $f "$tmpdir" ; done

# install our files
cp -v init $tmpdir/init
cp -v switch_root $tmpdir/sbin/switch_root

4
init
View File

@ -7,6 +7,7 @@

emergency_shell()
{
echo ; echo
echo "Bug in initramfs /init detected. Dropping to a shell. Good luck!"
echo
bash
@ -61,6 +62,9 @@ while [ ! -e $root ]; do
echo -n "."
sleep 1
tries=$(($tries + 1))
if [ $tries -gt 10 ]; then
emergency_shell
fi
done
echo -e "\n\nMounted rootfs after $tries seconds"
ln -s "$root" /dev/root