Files
linux-kernel-module-cheat/rootfs_overlay/lkmc/init_lkmc.sh
Ciro Santilli 六四事件 法轮功 146e568db8 move all our stuff into /lkmc in guest
Motivation: userland is getting several new subdirectories, it would be
too insane to just dump all of that in the guest root filesystem.

To alleviate the cd pain, .profile puts user inside /lkmc by default.
2019-05-05 00:00:00 +00:00

31 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# This is an attempt to replace /etc/inittab with a single shell file,
# in order to to make everything explicit and sane.
#
# The rationale is that it will make it easier to port our setup to any image
# if our minimal init is contained in a single portable file.
#
# Of course, packages that rely on extra init may start failing at any
# point with this minimized setup, but this is a risk worth taking, especially
# because gem5 is slow and basically mandates a minimal init.
#
# Here we try to some basic common init tasks that will cover what the large
# majority of software will need.
#
# We don't care about shutdown commands since we focus on stateless disks.
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
mount -t proc proc /proc
mkdir -p /dev/pts
mkdir -p /dev/shm
# TODO do mounts direclty here. fstab only adds the fschk as extra functionality,
# but we don't care since our disks are stateless.
mount -a
login=/tmp/login
printf '#!/bin/sh
exec /bin/login root
' > "$login"
chmod +x "$login"
exec /sbin/getty -n -L -l "$login" console 0 vt100