# Default PATH differs between shells, and is not automatically exported # by klibc dash. Make it consistent. export PATH=/sbin:/usr/sbin:/bin:/usr/bin
# Note that this only becomes /dev on the real filesystem if udev's scripts # are used; which they will be, but it's worth pointing out mount -t devtmpfs -o nosuid,mode=0755 udev /dev mkdir /dev/pts mount -t devpts -o noexec,nosuid,gid=5,mode=0620 devpts /dev/pts || true mount -t tmpfs -o "noexec,nosuid,size=10%,mode=0755" tmpfs /run mkdir -m 0755 /run/initramfs
# Export the dpkg architecture export DPKG_ARCH= . /conf/arch.conf
# mdadm needs hostname to be set. This has to be done before the udev rules are called! if [ -f "/etc/hostname" ]; then /bin/hostname -F /etc/hostname >/dev/null 2>&1 fi
# Bring in the main config . /conf/initramfs.conf for conf in conf/conf.d/*; do [ -f ${conf} ] && . ${conf} done . /scripts/functions
maybe_break mount log_begin_msg "Mounting root file system" # Always load local and nfs (since these might be needed for /etc or # /usr, irrespective of the boot script used to mount the rootfs). . /scripts/local . /scripts/nfs . /scripts/${BOOT} parse_numeric ${ROOT} maybe_break mountroot mount_top mount_premount mountroot log_end_msg
if read_fstab_entry /usr; then log_begin_msg "Mounting /usr file system" mountfs /usr log_end_msg fi
# Mount cleanup mount_bottom nfs_bottom local_bottom
# Check init is really there if ! validate_init "$init"; then echo"Target filesystem doesn't have requested ${init}." init= for inittest in /sbin/init /etc/init /bin/init /bin/sh; do if validate_init "${inittest}"; then init="$inittest" break fi done fi
# No init on rootmount if ! validate_init "${init}" ; then panic "No init found. Try passing init= bootarg." fi
# Move virtual filesystems over to the real filesystem mount -n -o move /sys ${rootmnt}/sys mount -n -o move /proc ${rootmnt}/proc
# Chain to real filesystem exec run-init ${drop_caps}${rootmnt}${init}"$@"${recovery:+--startup-event=recovery} <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1 echo"Something went badly wrong in the initramfs." panic "Please file a bug on initramfs-tools."