#!/bin/sh
[-d/dev] | | Mkdir-m 0755/dev
[-d/root] | | Mkdir-m 0700/root
[-d/sys] | | Mkdir/sys
[-d/proc] | | Mkdir/proc
[-d/tmp] | | Mkdir/tmp
Mkdir-p/var/lock
Mount-t sysfs-o nodev,noexec,nosuid None/sys
Mount-t Proc-o Nodev,noexec,nosuid None/proc
grep-q ' \<quiet\> '/proc/cmdline | | echo "Loading, please wait ..."
# Note that this is only becomes/dev on the real filesystem if Udev ' s scripts
# is used; which they would be, but it's W Orth pointing out
if! mount-t devtmpfs-o mode=0755 None/dev; then
mount-t tmpfs-o mode=0755 none/dev
mknod-m 0600/dev/console C 5 1
mknod/dev/null C 1 3
Fi
mkdir/dev/pts
mount-t devpts-o Noexe c,nosuid,gid=5,mode=0620 None/dev/pts | | True
>/dev/.initramfs-tools
Mkdir/dev/.initramfs
# Export The dpkg architecture
Export dpkg_arch=
. /conf/arch.conf
# Set Modprobe Env
Export modprobe_options= "-QB"
# Export relevant variables
Export root=
Export rootdelay=
Export rootflags=
Export rootfstype=
Export ipopts=
Export hwaddr=
Export break=
Export init=/sbin/init
Export quiet=n
Export readonly=y
Export rootmnt=/root
Export debug=
Export panic=
Export blacklist=
Export resume_offset=
# bring in the main config
./conf/initramfs.conf
for Conf in conf/conf.d/*, do
[-f ${conf}] && . ${conf}
Done
./scripts/functions
# Parse Command line Options
For x in $ (cat/proc/cmdline); Do
Case $x in
init=*)
init=${x#init=}
;;
root=*)
root=${x#root=}
Case $ROOT in
label=*)
root= "${root#label=}"
# support/in label= paths (Escape to \x2f)
Case ' ${root} ' in
*[/]*)
If [-X "$ (command-v sed)"]; Then
Root= "$ (echo ${root} | sed ' s,/,\\x2f,g ')"
Else
if ["${root}"! = "${root#/}"]; Then
root= "\x2f${root#/}"
Fi
if ["${root}"! = "${root%/}"]; Then
root= "${root%/}\x2f"
Fi
ifs= '/'
newroot=
for s in $ROOT; Do
If [-Z "${newroot}"]; Then
newroot= "${s}"
Else
newroot= "${newroot}\\x2f${s}"
Fi
Done
Unset IFS
root= "${newroot}"
Fi
Esac
root= "/dev/disk/by-label/${root}"
;;
uuid=*)
root= "/dev/disk/by-uuid/${root#uuid=}"
;;
/DEV/NFS)
[-Z "${boot}"] && Boot=nfs
;;
Esac
;;
rootflags=*)
rootflags= "-O ${x#rootflags=}"
;;
rootfstype=*)
Rootfstype= "${x#rootfstype=}"
;;
rootdelay=*)
Rootdelay= "${x#rootdelay=}"
Case ${rootdelay} in
*[! [:d Igit:].] *)
rootdelay=
;;
Esac
;;
resumedelay=*)
Resumedelay= "${x#resumedelay=}"
;;
loop=*)
loop= "${x#loop=}"
;;
loopflags=*)
loopflags= "-O ${x#loopflags=}"
;;
loopfstype=*)
Loopfstype= "${x#loopfstype=}"
;;
cryptopts=*)
cryptopts= "${x#cryptopts=}"
;;
nfsroot=*)
nfsroot= "${x#nfsroot=}"
;;
netboot=*)
netboot= "${x#netboot=}"
;;
ip=*)
ipopts= "${x#ip=}"
;;
hwaddr=*)
Hwaddr= "${x#hwaddr=}"
;;
boot=*)
boot=${x#boot=}
;;
resume=*)
Resume= "${x#resume=}"
;;
resume_offset=*)
resume_offset= "${x#resume_offset=}"
;;
Noresume)
Noresume=y
;;
panic=*)
Panic= "${x#panic=}"
Case ${panic} in
*[! [:d Igit:].] *)
Panic=
;;
Esac
;;
Quiet
Quiet=y
;;
Ro
Readonly=y
;;
Both
Readonly=n
;;
Debug
Debug=y
Quiet=n
EXEC >/dev/.initramfs/initramfs.debug 2>&1
Set-x
;;
debug=*)
Debug=y
Quiet=n
Set-x
;;
break=*)
break=${x#break=}
;;
Break
Break=premount
;;
blacklist=*)
blacklist=${x#blacklist=}
;;
netconsole=*)
netconsole=${x#netconsole=}
;;
Esac
Done
If [-Z "${noresume}"]; Then
Export Resume=${resume}
Else
Export Noresume
Fi
[-N "${netconsole}"] && modprobe netconsole Netconsole=${netconsole}
Maybe_break Top
# Export BOOT variable value for Compcache,
# so we know if we run from Casper
Export BOOT
# Don ' t do log messages here to avoid confusing USplash
Run_scripts/scripts/init-top
Maybe_break Modules
Log_begin_msg "Loading Essential Drivers ..."
Load_modules
Log_end_msg
Maybe_break Premount
["$quiet"! = "Y"] && log_begin_msg "Running/scripts/init-premount"
Run_scripts/scripts/init-premount
["$quiet"! = "Y"] && log_end_msg
Maybe_break Mount
Log_begin_msg "Mounting root file System ..."
. /scripts/${boot}
Parse_numeric ${root}
Mountroot
Log_end_msg
Maybe_break Bottom
["$quiet"! = "Y"] && log_begin_msg "Running/scripts/init-bottom"
Run_scripts/scripts/init-bottom
["$quiet"! = "Y"] && log_end_msg
# Move Virtual filesystems over to the real filesystem
Mount-n-O Move/sys ${rootmnt}/sys
Mount-n-O move/proc ${rootmnt}/proc
# Check init bootarg
If [-N ' ${init} '] && [!-X ' ${rootmnt}${init} ']; then
echo "Target filesyste M doesn ' t has ${init}. "
init=
Fi
# Search for valid init
If [-Z "${init}"]; Then
For Init in/sbin/init/etc/init/bin/init/bin/sh; Do
if [!-X "${rootmnt}${init}"]; Then
Continue
Fi
Break
Done
Fi
# No Init on Rootmount
if [!-X "${rootmnt}${init}"]; Then
Panic "No Init found. Try passing init= bootarg. "
Fi
# CONFUSES/ETC/INIT.D/RC
If [-N ${debug}]; Then
unset Debug
Fi
# Chain to Real filesystem
Maybe_break Init
EXEC run-init ${rootmnt} ${init} "[email protected]" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
Panic "Could not execute run-init."
I didn't find LINUXRC, but I found init.