mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
remove custom init file
This commit is contained in:
parent
f5439ce340
commit
4235c2ddb0
1 changed files with 0 additions and 96 deletions
|
@ -1,96 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
udevd_running=0
|
||||
mount_handler=default_mount_handler
|
||||
init=/sbin/init
|
||||
rd_logmask=0
|
||||
|
||||
if [ -x /usr/bin/systemd-timestamp ]; then
|
||||
RD_TIMESTAMP=$(systemd-timestamp)
|
||||
fi
|
||||
. /init_functions
|
||||
|
||||
# add sh symlink
|
||||
ln -s /bin/bash /bin/sh
|
||||
|
||||
mount -t proc proc /proc -o nosuid,noexec,nodev
|
||||
mount -t sysfs sys /sys -o nosuid,noexec,nodev
|
||||
|
||||
mount -t devtmpfs dev /dev -o mode=0755,nosuid
|
||||
mount -t tmpfs run /run -o nosuid,nodev,mode=0755
|
||||
mkdir -m755 /run/initramfs
|
||||
### HACK:
|
||||
# remove it when lvm and dmraid use correct /run directory!
|
||||
mkdir -m1777 /run/lock
|
||||
|
||||
# parse the kernel command line
|
||||
parse_cmdline </proc/cmdline
|
||||
|
||||
# setup logging as early as possible
|
||||
rdlogger_start
|
||||
|
||||
for d in ${disablehooks//,/ }; do
|
||||
[ -e "/hooks/$d" ] && chmod 644 "/hooks/$d"
|
||||
done
|
||||
|
||||
. /config
|
||||
|
||||
run_hookfunctions 'run_earlyhook' 'early hook' $EARLYHOOKS
|
||||
|
||||
if [ -n "$earlymodules$MODULES" ]; then
|
||||
modprobe -qab ${earlymodules//,/ } $MODULES
|
||||
fi
|
||||
|
||||
run_hookfunctions 'run_hook' 'hook' $HOOKS
|
||||
|
||||
# honor the old behavior of break=y as a synonym for break=premount
|
||||
if [ "${break}" = "y" ] || [ "${break}" = "premount" ]; then
|
||||
echo ":: Pre-mount break requested, type 'exit' to resume operation"
|
||||
launch_interactive_shell
|
||||
fi
|
||||
|
||||
rootdev=$(resolve_device "$root") && root=$rootdev
|
||||
unset rootdev
|
||||
|
||||
fsck_root
|
||||
|
||||
run_hookfunctions 'run_latehook' 'late hook' $LATEHOOKS
|
||||
run_hookfunctions 'run_cleanuphook' 'cleanup hook' $CLEANUPHOOKS
|
||||
|
||||
if [ "${root}" = "" -a "${ip}" = "" ]; then
|
||||
# enter install environment
|
||||
exec $init
|
||||
else
|
||||
# Mount root at /new_root
|
||||
"$mount_handler" /new_root
|
||||
if [ "$(stat -c %D /)" = "$(stat -c %D /new_root)" ]; then
|
||||
# Nothing got mounted on /new_root. This is the end, we don't know what to do anymore
|
||||
# We fall back into a shell, but the shell has now PID 1
|
||||
# This way, manual recovery is still possible.
|
||||
err "Failed to mount the real root device."
|
||||
echo "Bailing out, you are on your own. Good luck."
|
||||
echo
|
||||
launch_interactive_shell --exec
|
||||
elif [ ! -x "/new_root${init}" ]; then
|
||||
# Successfully mounted /new_root, but ${init} is missing
|
||||
# The same logic as above applies
|
||||
err "Root device mounted successfully, but ${init} does not exist."
|
||||
echo "Bailing out, you are on your own. Good luck."
|
||||
echo
|
||||
launch_interactive_shell --exec
|
||||
fi
|
||||
|
||||
if [ "${break}" = "postmount" ]; then
|
||||
echo ":: Post-mount break requested, type 'exit' to resume operation"
|
||||
launch_interactive_shell
|
||||
fi
|
||||
|
||||
# this should always be the last thing we do before the switch_root.
|
||||
rdlogger_stop
|
||||
|
||||
exec env -i \
|
||||
"TERM=$TERM" \
|
||||
"RD_TIMESTAMP=$RD_TIMESTAMP" \
|
||||
/usr/bin/switch_root /new_root $init "$@"
|
||||
|
||||
fi
|
Loading…
Reference in a new issue