Skip to content

Commit

Permalink
Updated build for latest bootscripts from MLFS-s6-bootscripts repo.
Browse files Browse the repository at this point in the history
  • Loading branch information
dslm4515 committed Apr 22, 2021
1 parent 435609c commit 5d0bdae
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions 3-chroot/096-Bootscripts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Final System: S6 Bootscripts
# Source: https://github.com/dslm4515/MLFS-S6-Bootscripts
# This section is done in Chroot environment

# Copy s6 directory to /etc
cp -ar s6 /etc/

# Copy config for setting up virtual terminals (VT's)
cp -av vconsole.conf /etc/

# Copy useful utilities
install -v -m755 modules-load /usr/bin/
install -v -m755 tmpfiles /bin/

# Compile a basic database for boot
s6-rc-compile /etc/s6/db/basic /etc/s6/sv
ln -sv /etc/s6/db/basic /etc/s6/db/current

# Copy necessary scripts to boot, reboot, and poweroff system
install -v -m755 s6/base/bin/* /sbin/
mv /etc/s6/base/scripts /etc/s6/scripts

# Re-initialize s6 init base.
# ** Must be done anytime s6 init base is unpacked or copied. **
rm -rf /etc/s6/base
s6-linux-init-maker -1 -f /etc/s6/skel -p "/bin:/sbin:/usr/bin" \
-D default -G "/sbin/agetty -L -8 tty1 115200" \
-c /etc/s6/base -t 2 -L -u root -U utmp /etc/s6/base
rm -rf /etc/s6/base/scripts
cp -r /etc/s6/scripts /etc/s6/base/scripts

# Copy scripts to bring NIC's up and down
install -v -m755 if* /sbin/
mkdir -pv /lib/services
install -v -m755 net-services/* /lib/services/

#For logging services, create the log user as root:
groupadd -g 983 s6log &&
useradd -c "S6-Log User" -d / \
-u 983 -g s6log -s /usr/bin/false s6log

# Bootscripts require system boot with a initramfs image. It's unlcear
# why boot scripts work without an initramfs loaded at boot. You may
# use thses scripts from BLFS to build one. Script requires cpio installed.

# Copy the script to /sbin:
install -v -m755 mkinitrd/mkinitramfs /sbin/

# Copy the configuration:
mkdir -p /usr/share/mkinitramfs
install -v -m644 mkinitrd/init.in /usr/share/mkinitramfs/

# To use, use the running kernel version:
mkinitramfs $(uname -r)

0 comments on commit 5d0bdae

Please sign in to comment.