initd version
This commit is contained in:
10
rootfs-overlay/etc/fstab
Normal file
10
rootfs-overlay/etc/fstab
Normal file
@@ -0,0 +1,10 @@
|
||||
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||
proc /proc proc defaults,nosuid,nodev,noexec 0 0
|
||||
devpts /dev/pts devpts defaults,nosuid,noexec,gid=5,mode=620,ptmxmode=000 0 0
|
||||
tmpfs /dev/shm tmpfs nosuid,nodev,mode=0777 0 0
|
||||
tmpfs /tmp tmpfs nosuid,nodev,mode=1777 0 0
|
||||
tmpfs /run tmpfs nosuid,nodev,mode=0755 0 0
|
||||
tmpfs /mnt tmpfs nosuid,nodev,mode=0755 0 0
|
||||
tmpfs /var/log tmpfs nosuid,nodev,mode=0775 0 0
|
||||
sysfs /sys sysfs defaults,nosuid,nodev,noexec 0 0
|
||||
cgroup2 /sys/fs/cgroup cgroup2 defaults,nosuid,nodev,noexec 0 0
|
||||
62
rootfs-overlay/etc/inittab
Normal file
62
rootfs-overlay/etc/inittab
Normal file
@@ -0,0 +1,62 @@
|
||||
# /etc/inittab
|
||||
#
|
||||
# Copyright
|
||||
#
|
||||
# Note: BusyBox init doesn't support runlevels. The runlevels field is
|
||||
# completely ignored by BusyBox init. If you want runlevels, use
|
||||
# sysvinit.
|
||||
|
||||
# Format for each entry: <id>:<runlevels>:<action>:<process>
|
||||
#
|
||||
# id == tty to run on, or empty for /dev/console
|
||||
# runlevels == ignored
|
||||
# action == one of sysinit, respawn, askfirst, wait, and once
|
||||
# process == program to run
|
||||
|
||||
|
||||
# Startup the system.
|
||||
|
||||
::sysinit:/bin/mount /proc # Lightwhale requires the pseudo file systems for setup-persistence...
|
||||
::sysinit:/bin/mount /sys # ...and since the rootfs is already mounted in RAM at this point...
|
||||
::sysinit:/bin/mount /run # ...we have /etc/fstab present which is used for mount options...
|
||||
::sysinit:/bin/mount /tmp # ...so we are mounting them as intended.
|
||||
::sysinit:/bin/mount /mnt #
|
||||
::sysinit:/bin/mount /var/log
|
||||
::sysinit:/bin/mount -t cgroup2 none /sys/fs/cgroup
|
||||
|
||||
::sysinit:/bin/mkdir -p /dev/pts /dev/shm /run/lock /run/db # Subdirs in pseudo file system required by init scripts.
|
||||
|
||||
#::sysinit:/lib/lightwhale/rescue-shell
|
||||
#::sysinit:/lib/lightwhale/setup-persistence
|
||||
|
||||
# create a read-only mapping of the rootfs
|
||||
::sysinit:mkdir -p /mnt/root.squashfs
|
||||
::sysinit:mount --bind / /mnt/root.squashfs
|
||||
::sysinit:mount --make-rprivate /mnt/root.squashfs/
|
||||
|
||||
# create overlay
|
||||
::sysinit:/usr/sbin/zpool import nimux-zfs
|
||||
::sysinit:/bin/mount -t overlay overlay-etc -o lowerdir=/mnt/root.squashfs/etc/,upperdir=/mnt/overlays/root/etc/upper,workdir=/mnt/overlays/root/etc/work /etc
|
||||
::sysinit:/bin/mount -t overlay overlay-home -o lowerdir=/mnt/root.squashfs/home/,upperdir=/mnt/overlays/root/home/upper,workdir=/mnt/overlays/root/home/work /home
|
||||
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
|
||||
null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
|
||||
|
||||
::sysinit:/bin/mount -a
|
||||
#::sysinit:/sbin/swapon -a
|
||||
::sysinit:/bin/hostname -F /etc/hostname # Because a custom hostname may have been mounted at this point.
|
||||
|
||||
# Now run all the lovely rc scripts.
|
||||
::sysinit:/etc/init.d/rcS
|
||||
|
||||
# Put a getty on the serial port.
|
||||
tty1::respawn:/sbin/getty -L tty1 0 vt100 # First console
|
||||
tty2::respawn:/sbin/getty -L tty2 0 vt100 # Extra console, for good measure.
|
||||
console::respawn:/sbin/getty -L console 0 vt100 # Serial console, for headless QEMU.
|
||||
|
||||
# Stuff to do before rebooting.
|
||||
::shutdown:/etc/init.d/rcK
|
||||
#::shutdown:/sbin/swapoff -a
|
||||
::shutdown:/bin/umount -a -r
|
||||
1
rootfs-overlay/etc/modules-load.d/zfs.conf
Normal file
1
rootfs-overlay/etc/modules-load.d/zfs.conf
Normal file
@@ -0,0 +1 @@
|
||||
zfs
|
||||
2
rootfs-overlay/etc/profile.d/editor.sh
Normal file
2
rootfs-overlay/etc/profile.d/editor.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
# change the default editor to nano
|
||||
export EDITOR='/bin/nano'
|
||||
8
rootfs-overlay/etc/profile.d/prompt.sh
Normal file
8
rootfs-overlay/etc/profile.d/prompt.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
# overrule the default prompt to make it more usefull
|
||||
if [ "$PS1" ]; then
|
||||
if [ "`id -u`" -eq 0 ]; then
|
||||
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]# "
|
||||
else
|
||||
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user