mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
'adopt initcpio changes'
This commit is contained in:
parent
8db3cbda1e
commit
81d06e3442
1 changed files with 32 additions and 29 deletions
|
@ -89,40 +89,43 @@ if [ "${root}" = "" -a "${ip}" = "" ]; then
|
|||
# enter install environment
|
||||
exec /sbin/init
|
||||
else
|
||||
# boot into system
|
||||
if [ ! -b "${root}" ]; then
|
||||
# This duplicates code from the filesystem hook
|
||||
# without this, mkinitcpio would fail for users who use
|
||||
# neither the udev hook, nor the filesystem hook
|
||||
msg "\nRoot device '${root}' doesn't exist, attempting to create it"
|
||||
|
||||
eval $(/bin/parseblock "${root}")
|
||||
if [ "${BLOCKNAME}" = "unknown" ]; then
|
||||
echo "ERROR: Failed to parse block device name for '${root}'"
|
||||
elif [ -z "${BLOCKDEVICE}" ]; then
|
||||
echo "ERROR: Failed to parse block device ids for '${root}'"
|
||||
else
|
||||
export root="${BLOCKNAME}"
|
||||
echo "/bin/mknod \"${BLOCKNAME}\" b ${BLOCKDEVICE}"
|
||||
/bin/mknod "${BLOCKNAME}" b ${BLOCKDEVICE} >/dev/null
|
||||
fi
|
||||
if [ ! -b "${root}" ]; then
|
||||
err "Unable to create/detect root device '${root}'"
|
||||
echo "Dropping to a recovery shell... type 'exit' to reboot"
|
||||
echo "NOTE: klibc contains no 'ls' binary, use 'echo *' instead"
|
||||
echo ""
|
||||
echo "If the device '${root}' gets created while you are here,"
|
||||
echo "try adding 'rootdelay=8' or higher to the kernel command-line"
|
||||
PS1="ramfs$ " /bin/sh -i
|
||||
msg "Rebooting..."
|
||||
/bin/reboot
|
||||
fi
|
||||
# If rootdelay is empty or not a non-negative integer, set it to 10
|
||||
if [ -z "${rootdelay}" -o ! "${rootdelay}" -ge 0 ]; then
|
||||
export rootdelay=10
|
||||
# We'll wait for the root device, so make sure klibc doesn't
|
||||
export kinit_params="$kinit_params rootdelay=0"
|
||||
fi
|
||||
|
||||
msg ":: Initramfs Completed - control passing to kinit"
|
||||
# If we boot from NFS, don't check for a block device in /dev
|
||||
# Let kinit do it all
|
||||
if [ -z "${nfsroot}" -a "${root}" != "/dev/nfs" ]; then
|
||||
if ! poll_device "${root}" ${rootdelay}; then
|
||||
msg "\nRoot device '${root}' doesn't exist, attempting to create it"
|
||||
|
||||
eval $(/bin/parseblock "${root}")
|
||||
elif [ -z "${BLOCKDEVICE}" ]; then
|
||||
echo "ERROR: Failed to parse block device ids for '${root}'"
|
||||
else
|
||||
echo "/bin/mknod /dev/root b ${BLOCKDEVICE}"
|
||||
/bin/mknod /dev/root b ${BLOCKDEVICE} >/dev/null
|
||||
export root="/dev/root"
|
||||
fi
|
||||
if [ ! -b "${root}" ]; then
|
||||
err "Unable to detect or create root device '${root}'"
|
||||
echo "You are being dropped to a recovery shell"
|
||||
echo " Type 'reboot' to reboot"
|
||||
echo " Type 'exit' to try and continue booting"
|
||||
echo "NOTE: klibc contains no 'ls' binary, use 'echo *' instead"
|
||||
echo ""
|
||||
echo "If the device '${root}' gets created while you are here,"
|
||||
echo "try adding 'rootdelay=10' or higher to the kernel command-line"
|
||||
PS1="ramfs$ " /bin/sh -i
|
||||
msg "Trying to continue (this will most likely fail)..."
|
||||
fi
|
||||
if [ -f "/message" ]; then
|
||||
msg "$(cat /message)"
|
||||
fi
|
||||
msg ":: Initramfs Completed - control passing to kinit"
|
||||
#Special handling is udev is running
|
||||
udevpid=$(/bin/minips -C udevd -o pid=)
|
||||
if [ -n "${udevpid}" ]; then
|
||||
|
|
Loading…
Reference in a new issue