-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated build for latest bootscripts from MLFS-s6-bootscripts repo.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |