diff options
author | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
commit | df88860947686a5e6507fc5d60ff33eac1158c6b (patch) | |
tree | d1dc7f2f003b08afb6d45f7170d7a0dd353060d3 | |
parent | 33d239ecb3d66db2b005afbe68a7029c3f2d2ee0 (diff) |
304 files changed, 3086 insertions, 2182 deletions
@@ -1,24 +1,132 @@ +ETCDIR=${DESTDIR}/etc +LIBDIR=${DESTDIR}/lib +SERVICEDIR=${LIBDIR}/services +MAN8=${DESTDIR}/usr/share/man/man8 +SBIN=${DESTDIR}/sbin +MODE=754 +DIRMODE=755 +CONFMODE=644 -PREFIX=/usr -DESTDIR= - -bootscripts: - mkdir -p $(DESTDIR)/etc/s6/db - mkdir -p $(DESTDIR)/usr/bin - mkdir -p $(DESTDIR)/sbin - mkdir -p $(DESTDIR)/lib/services - cp -ar xi/s6/sv $(DESTDIR)/etc/s6/ - cp -ar xi/s6/skel $(DESTDIR)/etc/s6/ - cp -a xi/vconsole.conf $(DESTDIR)/etc/ - install -m755 xi/bin/modules-load $(DESTDIR)/usr/bin/ - install -m755 xi/bin/tmpfiles $(DESTDIR)/usr/bin/ - install -m755 xi/s6/base/bin/* $(DESTDIR)/sbin/ - install -m755 xi/bin/ifup $(DESTDIR)/sbin/ - install -m755 xi/bin/ifdown $(DESTDIR)/sbin/ - cp -ar xi/s6/scripts $(DESTDIR)/etc/s6/ - install -m755 xi/services/dhcpcd $(DESTDIR)/lib/services - install -m755 xi/services/ipv4-static $(DESTDIR)/lib/services - install -m755 xi/services/wpa $(DESTDIR)/lib/services +all: links + +install: all + +create-dirs: + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc0.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc1.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc2.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc3.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc4.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc5.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rc6.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/rcS.d + install -d -m ${DIRMODE} ${ETCDIR}/rc.d/init.d + install -d -m ${DIRMODE} ${ETCDIR}/sysconfig + install -d -m ${DIRMODE} ${LIBDIR} + install -d -m ${DIRMODE} ${SERVICEDIR} + install -d -m ${DIRMODE} ${MAN8} + install -d -m ${DIRMODE} ${SBIN} + ln -sfn services ${LIBDIR}/lsb + ln -sfn rc.d/init.d ${ETCDIR}/init.d + +files: create-dirs + install -m ${MODE} xi/init.d/checkfs ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/cleanfs ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/halt ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/console ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/localnet ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/modules ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/mountfs ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/mountvirtfs ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/network ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/rc ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/reboot ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/sendsignals ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/setclock ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/swap ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/sysctl ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/sysklogd ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/template ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/udev ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/init.d/udev_retry ${ETCDIR}/rc.d/init.d/ + install -m ${MODE} xi/sbin/ifup ${SBIN} + install -m ${MODE} xi/sbin/ifdown ${SBIN} + install -m ${CONFMODE} xi/sbin/ifup.8 ${MAN8} + ln -sf ifup.8 ${MAN8}/ifdown.8 + install -m ${MODE} xi/lib/services/ipv4-static-route ${SERVICEDIR} + install -m ${MODE} xi/lib/services/ipv4-static ${SERVICEDIR} + install -m ${CONFMODE} xi/lib/services/init-functions ${SERVICEDIR} + + if [ ! -f ${ETCDIR}/sysconfig/createfiles ]; then \ + install -m ${CONFMODE} xi/sysconfig/createfiles ${ETCDIR}/sysconfig/ ;\ + fi + if [ ! -f ${ETCDIR}/sysconfig/modules ]; then \ + install -m ${CONFMODE} xi/sysconfig/modules ${ETCDIR}/sysconfig/ ;\ + fi + if [ ! -f ${ETCDIR}/sysconfig/udev_retry ]; then \ + install -m ${CONFMODE} xi/sysconfig/udev_retry ${ETCDIR}/sysconfig/ ;\ + fi + if [ ! -f ${ETCDIR}/sysconfig/rc.site ]; then \ + install -m ${CONFMODE} xi/sysconfig/rc.site ${ETCDIR}/sysconfig/ ;\ + fi + +links: rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 + +rcS: files + ln -sf ../init.d/mountvirtfs ${ETCDIR}/rc.d/rcS.d/S00mountvirtfs + ln -sf ../init.d/modules ${ETCDIR}/rc.d/rcS.d/S05modules + ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rcS.d/S08localnet + ln -sf ../init.d/udev ${ETCDIR}/rc.d/rcS.d/S10udev + ln -sf ../init.d/swap ${ETCDIR}/rc.d/rcS.d/S20swap + ln -sf ../init.d/checkfs ${ETCDIR}/rc.d/rcS.d/S30checkfs + ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rcS.d/S40mountfs + ln -sf ../init.d/cleanfs ${ETCDIR}/rc.d/rcS.d/S45cleanfs + ln -sf ../init.d/udev_retry ${ETCDIR}/rc.d/rcS.d/S50udev_retry + ln -sf ../init.d/console ${ETCDIR}/rc.d/rcS.d/S70console + ln -sf ../init.d/sysctl ${ETCDIR}/rc.d/rcS.d/S90sysctl + +rc0: files + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd + ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/K92sendsignals + ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/K94swap + ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/K96mountfs + ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/K98localnet + ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt + +rc1: files + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc1.d/K80network + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd + +rc2: files + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/S10network + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/S20sysklogd + +rc3: files + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc3.d/S20network + +rc4: files + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc4.d/S10sysklogd + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc4.d/S20network + +rc5: files + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc5.d/S10sysklogd + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc5.d/S20network + +rc6: files + ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network + ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd + ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/K92sendsignals + ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/K94swap + ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/K96mountfs + ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/K98localnet + ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot + +uninstall: + rm -rf ${DESTDIR}/lib/services ${DESTDIR}/lib/lsb ${ETCDIR}/rc.d ${ETCDIR}/init.d \ + ${SBIN}/ifup ${SBIN}/ifdown ${MAN8}/ifup.8 ${MAN8}/ifdown.8 \ + ${ETCDIR}/sysconfig/rc utmps: mkdir -p $(DESTDIR)/var/log/utmps @@ -30,3 +138,5 @@ install-mkinitramfs: mkinitrd/mkinitramfs.sh mkinitrd/init.in install -m755 mkinitrd/mkinitramfs.sh ${DESTDIR}${PREFIX}/bin/mkinitramfs install -m644 mkinitrd/init.in ${DESTDIR}${PREFIX}/share/mkinitramfs/ +.PHONY: all create-dirs install files links rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6 uninstall install-mkinitramfs + @@ -1,167 +1,2 @@ -# Musl-LFS-S6-Bootscripts -Bootscripts for Musl-LFS (MLFS) using S6 & S6-rc - -This is based on the works of [MLFS-S6-Bootscripts by dslm4515](https://github.com/dslm4515/MLFS-S6-Bootscripts) - -The aim of this project is to create the scripts and files to boot a MLFS/LFS system with S6 and S6-rc. This will replace the LFS bootscripts that LFS uses (to boot a LFS system with SysVinit). - -## Requirements - -The following can be found at Skarnet (https://skarnet.org/). - * skalibs 2.11.1.x (required by execline) - * execline 2.8.2.x (required by s6-rc) - * s6 2.1.0.x (required by s6-rc) - * s6-linux-utils - * s6-portable-utils (statically built) - * s6-rc 0.5.3.x (New service format) - * s6-linux-init (1.x.x.x) - * utmps - -## Directions - -Copy boot directories and scripts. Do not just copy entire git directory, as it will copy unneeded dot files: -``` -# Enter chroot for target system first, otherwise adjust paths accordingly -cp -ar s6 /etc/ -cp -av vconsole.conf /etc/ -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 -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 -``` -Make sure the directory for dmesg logging is owned by the log user -``` -mkdir -pv /var/log/dmesg -chown -v s6log:s6log /var/log/ -``` - -For utmps, create a utmp user: -``` -useradd -c "utmps user" -d /run/utmps \ - -u 984 -g utmp -s /bin/false utmp -``` - -Make sure the directory for wtmp is owned by utmp user: -``` -mkdir -pv /var/log/utmps -mv -v /var/log/wtmp /var/log/utmps/ -chown -vR utmp:utmp /var/log/utmps -ln -sv utmps/wtmp /var/log/wtmp -``` - -Bootscripts no longer require system boot with a initramfs image. But kernel parameters should boot with root filesystem as read-only for checking root filesystem at boot (i.e. linux root=/dev/sda2 ro) You may use scripts from BLFS or Musl-LFS 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 kernel version: -mkinitramfs $(uname -r) - -``` - -## Layout - -Directories in s6: - * base - Base directory for s6-linux-init - * base/run-image - Directory copied to /run at beginning of boot - * base/scripts - Scripts to shutdown and start system via s6-linux-init - * base/env - Enviromental varibles to set at boot - * db - Compiled databases for boot - * db/current - Compiled database to use for boot - * skel - Default startup/shutdown scripts - * sv - Source definitions for databases and services - * scripts - Small scripts used by services compiled from sv - * doc/mock-boot-tree - Use command tree to see how the layout of sv - -## Scripts: - * rc.local - Additional shell commands to execute on bootup - * s6.conf - Global configuration of s6-rc services - -## mkinitrd: - * mkinitramfs - Script to make a basic initramfs - * init.in - Configuration for script. - -## Setting up Networking at Boot: -``` -# install net-services: -mkdir -v /lib/services -install -v -m644 net-services/* /lib/services/ -# install helper scripts to bring up and down interfaces: -install -v -m755 if* /sbin/ -``` -Each interface should have configuration files in /etc/sysconfig. For example: -``` -/etc/sysconfig/ifconfig.wlan0 # config for a wifi card -/etc/sysconfig/wpa_supplicant-wlan0.conf # config for wpa_supplicant for same wifi card -``` - -Examples are in net-configs - -## Usage - -To disable/enable services, modify the contents of `/etc/s6/sv/services/contents.d`. Then compile a new database to use for the next boot. - -For example, to enable dbus service: -``` -# Install dbus service scripts (dbus-srv, dbus-log) to /etc/s6/sv/ - -# Add dbus script to list of services to start at boot: -touch /etc/s6/sv/services/contents.d/dbus-srv - -# Compile a new database for boot -s6-rc-compile /etc/s6/db/${new_db} /etc/s6/sv - -# Link new database to boot -mv -v /etc/s6/db/current /etc/s6/db/previous -ln -sv /etc/s6/db/${new_db} /etc/s6/db/current -``` - -Services an be enabled or disabled after boot: -``` -# Enable a service that was not enabled at boot -sudo s6-rc -u change ${service_name} - -# Disable a service -sudo s6-rc -d change ${service_name} - -# To see the list of services to enable/disable: -ls /run/service/* - -``` - -## Changelog since 4.x.x - -<ul> -<li>Updated service format: Bundles now use contents.d & dependencies.d directories instead of contents & dependencies files</li> -<li>Improved service dependacies: Previous format had issues some services starting before required service(s) executed</li> -<li>/tmp directory now cleaned during boot and during shutdown </li> -<li>System clock now set from hardware clock </li> -<li>Most commands in service scripts use commands from s6-linux-utils or s6-portable-utils </li> -<li>Cleaned up boot messages that are logged in /run/uncaught-logs/current </li> - -</ul> +# xilinux bootscripts +bootscripts for sysvinit with openrc for xilinux diff --git a/docs/artix-boot-tree b/docs/artix-boot-tree deleted file mode 100644 index f5f6b13..0000000 --- a/docs/artix-boot-tree +++ /dev/null @@ -1,37 +0,0 @@ -default -└── boot - ├── misc - │  ├── hostname - │  ├── hwclock - │  ├── kmod-static-nodes - │  ├── modules - │  ├── rc-local - │  └── tmpfiles-dev - ├── mount - │  ├── mount-cgroups - │  ├── mount-devfs - │  ├── mount-filesystems - │  ├── mount-net - │  ├── mount-procfs - │  ├── mount-sysfs - │  └── remount-root - ├── setup - │  ├── binfmt - │  ├── cleanup - │  ├── console-setup - │  ├── dmesg - │  ├── getty - │  ├── net-lo - │  ├── random-seed - │  ├── swap - │  ├── sysctl - │  ├── sysusers * uncomment contents if esysusers is installed * - │  └── tmpfiles-setup - └── udev - ├── udevadm - │  ├── udevadm-log - │  └── udevadm-srv - └── udevd - ├── udevd-log - └── udevd-srv - diff --git a/docs/create-s6-base b/docs/create-s6-base deleted file mode 100644 index d786a75..0000000 --- a/docs/create-s6-base +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/bash - -## Create the base - -s6-linux-init-maker \ - -c /etc/s6/base \ - -u root \ - -G "/sbin/agetty -L -8 tty1 115200" \ - -L \ - -p "/bin:/sbin:/usr/bin" \ - -m 022 \ - -t 2 \ - -D default \ - -U utmp \ - /BUILD/etc/s6/base - -## Modify scripts in base - -# For rc.init: -### If your services are managed by s6-rc: -### (replace /run/service with your scandir) -#s6-rc-init -c /etc/s6/db/current /run/service - -# Check other scripts and only uncomment for s6 & s6-rc diff --git a/docs/log-display_template b/docs/log-display_template deleted file mode 100644 index 5a2855a..0000000 --- a/docs/log-display_template +++ /dev/null @@ -1,28 +0,0 @@ -|--((( S6+S6-rc Bootscripts v 5.0.0 )))---| -[ Virtual-FS ] 1/6 : Mounting /proc -[ Virtual-FS ] 0/6 : Creating mount points -[ Read-Only Mode ] 3/9 : Setting hostname -[ Virtual-FS ] 2/6 : Mounting /sys -[ Virtual-FS ] 5/6 : Mounting securityfs -[ Virtual-FS ] 6/6 : Mounting EFI-vars-fs -[ Read-Only Mode ] 5/9 : Setting up Kernel Static Node(s) -[ Virtual-FS ] 3/6 : Mounting /dev/pts -[ Virtual-FS ] 4/6 : Mounting /dev/shm -[ Read-Only Mode ] 8/9 : Intializing udev daemon -[ Read-Only Mode ] 9/9 : Setting up devices & subsystems -[ Read-Only Mode ] 1/9 : Mounting cgroups -[ Services ] : Enabling tty3 -[ Services ] : Enabling tty2 -[ Read-Only Mode ] 0/9 : Setting kernel parameters -[ Read-Only Mode ] 7/9 : Turning on any swap/swap-files -[ Read-Only Mode ] 4/9 : Setting system clock from rtc0 -[ Read-Only Mode ] 6/9 : Loading any kernel modules -[ Read-Only Mode ] 2/9 : Setting up console -[ ReadWrite Mode ] 1/6 : Remounting root filesystem as rw -[ ReadWrite Mode ] 4/6 : Restoring random seed -[ ReadWrite Mode ] 2/6 : Logging kernel boot -[ ReadWrite Mode ] 0/6 : Cleaning /tmp -[ ReadWrite Mode ] 3/6 : Setting up network loopback device -[ ReadWrite Mode ] 5/6 : Cleaning tempfiles -[ ReadWrite Mode ] 6/6 : Setting up tmpfiles -[ Networking ] : Bringing up any network interfaces... diff --git a/docs/requirements b/docs/requirements deleted file mode 100644 index 90eddb4..0000000 --- a/docs/requirements +++ /dev/null @@ -1,19 +0,0 @@ -## Reguired file paths: - -/sbin/init ...................... required by kernel, executes s6-linux-init with arguments -/usr/bin/sysusers ............... if esysusers is installed -/usr/bin/module-load ............ Load kernel modules at boot -/etc/vconsole.conf .............. Set key map and console font -/sbin/mkinitramfs ............... create initramfs.img -/sbin/ifup ...................... Brings up network interfaces -/sbin/ifdown .................... Brings down network interfaces -/usr/share/mkinitramfs/init.in .. config for mkinitramfs -/bin/tmpfiles ................... for creating tempdirs -/etc/s6/scripts/clean_tmp.sh .... Required by cleantmp service -/etc/s6/scripts/mount-cgroups ... Required by the cgroups service -/etc/s6/scripts/console_set.sh .. Required by the console service - -## Required directories: - -/etc/sysconfig/ifconfig.* ....... To setup network interfaces during boot -/lib/services ................... Helper scripts for ifup/ifdown diff --git a/init-s6-base.sh b/init-s6-base.sh deleted file mode 100755 index 080045c..0000000 --- a/init-s6-base.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/bash - -echo "Re-initializing init base..." -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 diff --git a/xi/bin/modules-load b/xi/bin/modules-load deleted file mode 100755 index 35e73b8..0000000 --- a/xi/bin/modules-load +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# modules-load [-n] [-v] - modules-load.d(5) compatible kernel module loader - -export PATH=/bin:/sbin - -{ -# Parameters passed as modules-load= or rd.modules-load= in kernel command line. -sed -nr 's/,/\n/;s/(.* |^)(rd\.)?modules-load=([^ ]*).*/\3/p' /proc/cmdline - -# Find files /{etc,run,usr/lib}/modules-load.d/*.conf in that order. -find -L /etc/modules-load.d /run/modules-load.d /usr/lib/modules-load.d \ - -maxdepth 1 -name '*.conf' -printf '%p %P\n' 2>/dev/null | -# Load each basename only once. - sort -k2 -s | uniq -f1 | cut -d' ' -f1 | -# Read the files, output all non-empty, non-comment lines. - tr '\012' '\0' | xargs -0 -r grep -h -v -e '^[#;]' -e '^$' -} | -# Call modprobe on the list of modules -tr '\012' '\0' | xargs -0 -r modprobe -ab "$@" diff --git a/xi/bin/tmpfiles b/xi/bin/tmpfiles deleted file mode 100755 index 5e4ee0a..0000000 --- a/xi/bin/tmpfiles +++ /dev/null @@ -1,592 +0,0 @@ -#!/bin/sh -# This is a reimplementation of the systemd tmpfiles.d code -# Control creation, deletion, and cleaning of volatile and temporary files -# -# Copyright (c) 2012 Gentoo Foundation -# Released under the 2-clause BSD license. -# -# This instance is a pure-POSIX sh version, written by Robin H Johnson -# <robbat2@gentoo.org>, based on the Arch Linux version as of 2012/01/01: -# http://projects.archlinux.org/initscripts.git/tree/arch-tmpfiles -# -# See the tmpfiles.d manpage as well: -# https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html -# This script should match the old manpage -# http://0pointer.de/public/systemd-man/tmpfiles.d.html -# as of 2012/03/12 and also implements some more recent features -# - -DRYRUN=0 - -checkprefix() { - n=$1 - shift - for x in "$@"; do - case ${n} in - ${x}*) return 0 ;; - esac - done - return 1 -} - -warninvalid() { - printf "tmpfiles: ignoring invalid entry on line %d of \`%s'\n" "${LINENUM}" "${FILE}" - error=$(( error+1 )) -} >&2 - -invalid_option() { - printf "tmpfiles: invalid option '%s'\n" "$1" >&2 - exit 1 -} - -dryrun_or_real() { - local dryrun= - if [ ${DRYRUN} -eq 1 ]; then - dryrun="echo" - fi - ${dryrun} "$@" -} - -_chattr() { - local attr="$2" - case ${attr} in - [+-=]*) : ;; - '') return ;; - *) attr="+${attr}" ;; - esac - local IFS= - dryrun_or_real chattr "$1" "${attr}" -- "$3" -} - -_setfacl() { - dryrun_or_real setfacl -P "$1" "$2" "$3" -- "$4" -} - -relabel() { - local path - local paths=$1 mode=$2 uid=$3 gid=$4 - local status - - status=0 - for path in ${paths}; do - if [ -e "${path}" ]; then - if [ -x /sbin/restorecon ]; then - dryrun_or_real restorecon ${CHOPTS} "${path}" || status="$?" - fi - if [ "${uid}" != '-' ]; then - dryrun_or_real chown ${CHOPTS} "${uid}" "${path}" || status="$?" - fi - if [ "${gid}" != '-' ]; then - dryrun_or_real chgrp ${CHOPTS} "${gid}" "${path}" || status="$?" - fi - if [ "${mode}" != '-' ]; then - dryrun_or_real chmod ${CHOPTS} "${mode}" "${path}" || status="$?" - fi - fi - done - return ${status} -} - -splitpath() { - local path=$1 - while [ -n "${path}" ]; do - printf '%s\n' "${path}" - path=${path%/*} - done -} - -_restorecon() { - local path=$1 - if [ -x /sbin/restorecon ]; then - dryrun_or_real restorecon -F "$(splitpath "${path}")" - fi -} - -createdirectory() { - local mode="$1" uid="$2" gid="$3" path="$4" - [ -d "${path}" ] || dryrun_or_real mkdir -p "${path}" - if [ "${uid}" = - ]; then - uid=root - fi - if [ "${gid}" = - ]; then - gid=root - fi - if [ "${mode}" = - ]; then - mode=0755 - fi - dryrun_or_real chown ${uid} "${path}" - dryrun_or_real chgrp ${gid} "${path}" - dryrun_or_real chmod ${mode} "${path}" -} - -createfile() { - local mode="$1" uid="$2" gid="$3" path="$4" - dryrun_or_real touch "${path}" - if [ "${uid}" = - ]; then - uid=root - fi - if [ "${gid}" = - ]; then - gid=root - fi - if [ "${mode}" = - ]; then - mode=0644 - fi - dryrun_or_real chown ${uid} "${path}" - dryrun_or_real chgrp ${gid} "${path}" - dryrun_or_real chmod ${mode} "${path}" -} - -createpipe() { - local mode="$1" uid="$2" gid="$3" path="$4" - dryrun_or_real mkfifo "${path}" - if [ "${uid}" = - ]; then - uid=root - fi - if [ "${gid}" = - ]; then - gid=root - fi - if [ "${mode}" = - ]; then - mode=0644 - fi - dryrun_or_real chown ${uid} "${path}" - dryrun_or_real chgrp ${gid} "${path}" - dryrun_or_real chmod ${mode} "${path}" -} - -_b() { - # Create a block device node if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - if [ "${uid}" = - ]; then - uid=root - fi - if [ "${gid}" = - ]; then - gid=root - fi - if [ "${mode}" = - ]; then - mode=0644 - fi - if [ ! -e "${path}" ]; then - dryrun_or_real mknod -m ${mode} "${path}" b "${arg%:*}" "${arg#*:}" - _restorecon "${path}" - dryrun_or_real chown ${uid} "${path}" - dryrun_or_real chgrp ${gid} "${path}" - fi -} - -_c() { - # Create a character device node if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - if [ "${uid}" = - ]; then - uid=root - fi - if [ "${gid}" = - ]; then - gid=root - fi - if [ "${mode}" = - ]; then - mode=0644 - fi - if [ ! -e "${path}" ]; then - dryrun_or_real mknod -m ${mode} "${path}" c "${arg%:*}" "${arg#*:}" - _restorecon "${path}" - dryrun_or_real chown ${uid} "${path}" - dryrun_or_real chgrp ${gid} "${path}" - fi -} - -_C() { - # recursively copy a file or directory - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - if [ ! -e "${path}" ]; then - dryrun_or_real cp -r "${arg}" "${path}" - _restorecon "${path}" - if [ "${uid}" != '-' ]; then - dryrun_or_real chown "${uid}" "${path}" - fi - if [ "${gid}" != '-' ]; then - dryrun_or_real chgrp "${gid}" "${path}" - fi - if [ "${mode}" != '-' ]; then - dryrun_or_real chmod "${mode}" "${path}" - fi - fi -} - -_f() { - # Create a file if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - - [ "${CREATE}" -gt 0 ] || return 0 - - if [ ! -e "${path}" ]; then - createfile "${mode}" "${uid}" "${gid}" "${path}" - if [ -n "${arg}" ]; then - _w "$@" - fi - fi -} - -_F() { - # Create or truncate a file - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - - [ "${CREATE}" -gt 0 ] || return 0 - - dryrun_or_real rm -f "${path}" - createfile "${mode}" "${uid}" "${gid}" "${path}" - if [ -n "${arg}" ]; then - _w "$@" - fi -} - -_d() { - # Create a directory if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - if [ "${CREATE}" -gt 0 ]; then - createdirectory "${mode}" "${uid}" "${gid}" "${path}" - _restorecon "${path}" - fi -} - -_D() { - # Create or empty a directory - local path=$1 mode=$2 uid=$3 gid=$4 - - if [ -d "${path}" ] && [ "${REMOVE}" -gt 0 ]; then - dryrun_or_real find "${path}" -mindepth 1 -maxdepth 1 -xdev -exec rm -rf {} + - _restorecon "${path}" - fi - - if [ "${CREATE}" -gt 0 ]; then - createdirectory "${mode}" "${uid}" "${gid}" "${path}" - _restorecon "${path}" - fi -} - -_v() { - # Create a subvolume if the path does not exist yet and the file system - # supports this (btrfs). Otherwise create a normal directory. - # TODO: Implement btrfs subvol creation. - _d "$@" -} - -_q() { - # Similar to _v. However, make sure that the subvolume will be assigned - # to the same higher-level quota groups as the subvolume it has - # been created in. - # TODO: Implement btrfs subvol creation. - _d "$@" -} - -_Q() { - # Similar to q. However, instead of copying the higher-level quota - # group assignments from the parent as-is, the lowest quota group - # of the parent subvolume is determined that is not the - # leaf quota group. - # TODO: Implement btrfs subvol creation. - _d "$@" -} - -_a() { - # Set/add file/directory ACL. Lines of this type accept - # shell-style globs in place of normal path names. - # The format of the argument field matches setfacl - local ACTION='--remove-all --set' - [ "${FORCE}" -gt 0 ] && ACTION='--modify' - _setfacl '' "${ACTION}" "$6" "$1" -} - -_A() { - # Recursively set/add file/directory ACL. Lines of this type accept - # shell-syle globs in place of normal path names. - # Does not follow symlinks - local ACTION='--remove-all --set' - [ "${FORCE}" -gt 0 ] && ACTION='--modify' - _setfacl -R "${ACTION}" "$6" "$1" -} - -_h() { - # Set file/directory attributes. Lines of this type accept - # shell-style globs in place of normal path names. - # The format of the argument field matches chattr - _chattr '' "$6" "$1" -} - -_H() { - # Recursively set file/directory attributes. Lines of this type accept - # shell-syle globs in place of normal path names. - # Does not follow symlinks - _chattr -R "$6" "$1" -} - -_L() { - # Create a symlink if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - if [ ! -e "${path}" ]; then - dryrun_or_real ln -s "${arg}" "${path}" - fi - _restorecon "${path}" -} - -_p() { - # Create a named pipe (FIFO) if it doesn't exist yet - local path=$1 mode=$2 uid=$3 gid=$4 - - [ "${CREATE}" -gt 0 ] || return 0 - - if [ ! -p "${path}" ]; then - createpipe "${mode}" "${uid}" "${gid}" "${path}" - fi -} - -_x() { - # Ignore a path during cleaning. Use this type to exclude paths from clean-up as - # controlled with the Age parameter. Note that lines of this type do not - # influence the effect of r or R lines. Lines of this type accept shell-style - # globs in place of of normal path names. - : - # XXX: we don't implement this -} - -_X() { - # Ignore a path during cleanup. Use this type to prevent path - # removal as controled with the age parameter. Note that if path is - # a directory, the content of the directory is not excluded from - # clean-up, only the directory itself. - # Lines of this type accept shell-style globs in place of normal path names. - : - # XXX: we don't implement this -} - -_r() { - # Remove a file or directory if it exists. This may not be used to remove - # non-empty directories, use R for that. Lines of this type accept shell-style - # globs in place of normal path names. - local path - local paths=$1 - local status - - [ "${REMOVE}" -gt 0 ] || return 0 - - status=0 - for path in ${paths}; do - if [ -f "${path}" ]; then - dryrun_or_real rm -f "${path}" || status="$?" - elif [ -d "${path}" ]; then - dryrun_or_real rmdir "${path}" || status="$?" - fi - done - return ${status} -} - -_R() { - # Recursively remove a path and all its subdirectories (if it is a directory). - # Lines of this type accept shell-style globs in place of normal path names. - local path - local paths=$1 - local status - - [ "${REMOVE}" -gt 0 ] || return 0 - - status=0 - for path in ${paths}; do - if [ -d "${path}" ]; then - dryrun_or_real rm -rf --one-file-system "${path}" || status="$?" - fi - done - return ${status} -} - -_w() { - # Write the argument parameter to a file, if it exists. - local path=$1 mode=$2 uid=$3 gid=$4 age=$5 arg=$6 - if [ -f "${path}" ]; then - if [ ${DRYRUN} -eq 1 ]; then - echo "echo \"${arg}\" >>\"${path}\"" - else - echo "${arg}" >>"${path}" - fi - fi -} - -_z() { - # Set ownership, access mode and relabel security context of a file or - # directory if it exists. Lines of this type accept shell-style globs in - # place of normal path names. - [ "${CREATE}" -gt 0 ] || return 0 - - relabel "$@" -} - -_Z() { - # Recursively set ownership, access mode and relabel security context of a - # path and all its subdirectories (if it is a directory). Lines of this type - # accept shell-style globs in place of normal path names. - [ "${CREATE}" -gt 0 ] || return 0 - - CHOPTS=-R relabel "$@" -} - -usage() { - printf 'usage: %s [--exclude-prefix=path] [--prefix=path] [--boot] [--create] [--remove] [--clean] [--verbose] [--dry-run]\n' "${0##*/}" - exit "${1:-0}" -} - -version() { - # We don't record the version info anywhere currently. - echo "opentmpfiles" - exit 0 -} - -BOOT=0 CREATE=0 REMOVE=0 CLEAN=0 VERBOSE=0 DRYRUN=0 error=0 LINENO=0 -EXCLUDE= -PREFIX= -FILES= - -while [ $# -gt 0 ]; do - case $1 in - --boot) BOOT=1 ;; - --create) CREATE=1 ;; - --remove) REMOVE=1 ;; - --clean) CLEAN=1 ;; # TODO: Not implemented - --verbose) VERBOSE=1 ;; - --dryrun|--dry-run) DRYRUN=1 ;; - --exclude-prefix=*) EXCLUDE="${EXCLUDE}${1##--exclude-prefix=} " ;; - --prefix=*) PREFIX="${PREFIX}${1##--prefix=} " ;; - -h|--help) usage ;; - --version) version ;; - -*) invalid_option "$1" ;; - *) FILES="${FILES} $1" - esac - shift -done - -if [ $(( CLEAN )) -eq 1 ] ; then - printf '%s clean mode is not implemented\n' "${0##*/}" - exit 1 -fi - -if [ "${CREATE}${REMOVE}" = '00' ]; then - usage 1 >&2 -fi - -# XXX: The harcoding of /usr/lib/ is an explicit choice by upstream -tmpfiles_dirs='/usr/lib/tmpfiles.d /run/tmpfiles.d /etc/tmpfiles.d' -tmpfiles_basenames='' - -if [ -z "${FILES}" ]; then - # Build a list of sorted unique basenames - # directories declared later in the tmpfiles_d array will override earlier - # directories, on a per file basename basis. - # `/etc/tmpfiles.d/foo.conf' supersedes `/usr/lib/tmpfiles.d/foo.conf'. - # `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' - for d in ${tmpfiles_dirs} ; do - [ -d "${d}" ] && for f in "${d}"/*.conf ; do - case "${f##*/}" in - systemd.conf|systemd-*.conf) continue;; - esac - [ -f "${f}" ] && tmpfiles_basenames="${tmpfiles_basenames}\n${f##*/}" - done # for f in ${d} - done # for d in ${tmpfiles_dirs} - # shellcheck disable=SC2059 - FILES="$(printf "${tmpfiles_basenames}" | sort -u )" -fi - -tmpfiles_d='' - -for b in ${FILES} ; do - if [ "${b##*/}" != "${b}" ]; then - # The user specified a path on the command line - # Just pass it through unaltered - tmpfiles_d="${tmpfiles_d} ${b}" - else - real_f='' - for d in ${tmpfiles_dirs} ; do - f=${d}/${b} - [ -f "${f}" ] && real_f=${f} - done - [ -f "${real_f}" ] && tmpfiles_d="${tmpfiles_d} ${real_f}" - fi -done - -error=0 - -# loop through the gathered fragments, sorted globally by filename. -# `/run/tmpfiles/foo.conf' will always be read after `/etc/tmpfiles.d/bar.conf' -FILE= -for FILE in ${tmpfiles_d} ; do - LINENUM=0 - - ### FILE FORMAT ### - # XXX: We ignore the 'Age' parameter - # 1 2 3 4 5 6 7 - # Cmd Path Mode UID GID Age Argument - # d /run/user 0755 root root 10d - - # Mode, UID, GID, Age, Argument may be omitted! - # If Cmd ends with !, the line is only processed if --boot is passed - - # XXX: Upstream says whitespace is NOT permitted in the Path argument. - # But IS allowed when globs are expanded for the x/r/R/z/Z types. - while read -r cmd path mode uid gid age arg rest; do - LINENUM=$(( LINENUM+1 )) - FORCE=0 - - # Unless we have both command and path, skip this line. - if [ -z "${cmd}" ] || [ -z "${path}" ]; then - continue - fi - - case ${cmd} in - \#*) continue ;; - esac - - while [ ${#cmd} -gt 1 ]; do - case ${cmd} in - *!) cmd=${cmd%!}; [ "${BOOT}" -eq "1" ] || continue 2 ;; - *+) cmd=${cmd%+}; FORCE=1; ;; - *) warninvalid ; continue 2 ;; - esac - done - - # whine about invalid entries - case ${cmd} in - f|F|w|d|D|v|p|L|c|C|b|x|X|r|R|z|Z|q|Q|h|H|a|A) ;; - *) warninvalid ; continue ;; - esac - - # fall back on defaults when parameters are passed as '-' - if [ "${mode}" = '-' ] || [ "${mode}" = '' ]; then - case "${cmd}" in - p|f|F) mode=0644 ;; - d|D|v) mode=0755 ;; - C|z|Z|x|r|R|L) ;; - esac - fi - - [ "${uid}" = '-' ] || [ "${uid}" = '' ] && uid=0 - [ "${gid}" = '-' ] || [ "${gid}" = '' ] && gid=0 - [ "${age}" = '-' ] || [ "${age}" = '' ] && age=0 - [ "${arg}" = '-' ] || [ "${arg}" = '' ] && arg='' - set -- "${path}" "${mode}" "${uid}" "${gid}" "${age}" "${arg}" - - [ -n "${EXCLUDE}" ] && checkprefix "${path}" "${EXCLUDE}" && continue - [ -n "${PREFIX}" ] && ! checkprefix "${path}" "${PREFIX}" && continue - - if [ "${FORCE}" -gt 0 ]; then - case ${cmd} in - p|L|c|b) [ -f "${path}" ] && dryrun_or_real rm -f "${path}" - esac - fi - - [ "${VERBOSE}" -eq "1" ] && echo "_${cmd}" "$@" - "_${cmd}" "$@" - rc=$? - if [ "${DRYRUN}" -eq "0" ]; then - [ ${rc} -ne 0 ] && error=$((error + 1)) - fi - done <"${FILE}" -done - -exit ${error} - -# vim: set ts=2 sw=2 sts=2 noet ft=sh: diff --git a/xi/configs/ifconfig.eth0 b/xi/configs/ifconfig.eth0 deleted file mode 100644 index 61e12e6..0000000 --- a/xi/configs/ifconfig.eth0 +++ /dev/null @@ -1,6 +0,0 @@ -ONBOOT="no" -IFACE="eth0" -SERVICE="dhcpcd " - -DHCP_START="-b -q" -DHCP_STOP="-k" diff --git a/xi/configs/ifconfig.wlan0 b/xi/configs/ifconfig.wlan0 deleted file mode 100644 index ce45099..0000000 --- a/xi/configs/ifconfig.wlan0 +++ /dev/null @@ -1,9 +0,0 @@ -ONBOOT="yes" -IFACE="wlan0" -SERVICE="wpa" - -WPA_ARGS="" - -WPA_SERVICE="dhcpcd" -DHCP_START="-b -q" -DHCP_STOP="-k" diff --git a/xi/configs/wpa_supplicant-wlan0.conf b/xi/configs/wpa_supplicant-wlan0.conf deleted file mode 100644 index acad28b..0000000 --- a/xi/configs/wpa_supplicant-wlan0.conf +++ /dev/null @@ -1,13 +0,0 @@ -ctrl_interface=/run/wpa_supplicant -ctrl_interface_group=wifi -update_config=1 - -network={ - ssid="WIFI-HOTSPOT_NAME" - psk="PASSWORD" - proto=RSN - key_mgmt=WPA-PSK - pairwise=CCMP - auth_alg=OPEN -} - diff --git a/xi/init.d/checkfs b/xi/init.d/checkfs new file mode 100644 index 0000000..5849219 --- /dev/null +++ b/xi/init.d/checkfs @@ -0,0 +1,149 @@ +#!/bin/sh +######################################################################## +# Begin checkfs +# +# Description : File System Check +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# A. Luebke - luebke@users.sourceforge.net +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +# Based on checkfs script from LFS-3.1 and earlier. +# +# From man fsck +# 0 - No errors +# 1 - File system errors corrected +# 2 - System should be rebooted +# 4 - File system errors left uncorrected +# 8 - Operational error +# 16 - Usage or syntax error +# 32 - Fsck canceled by user request +# 128 - Shared library error +# +######################################################################### + +### BEGIN INIT INFO +# Provides: checkfs +# Required-Start: udev swap +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Checks local filesystems before mounting. +# Description: Checks local filesystmes before mounting. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + if [ -f /fastboot ]; then + msg="/fastboot found, will omit " + msg="${msg} file system checks as requested.\n" + log_info_msg "${msg}" + exit 0 + fi + + log_info_msg "Mounting root file system in read-only mode... " + mount -n -o remount,ro / >/dev/null + + if [ ${?} != 0 ]; then + log_failure_msg2 + msg="\n\nCannot check root " + msg="${msg}filesystem because it could not be mounted " + msg="${msg}in read-only mode.\n\n" + msg="${msg}After you press Enter, this system will be " + msg="${msg}halted and powered off.\n\n" + log_failure_msg "${msg}" + + log_info_msg "Press Enter to continue..." + wait_for_user + /etc/rc.d/init.d/halt stop + else + log_success_msg2 + fi + + if [ -f /forcefsck ]; then + msg="/forcefsck found, forcing file" + msg="${msg} system checks as requested." + log_success_msg "$msg" + options="-f" + else + options="" + fi + + log_info_msg "Checking file systems..." + # Note: -a option used to be -p; but this fails e.g. on fsck.minix + if is_true "$VERBOSE_FSCK"; then + fsck ${options} -a -A -C -T + else + fsck ${options} -a -A -C -T >/dev/null + fi + + error_value=${?} + + if [ "${error_value}" = 0 ]; then + log_success_msg2 + fi + + if [ "${error_value}" = 1 ]; then + msg="\nWARNING:\n\nFile system errors " + msg="${msg}were found and have been corrected.\n" + msg="${msg} You may want to double-check that " + msg="${msg}everything was fixed properly." + log_warning_msg "$msg" + fi + + if [ "${error_value}" = 2 -o "${error_value}" = 3 ]; then + msg="\nWARNING:\n\nFile system errors " + msg="${msg}were found and have been been " + msg="${msg}corrected, but the nature of the " + msg="${msg}errors require this system to be rebooted.\n\n" + msg="${msg}After you press enter, " + msg="${msg}this system will be rebooted\n\n" + log_failure_msg "$msg" + + log_info_msg "Press Enter to continue..." + wait_for_user + reboot -f + fi + + if [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then + msg="\nFAILURE:\n\nFile system errors " + msg="${msg}were encountered that could not be " + msg="${msg}fixed automatically.\nThis system " + msg="${msg}cannot continue to boot and will " + msg="${msg}therefore be halted until those " + msg="${msg}errors are fixed manually by a " + msg="${msg}System Administrator.\n\n" + msg="${msg}After you press Enter, this system will be " + msg="${msg}halted and powered off.\n\n" + log_failure_msg "$msg" + + log_info_msg "Press Enter to continue..." + wait_for_user + /etc/rc.d/init.d/halt stop + fi + + if [ "${error_value}" -ge 16 ]; then + msg="FAILURE:\n\nUnexpected failure " + msg="${msg}running fsck. Exited with error " + msg="${msg} code: ${error_value}.\n" + log_info_msg $msg + exit ${error_value} + fi + + exit 0 + ;; + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End checkfs diff --git a/xi/init.d/cleanfs b/xi/init.d/cleanfs new file mode 100644 index 0000000..c75923c --- /dev/null +++ b/xi/init.d/cleanfs @@ -0,0 +1,122 @@ +#!/bin/sh +######################################################################## +# Begin cleanfs +# +# Description : Clean file system +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: cleanfs +# Required-Start: $local_fs +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Cleans temporary directories early in the boot process. +# Description: Cleans temporary directories /run, /var/lock, and +# optionally, /tmp. cleanfs also creates /run/utmp +# and any files defined in /etc/sysconfig/createfiles. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +# Function to create files/directory on boot. +create_files() +{ + # Input to file descriptor 9 and output to stdin (redirection) + exec 9>&0 < /etc/sysconfig/createfiles + + while read name type perm usr grp dtype maj min junk + do + # Ignore comments and blank lines. + case "${name}" in + ""|\#*) continue ;; + esac + + # Ignore existing files. + if [ ! -e "${name}" ]; then + # Create stuff based on its type. + case "${type}" in + dir) + mkdir "${name}" + ;; + file) + :> "${name}" + ;; + dev) + case "${dtype}" in + char) + mknod "${name}" c ${maj} ${min} + ;; + block) + mknod "${name}" b ${maj} ${min} + ;; + pipe) + mknod "${name}" p + ;; + *) + log_warning_msg "\nUnknown device type: ${dtype}" + ;; + esac + ;; + *) + log_warning_msg "\nUnknown type: ${type}" + continue + ;; + esac + + # Set up the permissions, too. + chown ${usr}:${grp} "${name}" + chmod ${perm} "${name}" + fi + done + + # Close file descriptor 9 (end redirection) + exec 0>&9 9>&- + return 0 +} + +case "${1}" in + start) + log_info_msg "Cleaning file systems:" + + if [ "${SKIPTMPCLEAN}" = "" ]; then + log_info_msg2 " /tmp" + cd /tmp && + find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1 + fi + + > /run/utmp + + if grep -q '^utmp:' /etc/group ; then + chmod 664 /run/utmp + chgrp utmp /run/utmp + fi + + (exit ${failed}) + evaluate_retval + + if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then + log_info_msg "Creating files and directories... " + create_files # Always returns 0 + evaluate_retval + fi + + exit $failed + ;; + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End cleanfs diff --git a/xi/init.d/console b/xi/init.d/console new file mode 100644 index 0000000..a5338cc --- /dev/null +++ b/xi/init.d/console @@ -0,0 +1,107 @@ +#!/bin/sh +######################################################################## +# Begin console +# +# Description : Sets keymap and screen font +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# Alexander E. Patrakov +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: console +# Required-Start: $local_fs +# Should-Start: udev_retry +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Sets up a localised console. +# Description: Sets up fonts and language settings for the user's +# local as defined by /etc/sysconfig/console. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +# Native English speakers probably don't have /etc/sysconfig/console at all +[ -r /etc/sysconfig/console ] && . /etc/sysconfig/console + +failed=0 + +case "${1}" in + start) + # See if we need to do anything + if [ -z "${KEYMAP}" ] && [ -z "${KEYMAP_CORRECTIONS}" ] && + [ -z "${FONT}" ] && [ -z "${LEGACY_CHARSET}" ] && + ! is_true "${UNICODE}"; then + exit 0 + fi + + # There should be no bogus failures below this line! + log_info_msg "Setting up Linux console..." + + # Figure out if a framebuffer console is used + [ -d /sys/class/graphics/fb0 ] && use_fb=1 || use_fb=0 + + # Figure out the command to set the console into the + # desired mode + is_true "${UNICODE}" && + MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" || + MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a" + + # On framebuffer consoles, font has to be set for each vt in + # UTF-8 mode. This doesn't hurt in non-UTF-8 mode also. + + ! is_true "${use_fb}" || [ -z "${FONT}" ] || + MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}" + + # Apply that command to all consoles mentioned in + # /etc/inittab. Important: in the UTF-8 mode this should + # happen before setfont, otherwise a kernel bug will + # show up and the unicode map of the font will not be + # used. + + for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab | + grep -o '\btty[[:digit:]]*\b'` + do + openvt -f -w -c ${TTY#tty} -- \ + /bin/sh -c "${MODE_COMMAND}" || failed=1 + done + + # Set the font (if not already set above) and the keymap + [ "${use_fb}" == "1" ] || [ -z "${FONT}" ] || setfont $FONT || failed=1 + + [ -z "${KEYMAP}" ] || + loadkeys ${KEYMAP} >/dev/null 2>&1 || + failed=1 + + [ -z "${KEYMAP_CORRECTIONS}" ] || + loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 || + failed=1 + + # Convert the keymap from $LEGACY_CHARSET to UTF-8 + [ -z "$LEGACY_CHARSET" ] || + dumpkeys -c "$LEGACY_CHARSET" | loadkeys -u >/dev/null 2>&1 || + failed=1 + + # If any of the commands above failed, the trap at the + # top would set $failed to 1 + ( exit $failed ) + evaluate_retval + + exit $failed + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End console diff --git a/xi/init.d/halt b/xi/init.d/halt new file mode 100644 index 0000000..46ccecf --- /dev/null +++ b/xi/init.d/halt @@ -0,0 +1,43 @@ +#!/bin/sh +######################################################################## +# Begin halt +# +# Description : Halt Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# : Pierre Labastie - pierre@linuxfromscratch.org +# +# Version : LFS 7.0 +# +# Notes : Update March 24th, 2022: change "stop" to "start". +# Add the $last facility to Required-start +# +######################################################################## + +### BEGIN INIT INFO +# Provides: halt +# Required-Start: $last +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: 0 +# Default-Stop: +# Short-Description: Halts the system. +# Description: Halts the System. +# X-LFS-Provided-By: LFS +### END INIT INFO + +case "${1}" in + start) + halt -d -f -i -p + ;; + + *) + echo "Usage: {start}" + exit 1 + ;; +esac + +# End halt diff --git a/xi/init.d/localnet b/xi/init.d/localnet new file mode 100644 index 0000000..83d63a0 --- /dev/null +++ b/xi/init.d/localnet @@ -0,0 +1,70 @@ +#!/bin/sh +######################################################################## +# Begin localnet +# +# Description : Loopback device +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: localnet +# Required-Start: mountvirtfs +# Should-Start: modules +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Starts the local network. +# Description: Sets the hostname of the machine and starts the +# loopback interface. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions +[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network +[ -r /etc/hostname ] && HOSTNAME=`cat /etc/hostname` + +case "${1}" in + start) + log_info_msg "Bringing up the loopback interface..." + ip addr add 127.0.0.1/8 label lo dev lo + ip link set lo up + evaluate_retval + + log_info_msg "Setting hostname to ${HOSTNAME}..." + hostname ${HOSTNAME} + evaluate_retval + ;; + + stop) + log_info_msg "Bringing down the loopback interface..." + ip link set lo down + evaluate_retval + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + echo "Hostname is: $(hostname)" + ip link show lo + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 + +# End localnet diff --git a/xi/init.d/modules b/xi/init.d/modules new file mode 100644 index 0000000..3ef4cec --- /dev/null +++ b/xi/init.d/modules @@ -0,0 +1,82 @@ +#!/bin/sh +######################################################################## +# Begin modules +# +# Description : Module auto-loading script +# +# Authors : Zack Winkles +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: modules +# Required-Start: mountvirtfs +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Loads required modules. +# Description: Loads modules listed in /etc/sysconfig/modules. +# X-LFS-Provided-By: LFS +### END INIT INFO + +# Assure that the kernel has module support. +[ -e /proc/modules ] || exit 0 + +. /lib/lsb/init-functions + +case "${1}" in + start) + # Exit if there's no modules file or there are no + # valid entries + [ -r /etc/sysconfig/modules ] || exit 0 + egrep -qv '^($|#)' /etc/sysconfig/modules || exit 0 + + log_info_msg "Loading modules:" + + # Only try to load modules if the user has actually given us + # some modules to load. + + while read module args; do + + # Ignore comments and blank lines. + case "$module" in + ""|"#"*) continue ;; + esac + + # Attempt to load the module, passing any arguments provided. + modprobe ${module} ${args} >/dev/null + + # Print the module name if successful, otherwise take note. + if [ $? -eq 0 ]; then + log_info_msg2 " ${module}" + else + failedmod="${failedmod} ${module}" + fi + done < /etc/sysconfig/modules + + # Print a message about successfully loaded modules on the correct line. + log_success_msg2 + + # Print a failure message with a list of any modules that + # may have failed to load. + if [ -n "${failedmod}" ]; then + log_failure_msg "Failed to load modules:${failedmod}" + exit 1 + fi + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +exit 0 + +# End modules diff --git a/xi/init.d/mountfs b/xi/init.d/mountfs new file mode 100644 index 0000000..6bf2d6f --- /dev/null +++ b/xi/init.d/mountfs @@ -0,0 +1,78 @@ +#!/bin/sh +######################################################################## +# Begin mountfs +# +# Description : File System Mount Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: $local_fs +# Required-Start: udev checkfs +# Should-Start: modules +# Required-Stop: localnet +# Should-Stop: +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Mounts/unmounts local filesystems defined in /etc/fstab. +# Description: Remounts root filesystem read/write and mounts all +# remaining local filesystems defined in /etc/fstab on +# start. Remounts root filesystem read-only and unmounts +# remaining filesystems on stop. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Remounting root file system in read-write mode..." + mount --options remount,rw / >/dev/null + evaluate_retval + + # Remove fsck-related file system watermarks. + rm -f /fastboot /forcefsck + + # Make sure /dev/pts exists + mkdir -p /dev/pts + + # This will mount all filesystems that do not have _netdev in + # their option list. _netdev denotes a network filesystem. + + log_info_msg "Mounting remaining file systems..." + failed=0 + mount --all --test-opts no_netdev >/dev/null || failed=1 + evaluate_retval + exit $failed + ;; + + stop) + # Don't unmount virtual file systems like /run + log_info_msg "Unmounting all other currently mounted file systems..." + # Ensure any loop devies are removed + losetup -D + umount --all --detach-loop --read-only \ + --types notmpfs,nosysfs,nodevtmpfs,noproc,nodevpts >/dev/null + evaluate_retval + + # Make sure / is mounted read only (umount bug) + mount --options remount,ro / + + # Make all LVM volume groups unavailable, if appropriate + # This fails if swap or / are on an LVM partition + #if [ -x /sbin/vgchange ]; then /sbin/vgchange -an > /dev/null; fi + ;; + + *) + echo "Usage: ${0} {start|stop}" + exit 1 + ;; +esac + +# End mountfs diff --git a/xi/init.d/mountvirtfs b/xi/init.d/mountvirtfs new file mode 100644 index 0000000..6396343 --- /dev/null +++ b/xi/init.d/mountvirtfs @@ -0,0 +1,74 @@ +#!/bin/sh +######################################################################## +# Begin mountvirtfs +# +# Description : Ensure proc, sysfs, run, and dev are mounted +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: mountvirtfs +# Required-Start: $first +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Mounts various special fs needed at start +# Description: Mounts /sys and /proc virtual (kernel) filesystems. +# Mounts /run (tmpfs) and /dev (devtmpfs). +# This is done only if they are not already mounted. +# with the kernel config proposed in the book, dev +# should be automatically mounted by the kernel. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + # Make sure /run is available before logging any messages + if ! mountpoint /run >/dev/null; then + mount /run || failed=1 + fi + + mkdir -p /run/lock /run/shm + chmod 1777 /run/shm /run/lock + + log_info_msg "Mounting virtual file systems: ${INFO}/run" + + if ! mountpoint /proc >/dev/null; then + log_info_msg2 " ${INFO}/proc" + mount -o nosuid,noexec,nodev /proc || failed=1 + fi + + if ! mountpoint /sys >/dev/null; then + log_info_msg2 " ${INFO}/sys" + mount -o nosuid,noexec,nodev /sys || failed=1 + fi + + if ! mountpoint /dev >/dev/null; then + log_info_msg2 " ${INFO}/dev" + mount -o mode=0755,nosuid /dev || failed=1 + fi + + ln -sfn /run/shm /dev/shm + + (exit ${failed}) + evaluate_retval + exit $failed + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; +esac + +# End mountvirtfs diff --git a/xi/init.d/network b/xi/init.d/network new file mode 100644 index 0000000..5b2dd9b --- /dev/null +++ b/xi/init.d/network @@ -0,0 +1,90 @@ +#!/bin/sh +######################################################################## +# Begin network +# +# Description : Network Control Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# Nathan Coulson - nathan@linuxfromscratch.org +# Kevin P. Fleming - kpfleming@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: $network +# Required-Start: $local_fs localnet swap +# Should-Start: $syslog firewalld iptables nftables +# Required-Stop: $local_fs localnet swap +# Should-Stop: $syslog firewalld iptables nftables +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts and configures network interfaces. +# Description: Starts and configures network interfaces. +# X-LFS-Provided-By: LFS +### END INIT INFO + +case "${1}" in + start) + # if the default route exists, network is already configured + if ip route | grep -q "^default"; then return 0; fi + # Start all network interfaces + for file in /etc/sysconfig/ifconfig.* + do + interface=${file##*/ifconfig.} + + # Skip if $file is * (because nothing was found) + if [ "${interface}" = "*" ]; then continue; fi + + /sbin/ifup ${interface} + done + ;; + + stop) + # Unmount any network mounted file systems + umount --all --force --types nfs,cifs,nfs4 + + # Reverse list + net_files="" + for file in /etc/sysconfig/ifconfig.* + do + net_files="${file} ${net_files}" + done + + # Stop all network interfaces + for file in ${net_files} + do + interface=${file##*/ifconfig.} + + # Skip if $file is * (because nothing was found) + if [ "${interface}" = "*" ]; then continue; fi + + # See if interface exists + if [ ! -e /sys/class/net/$interface ]; then continue; fi + + # Is interface UP? + ip link show $interface 2>/dev/null | grep -q "state UP" + if [ $? -ne 0 ]; then continue; fi + + /sbin/ifdown ${interface} + done + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + *) + echo "Usage: ${0} {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 + +# End network diff --git a/xi/init.d/rc b/xi/init.d/rc new file mode 100644 index 0000000..7dd503a --- /dev/null +++ b/xi/init.d/rc @@ -0,0 +1,227 @@ +#!/bin/bash +######################################################################## +# Begin rc +# +# Description : Main Run Level Control Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# : DJ Lucas - dj@linuxfromscratch.org +# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org +# : Pierre Labastie - pierre@linuxfromscratch.org +# +# Version : LFS 7.0 +# +# Notes : Updates March 24th, 2022: new semantics of S/K files +# - Instead of testing that S scripts were K scripts in the +# previous runlevel, test that they were not S scripts +# - Instead of testing that K scripts were S scripts in the +# previous runlevel, test that they were not K scripts +# - S scripts in runlevel 0 or 6 are now run with +# "script start" (was "script stop" previously). +######################################################################## + +. /lib/lsb/init-functions + +print_error_msg() +{ + log_failure_msg + # $i is set when called + MSG="FAILURE:\n\nYou should not be reading this error message.\n\n" + MSG="${MSG}It means that an unforeseen error took place in\n" + MSG="${MSG}${i},\n" + MSG="${MSG}which exited with a return value of ${error_value}.\n" + + MSG="${MSG}If you're able to track this error down to a bug in one of\n" + MSG="${MSG}the files provided by the ${DISTRO_MINI} book,\n" + MSG="${MSG}please be so kind to inform us at ${DISTRO_CONTACT}.\n" + log_failure_msg "${MSG}" + + log_info_msg "Press Enter to continue..." + wait_for_user +} + +check_script_status() +{ + # $i is set when called + if [ ! -f ${i} ]; then + log_warning_msg "${i} is not a valid symlink." + SCRIPT_STAT="1" + fi + + if [ ! -x ${i} ]; then + log_warning_msg "${i} is not executable, skipping." + SCRIPT_STAT="1" + fi +} + +run() +{ + if [ -z $interactive ]; then + ${1} ${2} + return $? + fi + + while true; do + read -p "Run ${1} ${2} (Yes/no/continue)? " -n 1 runit + echo + + case ${runit} in + c | C) + interactive="" + ${i} ${2} + ret=${?} + break; + ;; + + n | N) + return 0 + ;; + + y | Y) + ${i} ${2} + ret=${?} + break + ;; + esac + done + + return $ret +} + +# Read any local settings/overrides +[ -r /etc/sysconfig/rc.site ] && source /etc/sysconfig/rc.site + +DISTRO=${DISTRO:-"Linux From Scratch"} +DISTRO_CONTACT=${DISTRO_CONTACT:-"lfs-dev@lists.linuxfromscratch.org (Registration required)"} +DISTRO_MINI=${DISTRO_MINI:-"LFS"} +IPROMPT=${IPROMPT:-"no"} + +# These 3 signals will not cause our script to exit +trap "" INT QUIT TSTP + +[ "${1}" != "" ] && runlevel=${1} + +if [ "${runlevel}" == "" ]; then + echo "Usage: ${0} <runlevel>" >&2 + exit 1 +fi + +previous=${PREVLEVEL} +[ "${previous}" == "" ] && previous=N + +if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then + log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n" + exit 1 +fi + +if [ "$runlevel" == "6" -o "$runlevel" == "0" ]; then IPROMPT="no"; fi + +# Note: In ${LOGLEVEL:-7}, it is ':' 'dash' '7', not minus 7 +if [ "$runlevel" == "S" ]; then + [ -r /etc/sysconfig/console ] && source /etc/sysconfig/console + dmesg -n "${LOGLEVEL:-7}" +fi + +if [ "${IPROMPT}" == "yes" -a "${runlevel}" == "S" ]; then + # The total length of the distro welcome string, without escape codes + wlen=${wlen:-$(echo "Welcome to ${DISTRO}" | wc -c )} + welcome_message=${welcome_message:-"Welcome to ${INFO}${DISTRO}${NORMAL}"} + + # The total length of the interactive string, without escape codes + ilen=${ilen:-$(echo "Press 'I' to enter interactive startup" | wc -c )} + i_message=${i_message:-"Press '${FAILURE}I${NORMAL}' to enter interactive startup"} + + + # dcol and icol are spaces before the message to center the message + # on screen. itime is the amount of wait time for the user to press a key + wcol=$(( ( ${COLUMNS} - ${wlen} ) / 2 )) + icol=$(( ( ${COLUMNS} - ${ilen} ) / 2 )) + itime=${itime:-"3"} + + echo -e "\n\n" + echo -e "\\033[${wcol}G${welcome_message}" + echo -e "\\033[${icol}G${i_message}${NORMAL}" + echo "" + read -t "${itime}" -n 1 interactive 2>&1 > /dev/null +fi + +# Make lower case +[ "${interactive}" == "I" ] && interactive="i" +[ "${interactive}" != "i" ] && interactive="" + +# Read the state file if it exists from runlevel S +[ -r /run/interactive ] && source /run/interactive + +# Stop all services marked as K, except if marked as K in the previous +# runlevel: it is the responsibility of the script to not try to kill +# a non running service +if [ "${previous}" != "N" ]; then + for i in $(ls -v /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null) + do + check_script_status + if [ "${SCRIPT_STAT}" == "1" ]; then + SCRIPT_STAT="0" + continue + fi + + suffix=${i#/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]} + [ -e /etc/rc.d/rc${previous}.d/K[0-9][0-9]$suffix ] && continue + + run ${i} stop + error_value=${?} + + if [ "${error_value}" != "0" ]; then print_error_msg; fi + done +fi + +if [ "${previous}" == "N" ]; then export IN_BOOT=1; fi + +if [ "$runlevel" == "6" -a -n "${FASTBOOT}" ]; then + touch /fastboot +fi + + +# Start all services marked as S in this runlevel, except if marked as +# S in the previous runlevel +# it is the responsabily of the script to not try to start an already running +# service +for i in $( ls -v /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null) +do + + if [ "${previous}" != "N" ]; then + suffix=${i#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]} + [ -e /etc/rc.d/rc${previous}.d/S[0-9][0-9]$suffix ] && continue + fi + + check_script_status + if [ "${SCRIPT_STAT}" == "1" ]; then + SCRIPT_STAT="0" + continue + fi + + run ${i} start + + error_value=${?} + + if [ "${error_value}" != "0" ]; then print_error_msg; fi +done + +# Store interactive variable on switch from runlevel S and remove if not +if [ "${runlevel}" == "S" -a "${interactive}" == "i" ]; then + echo "interactive=\"i\"" > /run/interactive +else + rm -f /run/interactive 2> /dev/null +fi + +# Copy the boot log on initial boot only +if [ "${previous}" == "N" -a "${runlevel}" != "S" ]; then + cat $BOOTLOG >> /var/log/boot.log + + # Mark the end of boot + echo "--------" >> /var/log/boot.log + + # Remove the temporary file + rm -f $BOOTLOG 2> /dev/null +fi + +# End rc diff --git a/xi/init.d/reboot b/xi/init.d/reboot new file mode 100644 index 0000000..b41b033 --- /dev/null +++ b/xi/init.d/reboot @@ -0,0 +1,47 @@ +#!/bin/sh +######################################################################## +# Begin reboot +# +# Description : Reboot Scripts +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org +# : Pierre Labastie - pierre@linuxfromscratch.org +# +# Version : LFS 7.0 +# +# Notes : Update March 24th, 2022: change "stop" to "start". +# Add the $last facility to Required-start +# +######################################################################## + +### BEGIN INIT INFO +# Provides: reboot +# Required-Start: $last +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: 6 +# Default-Stop: +# Short-Description: Reboots the system. +# Description: Reboots the System. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Restarting system..." + reboot -d -f -i + ;; + + *) + echo "Usage: ${0} {start}" + exit 1 + ;; + +esac + +# End reboot diff --git a/xi/init.d/sendsignals b/xi/init.d/sendsignals new file mode 100644 index 0000000..d2c80eb --- /dev/null +++ b/xi/init.d/sendsignals @@ -0,0 +1,69 @@ +#!/bin/sh +######################################################################## +# Begin sendsignals +# +# Description : Sendsignals Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: sendsignals +# Required-Start: +# Should-Start: +# Required-Stop: $local_fs swap localnet +# Should-Stop: +# Default-Start: +# Default-Stop: 0 6 +# Short-Description: Attempts to kill remaining processes. +# Description: Attempts to kill remaining processes. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + stop) + omit=$(pidof mdmon) + [ -n "$omit" ] && omit="-o $omit" + + log_info_msg "Sending all processes the TERM signal..." + killall5 -15 $omit + error_value=${?} + + sleep ${KILLDELAY} + + if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then + log_success_msg + else + log_failure_msg + fi + + log_info_msg "Sending all processes the KILL signal..." + killall5 -9 $omit + error_value=${?} + + sleep ${KILLDELAY} + + if [ "${error_value}" = 0 -o "${error_value}" = 2 ]; then + log_success_msg + else + log_failure_msg + fi + ;; + + *) + echo "Usage: ${0} {stop}" + exit 1 + ;; + +esac + +exit 0 + +# End sendsignals diff --git a/xi/init.d/setclock b/xi/init.d/setclock new file mode 100644 index 0000000..cd4f617 --- /dev/null +++ b/xi/init.d/setclock @@ -0,0 +1,63 @@ +#!/bin/sh +######################################################################## +# Begin setclock +# +# Description : Setting Linux Clock +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: +# Required-Start: +# Should-Start: modules +# Required-Stop: +# Should-Stop: $syslog +# Default-Start: S +# Default-Stop: +# Short-Description: Stores and restores time from the hardware clock +# Description: On boot, system time is obtained from hwclock. The +# hardware clock can also be set on shutdown. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +[ -r /etc/sysconfig/clock ] && . /etc/sysconfig/clock + + +case "${UTC}" in + yes|true|1) + CLOCKPARAMS="${CLOCKPARAMS} --utc" + ;; + + no|false|0) + CLOCKPARAMS="${CLOCKPARAMS} --localtime" + ;; + +esac + +case ${1} in + start) + hwclock --hctosys ${CLOCKPARAMS} >/dev/null + ;; + + stop) + log_info_msg "Setting hardware clock..." + hwclock --systohc ${CLOCKPARAMS} >/dev/null + evaluate_retval + ;; + + *) + echo "Usage: ${0} {start|stop}" + exit 1 + ;; + +esac + +exit 0 diff --git a/xi/init.d/swap b/xi/init.d/swap new file mode 100644 index 0000000..9747024 --- /dev/null +++ b/xi/init.d/swap @@ -0,0 +1,63 @@ +#!/bin/sh +######################################################################## +# Begin swap +# +# Description : Swap Control Script +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: swap +# Required-Start: udev +# Should-Start: modules +# Required-Stop: localnet +# Should-Stop: $local_fs +# Default-Start: S +# Default-Stop: 0 6 +# Short-Description: Mounts and unmounts swap partitions. +# Description: Mounts and unmounts swap partitions defined in +# /etc/fstab. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Activating all swap files/partitions..." + swapon -a + evaluate_retval + ;; + + stop) + log_info_msg "Deactivating all swap files/partitions..." + swapoff -a + evaluate_retval + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + log_success_msg "Retrieving swap status." + swapon -s + ;; + + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 + +# End swap diff --git a/xi/init.d/sysctl b/xi/init.d/sysctl new file mode 100644 index 0000000..c90da9d --- /dev/null +++ b/xi/init.d/sysctl @@ -0,0 +1,54 @@ +#!/bin/sh +######################################################################## +# Begin sysctl +# +# Description : File uses /etc/sysctl.conf to set kernel runtime +# parameters +# +# Authors : Nathan Coulson (nathan@linuxfromscratch.org) +# Matthew Burgress (matthew@linuxfromscratch.org) +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: sysctl +# Required-Start: mountvirtfs +# Should-Start: console +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Makes changes to the proc filesystem +# Description: Makes changes to the proc filesystem as defined in +# /etc/sysctl.conf. See 'man sysctl(8)'. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + if [ -f "/etc/sysctl.conf" ]; then + log_info_msg "Setting kernel runtime parameters..." + sysctl -q -p + evaluate_retval + fi + ;; + + status) + sysctl -a + ;; + + *) + echo "Usage: ${0} {start|status}" + exit 1 + ;; +esac + +exit 0 + +# End sysctl diff --git a/xi/init.d/sysklogd b/xi/init.d/sysklogd new file mode 100644 index 0000000..e86b87b --- /dev/null +++ b/xi/init.d/sysklogd @@ -0,0 +1,79 @@ +#!/bin/sh +######################################################################## +# Begin sysklogd +# +# Description : Sysklogd loader +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: $syslog +# Required-Start: $first localnet +# Should-Start: +# Required-Stop: $local_fs +# Should-Stop: sendsignals +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts kernel and system log daemons. +# Description: Starts kernel and system log daemons. +# /etc/fstab. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Starting system log daemon..." + parms=${SYSKLOGD_PARMS-'-m 0'} + start_daemon /sbin/syslogd $parms + evaluate_retval + + log_info_msg "Starting kernel log daemon..." + start_daemon /sbin/klogd + evaluate_retval + ;; + + stop) + log_info_msg "Stopping kernel log daemon..." + killproc /sbin/klogd + evaluate_retval + + log_info_msg "Stopping system log daemon..." + killproc /sbin/syslogd + evaluate_retval + ;; + + reload) + log_info_msg "Reloading system log daemon config file..." + pid=`pidofproc syslogd` + kill -HUP "${pid}" + evaluate_retval + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + status) + statusproc /sbin/syslogd + statusproc klogd + ;; + + *) + echo "Usage: ${0} {start|stop|reload|restart|status}" + exit 1 + ;; +esac + +exit 0 + +# End sysklogd diff --git a/xi/init.d/template b/xi/init.d/template new file mode 100644 index 0000000..0a7872d --- /dev/null +++ b/xi/init.d/template @@ -0,0 +1,69 @@ +#!/bin/sh +######################################################################## +# Begin scriptname +# +# Description : +# +# Authors : +# +# Version : LFS x.x +# +# Notes : +# +######################################################################## + +### BEGIN INIT INFO +# Provides: template +# Required-Start: +# Should-Start: +# Required-Stop: +# Should-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: +# Description: +# X-LFS-Provided-By: +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Starting..." + # if it is possible to use start_daemon + start_daemon fully_qualified_path + # if it is not possible to use start_daemon + # (command to start the daemon is not simple enough) + if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then + command_to_start_the_service + fi + evaluate_retval + ;; + + stop) + log_info_msg "Stopping..." + # if it is possible to use killproc + killproc fully_qualified_path + # if it is not possible to use killproc + # (the daemon shoudn't be stopped by killing it) + if pidofproc daemon_name_as_reported_by_ps >/dev/null; then + command_to_stop_the_service + fi + evaluate_retval + ;; + + restart) + ${0} stop + sleep 1 + ${0} start + ;; + + *) + echo "Usage: ${0} {start|stop|restart}" + exit 1 + ;; +esac + +exit 0 + +# End scriptname diff --git a/xi/init.d/udev b/xi/init.d/udev new file mode 100644 index 0000000..c74c8e1 --- /dev/null +++ b/xi/init.d/udev @@ -0,0 +1,76 @@ +#!/bin/sh +######################################################################## +# Begin udev +# +# Description : Udev cold-plugging script +# +# Authors : Zack Winkles, Alexander E. Patrakov +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: udev $time +# Required-Start: localnet +# Should-Start: modules +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Populates /dev with device nodes. +# Description: Mounts a tempfs on /dev and starts the udevd daemon. +# Device nodes are created as defined by udev. +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Populating /dev with device nodes... " + if ! grep -q '[[:space:]]sysfs' /proc/mounts; then + log_failure_msg2 + msg="FAILURE:\n\nUnable to create " + msg="${msg}devices without a SysFS filesystem\n\n" + msg="${msg}After you press Enter, this system " + msg="${msg}will be halted and powered off.\n\n" + log_info_msg "$msg" + log_info_msg "Press Enter to continue..." + wait_for_user + /etc/rc.d/init.d/halt stop + fi + + # Start the udev daemon to continually watch for, and act on, + # uevents + /sbin/udevd --daemon + + # Now traverse /sys in order to "coldplug" devices that have + # already been discovered + /sbin/udevadm trigger --action=add --type=subsystems + /sbin/udevadm trigger --action=add --type=devices + /sbin/udevadm trigger --action=change --type=devices + + # Now wait for udevd to process the uevents we triggered + if ! is_true "$OMIT_UDEV_SETTLE"; then + /sbin/udevadm settle + fi + + # If any LVM based partitions are on the system, ensure they + # are activated so they can be used. + if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi + + log_success_msg2 + ;; + + *) + echo "Usage ${0} {start}" + exit 1 + ;; +esac + +exit 0 + +# End udev diff --git a/xi/init.d/udev_retry b/xi/init.d/udev_retry new file mode 100644 index 0000000..112846a --- /dev/null +++ b/xi/init.d/udev_retry @@ -0,0 +1,75 @@ +#!/bin/sh +######################################################################## +# Begin udev_retry +# +# Description : Udev cold-plugging script (retry) +# +# Authors : Alexander E. Patrakov +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# Bryan Kadzban - +# +# Version : LFS 7.0 +# +######################################################################## + +### BEGIN INIT INFO +# Provides: udev_retry +# Required-Start: udev +# Should-Start: $local_fs cleanfs +# Required-Stop: +# Should-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Replays failed uevents and creates additional devices. +# Description: Replays any failed uevents that were skipped due to +# slow hardware initialization, and creates those needed +# device nodes +# X-LFS-Provided-By: LFS +### END INIT INFO + +. /lib/lsb/init-functions + +case "${1}" in + start) + log_info_msg "Retrying failed uevents, if any..." + + # As of udev-186, the --run option is no longer valid + #rundir=$(/sbin/udevadm info --run) + rundir=/run/udev + # From Debian: "copy the rules generated before / was mounted + # read-write": + + for file in ${rundir}/tmp-rules--*; do + dest=${file##*tmp-rules--} + [ "$dest" = '*' ] && break + cat $file >> /etc/udev/rules.d/$dest + rm -f $file + done + + # Re-trigger the uevents that may have failed, + # in hope they will succeed now + /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ + while read line ; do + for subsystem in $line ; do + /sbin/udevadm trigger --subsystem-match=$subsystem --action=add + done + done + + # Now wait for udevd to process the uevents we triggered + if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then + /sbin/udevadm settle + fi + + evaluate_retval + ;; + + *) + echo "Usage ${0} {start}" + exit 1 + ;; +esac + +exit 0 + +# End udev_retry diff --git a/xi/inittab b/xi/inittab deleted file mode 100644 index c54a0cb..0000000 --- a/xi/inittab +++ /dev/null @@ -1,27 +0,0 @@ -# Begin /etc/inittab - -id:3:initdefault: - -si::sysinit:/etc/rc.d/init.d/rc S - -l0:0:wait:/etc/rc.d/init.d/rc 0 -l1:S1:wait:/etc/rc.d/init.d/rc 1 -l2:2:wait:/etc/rc.d/init.d/rc 2 -l3:3:wait:/etc/rc.d/init.d/rc 3 -l4:4:wait:/etc/rc.d/init.d/rc 4 -l5:5:wait:/etc/rc.d/init.d/rc 5 -l6:6:wait:/etc/rc.d/init.d/rc 6 - -ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now - -su:S016:once:/sbin/sulogin - -1:2345:respawn:/sbin/agetty --noclear tty1 9600 -2:2345:respawn:/sbin/agetty tty2 9600 -3:2345:respawn:/sbin/agetty tty3 9600 -4:2345:respawn:/sbin/agetty tty4 9600 -5:2345:respawn:/sbin/agetty tty5 9600 -6:2345:respawn:/sbin/agetty tty6 9600 - -# End /etc/inittab - diff --git a/xi/lib/services/init-functions b/xi/lib/services/init-functions new file mode 100644 index 0000000..ece4d79 --- /dev/null +++ b/xi/lib/services/init-functions @@ -0,0 +1,810 @@ +#!/bin/sh +######################################################################## +# +# Begin /lib/lsb/init-funtions +# +# Description : Run Level Control Functions +# +# Authors : Gerard Beekmans - gerard@linuxfromscratch.org +# : DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +# Notes : With code based on Matthias Benkmann's simpleinit-msb +# http://winterdrache.de/linux/newboot/index.html +# +# The file should be located in /lib/lsb +# +######################################################################## + +## Environmental setup +# Setup default values for environment +umask 022 +export PATH="/bin:/usr/bin:/sbin:/usr/sbin" + +## Set color commands, used via echo +# Please consult `man console_codes for more information +# under the "ECMA-48 Set Graphics Rendition" section +# +# Warning: when switching from a 8bit to a 9bit font, +# the linux console will reinterpret the bold (1;) to +# the top 256 glyphs of the 9bit font. This does +# not affect framebuffer consoles + +NORMAL="\\033[0;39m" # Standard console grey +SUCCESS="\\033[1;32m" # Success is green +WARNING="\\033[1;33m" # Warnings are yellow +FAILURE="\\033[1;31m" # Failures are red +INFO="\\033[1;36m" # Information is light cyan +BRACKET="\\033[1;34m" # Brackets are blue + +# Use a colored prefix +BMPREFIX=" " +SUCCESS_PREFIX="${SUCCESS} * ${NORMAL} " +FAILURE_PREFIX="${FAILURE}*****${NORMAL} " +WARNING_PREFIX="${WARNING} *** ${NORMAL} " +SKIP_PREFIX="${INFO} S ${NORMAL}" + +SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}" +FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}" +WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}" +SKIP_SUFFIX="${BRACKET}[${INFO} SKIP ${BRACKET}]${NORMAL}" + +BOOTLOG=/run/bootlog +KILLDELAY=3 +SCRIPT_STAT="0" + +# Set any user specified environment variables e.g. HEADLESS +[ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site + +## Screen Dimensions +# Find current screen size +if [ -z "${COLUMNS}" ]; then + COLUMNS=$(stty size) + COLUMNS=${COLUMNS##* } +fi + +# When using remote connections, such as a serial port, stty size returns 0 +if [ "${COLUMNS}" = "0" ]; then + COLUMNS=80 +fi + +## Measurements for positioning result messages +COL=$((${COLUMNS} - 8)) +WCOL=$((${COL} - 2)) + +## Set Cursor Position Commands, used via echo +SET_COL="\\033[${COL}G" # at the $COL char +SET_WCOL="\\033[${WCOL}G" # at the $WCOL char +CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char +CURS_ZERO="\\033[0G" + +################################################################################ +# start_daemon() # +# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] # +# # +# Purpose: This runs the specified program as a daemon # +# # +# Inputs: -f: (force) run the program even if it is already running. # +# -n nicelevel: specify a nice level. See 'man nice(1)'. # +# -p pidfile: use the specified file to determine PIDs. # +# pathname: the complete path to the specified program # +# args: additional arguments passed to the program (pathname) # +# # +# Return values (as defined by LSB exit codes): # +# 0 - program is running or service is OK # +# 1 - generic or unspecified error # +# 2 - invalid or excessive argument(s) # +# 5 - program is not installed # +################################################################################ +start_daemon() +{ + local force="" + local nice="0" + local pidfile="" + local pidlist="" + local retval="" + + # Process arguments + while true + do + case "${1}" in + + -f) + force="1" + shift 1 + ;; + + -n) + nice="${2}" + shift 2 + ;; + + -p) + pidfile="${2}" + shift 2 + ;; + + -*) + return 2 + ;; + + *) + program="${1}" + break + ;; + esac + done + + # Check for a valid program + if [ ! -e "${program}" ]; then return 5; fi + + # Execute + if [ -z "${force}" ]; then + if [ -z "${pidfile}" ]; then + # Determine the pid by discovery + pidlist=`pidofproc "${1}"` + retval="${?}" + else + # The PID file contains the needed PIDs + # Note that by LSB requirement, the path must be given to pidofproc, + # however, it is not used by the current implementation or standard. + pidlist=`pidofproc -p "${pidfile}" "${1}"` + retval="${?}" + fi + + # Return a value ONLY + # It is the init script's (or distribution's functions) responsibilty + # to log messages! + case "${retval}" in + + 0) + # Program is already running correctly, this is a + # successful start. + return 0 + ;; + + 1) + # Program is not running, but an invalid pid file exists + # remove the pid file and continue + rm -f "${pidfile}" + ;; + + 3) + # Program is not running and no pidfile exists + # do nothing here, let start_deamon continue. + ;; + + *) + # Others as returned by status values shall not be interpreted + # and returned as an unspecified error. + return 1 + ;; + esac + fi + + # Do the start! + nice -n "${nice}" "${@}" +} + +################################################################################ +# killproc() # +# Usage: killproc [-p pidfile] pathname [signal] # +# # +# Purpose: Send control signals to running processes # +# # +# Inputs: -p pidfile, uses the specified pidfile # +# pathname, pathname to the specified program # +# signal, send this signal to pathname # +# # +# Return values (as defined by LSB exit codes): # +# 0 - program (pathname) has stopped/is already stopped or a # +# running program has been sent specified signal and stopped # +# successfully # +# 1 - generic or unspecified error # +# 2 - invalid or excessive argument(s) # +# 5 - program is not installed # +# 7 - program is not running and a signal was supplied # +################################################################################ +killproc() +{ + local pidfile + local program + local prefix + local progname + local signal="-TERM" + local fallback="-KILL" + local nosig + local pidlist + local retval + local pid + local delay="30" + local piddead + local dtime + + # Process arguments + while true; do + case "${1}" in + -p) + pidfile="${2}" + shift 2 + ;; + + *) + program="${1}" + if [ -n "${2}" ]; then + signal="${2}" + fallback="" + else + nosig=1 + fi + + # Error on additional arguments + if [ -n "${3}" ]; then + return 2 + else + break + fi + ;; + esac + done + + # Check for a valid program + if [ ! -e "${program}" ]; then return 5; fi + + # Check for a valid signal + check_signal "${signal}" + if [ "${?}" -ne "0" ]; then return 2; fi + + # Get a list of pids + if [ -z "${pidfile}" ]; then + # determine the pid by discovery + pidlist=`pidofproc "${1}"` + retval="${?}" + else + # The PID file contains the needed PIDs + # Note that by LSB requirement, the path must be given to pidofproc, + # however, it is not used by the current implementation or standard. + pidlist=`pidofproc -p "${pidfile}" "${1}"` + retval="${?}" + fi + + # Return a value ONLY + # It is the init script's (or distribution's functions) responsibilty + # to log messages! + case "${retval}" in + + 0) + # Program is running correctly + # Do nothing here, let killproc continue. + ;; + + 1) + # Program is not running, but an invalid pid file exists + # Remove the pid file. + + progname=${program##*/} + + if [[ -e "/run/${progname}.pid" ]]; then + pidfile="/run/${progname}.pid" + rm -f "${pidfile}" + fi + + # This is only a success if no signal was passed. + if [ -n "${nosig}" ]; then + return 0 + else + return 7 + fi + ;; + + 3) + # Program is not running and no pidfile exists + # This is only a success if no signal was passed. + if [ -n "${nosig}" ]; then + return 0 + else + return 7 + fi + ;; + + *) + # Others as returned by status values shall not be interpreted + # and returned as an unspecified error. + return 1 + ;; + esac + + # Perform different actions for exit signals and control signals + check_sig_type "${signal}" + + if [ "${?}" -eq "0" ]; then # Signal is used to terminate the program + + # Account for empty pidlist (pid file still exists and no + # signal was given) + if [ "${pidlist}" != "" ]; then + + # Kill the list of pids + for pid in ${pidlist}; do + + kill -0 "${pid}" 2> /dev/null + + if [ "${?}" -ne "0" ]; then + # Process is dead, continue to next and assume all is well + continue + else + kill "${signal}" "${pid}" 2> /dev/null + + # Wait up to ${delay}/10 seconds to for "${pid}" to + # terminate in 10ths of a second + + while [ "${delay}" -ne "0" ]; do + kill -0 "${pid}" 2> /dev/null || piddead="1" + if [ "${piddead}" = "1" ]; then break; fi + sleep 0.1 + delay="$(( ${delay} - 1 ))" + done + + # If a fallback is set, and program is still running, then + # use the fallback + if [ -n "${fallback}" -a "${piddead}" != "1" ]; then + kill "${fallback}" "${pid}" 2> /dev/null + sleep 1 + # Check again, and fail if still running + kill -0 "${pid}" 2> /dev/null && return 1 + fi + fi + done + fi + + # Check for and remove stale PID files. + if [ -z "${pidfile}" ]; then + # Find the basename of $program + prefix=`echo "${program}" | sed 's/[^/]*$//'` + progname=`echo "${program}" | sed "s@${prefix}@@"` + + if [ -e "/run/${progname}.pid" ]; then + rm -f "/run/${progname}.pid" 2> /dev/null + fi + else + if [ -e "${pidfile}" ]; then rm -f "${pidfile}" 2> /dev/null; fi + fi + + # For signals that do not expect a program to exit, simply + # let kill do its job, and evaluate kill's return for value + + else # check_sig_type - signal is not used to terminate program + for pid in ${pidlist}; do + kill "${signal}" "${pid}" + if [ "${?}" -ne "0" ]; then return 1; fi + done + fi +} + +################################################################################ +# pidofproc() # +# Usage: pidofproc [-p pidfile] pathname # +# # +# Purpose: This function returns one or more pid(s) for a particular daemon # +# # +# Inputs: -p pidfile, use the specified pidfile instead of pidof # +# pathname, path to the specified program # +# # +# Return values (as defined by LSB status codes): # +# 0 - Success (PIDs to stdout) # +# 1 - Program is dead, PID file still exists (remaining PIDs output) # +# 3 - Program is not running (no output) # +################################################################################ +pidofproc() +{ + local pidfile + local program + local prefix + local progname + local pidlist + local lpids + local exitstatus="0" + + # Process arguments + while true; do + case "${1}" in + + -p) + pidfile="${2}" + shift 2 + ;; + + *) + program="${1}" + if [ -n "${2}" ]; then + # Too many arguments + # Since this is status, return unknown + return 4 + else + break + fi + ;; + esac + done + + # If a PID file is not specified, try and find one. + if [ -z "${pidfile}" ]; then + # Get the program's basename + prefix=`echo "${program}" | sed 's/[^/]*$//'` + + if [ -z "${prefix}" ]; then + progname="${program}" + else + progname=`echo "${program}" | sed "s@${prefix}@@"` + fi + + # If a PID file exists with that name, assume that is it. + if [ -e "/run/${progname}.pid" ]; then + pidfile="/run/${progname}.pid" + fi + fi + + # If a PID file is set and exists, use it. + if [ -n "${pidfile}" -a -e "${pidfile}" ]; then + + # Use the value in the first line of the pidfile + pidlist=`/bin/head -n1 "${pidfile}"` + # This can optionally be written as 'sed 1q' to repalce 'head -n1' + # should LFS move /bin/head to /usr/bin/head + else + # Use pidof + pidlist=`pidof "${program}"` + fi + + # Figure out if all listed PIDs are running. + for pid in ${pidlist}; do + kill -0 ${pid} 2> /dev/null + + if [ "${?}" -eq "0" ]; then + lpids="${lpids}${pid} " + else + exitstatus="1" + fi + done + + if [ -z "${lpids}" -a ! -f "${pidfile}" ]; then + return 3 + else + echo "${lpids}" + return "${exitstatus}" + fi +} + +################################################################################ +# statusproc() # +# Usage: statusproc [-p pidfile] pathname # +# # +# Purpose: This function prints the status of a particular daemon to stdout # +# # +# Inputs: -p pidfile, use the specified pidfile instead of pidof # +# pathname, path to the specified program # +# # +# Return values: # +# 0 - Status printed # +# 1 - Input error. The daemon to check was not specified. # +################################################################################ +statusproc() +{ + local pidfile + local pidlist + + if [ "${#}" = "0" ]; then + echo "Usage: statusproc [-p pidfle] {program}" + exit 1 + fi + + # Process arguments + while true; do + case "${1}" in + + -p) + pidfile="${2}" + shift 2 + ;; + + *) + if [ -n "${2}" ]; then + echo "Too many arguments" + return 1 + else + break + fi + ;; + esac + done + + if [ -n "${pidfile}" ]; then + pidlist=`pidofproc -p "${pidfile}" $@` + else + pidlist=`pidofproc $@` + fi + + # Trim trailing blanks + pidlist=`echo "${pidlist}" | sed -r 's/ +$//'` + + base="${1##*/}" + + if [ -n "${pidlist}" ]; then + /bin/echo -e "${INFO}${base} is running with Process" \ + "ID(s) ${pidlist}.${NORMAL}" + else + if [ -n "${base}" -a -e "/run/${base}.pid" ]; then + /bin/echo -e "${WARNING}${1} is not running but" \ + "/run/${base}.pid exists.${NORMAL}" + else + if [ -n "${pidfile}" -a -e "${pidfile}" ]; then + /bin/echo -e "${WARNING}${1} is not running" \ + "but ${pidfile} exists.${NORMAL}" + else + /bin/echo -e "${INFO}${1} is not running.${NORMAL}" + fi + fi + fi +} + +################################################################################ +# timespec() # +# # +# Purpose: An internal utility function to format a timestamp # +# a boot log file. Sets the STAMP variable. # +# # +# Return value: Not used # +################################################################################ +timespec() +{ + STAMP="$(echo `date +"%b %d %T %:z"` `hostname`) " + return 0 +} + +################################################################################ +# log_success_msg() # +# Usage: log_success_msg ["message"] # +# # +# Purpose: Print a successful status message to the screen and # +# a boot log file. # +# # +# Inputs: $@ - Message # +# # +# Return values: Not used # +################################################################################ +log_success_msg() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" + + # Strip non-printable characters from log file + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + + timespec + /bin/echo -e "${STAMP} ${logmessage} OK" >> ${BOOTLOG} + + return 0 +} + +log_success_msg2() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${SUCCESS_SUFFIX}" + + echo " OK" >> ${BOOTLOG} + + return 0 +} + +################################################################################ +# log_failure_msg() # +# Usage: log_failure_msg ["message"] # +# # +# Purpose: Print a failure status message to the screen and # +# a boot log file. # +# # +# Inputs: $@ - Message # +# # +# Return values: Not used # +################################################################################ +log_failure_msg() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" + + # Strip non-printable characters from log file + + timespec + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + /bin/echo -e "${STAMP} ${logmessage} FAIL" >> ${BOOTLOG} + + return 0 +} + +log_failure_msg2() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}" + + echo "FAIL" >> ${BOOTLOG} + + return 0 +} + +################################################################################ +# log_warning_msg() # +# Usage: log_warning_msg ["message"] # +# # +# Purpose: Print a warning status message to the screen and # +# a boot log file. # +# # +# Return values: Not used # +################################################################################ +log_warning_msg() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${WARNING_SUFFIX}" + + # Strip non-printable characters from log file + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + timespec + /bin/echo -e "${STAMP} ${logmessage} WARN" >> ${BOOTLOG} + + return 0 +} + +log_skip_msg() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + /bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}" + + # Strip non-printable characters from log file + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + /bin/echo "SKIP" >> ${BOOTLOG} + + return 0 +} + +################################################################################ +# log_info_msg() # +# Usage: log_info_msg message # +# # +# Purpose: Print an information message to the screen and # +# a boot log file. Does not print a trailing newline character. # +# # +# Return values: Not used # +################################################################################ +log_info_msg() +{ + /bin/echo -n -e "${BMPREFIX}${@}" + + # Strip non-printable characters from log file + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + timespec + /bin/echo -n -e "${STAMP} ${logmessage}" >> ${BOOTLOG} + + return 0 +} + +log_info_msg2() +{ + /bin/echo -n -e "${@}" + + # Strip non-printable characters from log file + logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'` + /bin/echo -n -e "${logmessage}" >> ${BOOTLOG} + + return 0 +} + +################################################################################ +# evaluate_retval() # +# Usage: Evaluate a return value and print success or failure as appropriate # +# # +# Purpose: Convenience function to terminate an info message # +# # +# Return values: Not used # +################################################################################ +evaluate_retval() +{ + local error_value="${?}" + + if [ ${error_value} = 0 ]; then + log_success_msg2 + else + log_failure_msg2 + fi +} + +################################################################################ +# check_signal() # +# Usage: check_signal [ -{signal} ] # +# # +# Purpose: Check for a valid signal. This is not defined by any LSB draft, # +# however, it is required to check the signals to determine if the # +# signals chosen are invalid arguments to the other functions. # +# # +# Inputs: Accepts a single string value in the form of -{signal} # +# # +# Return values: # +# 0 - Success (signal is valid # +# 1 - Signal is not valid # +################################################################################ +check_signal() +{ + local valsig + + # Add error handling for invalid signals + valsig=" -ALRM -HUP -INT -KILL -PIPE -POLL -PROF -TERM -USR1 -USR2" + valsig="${valsig} -VTALRM -STKFLT -PWR -WINCH -CHLD -URG -TSTP -TTIN" + valsig="${valsig} -TTOU -STOP -CONT -ABRT -FPE -ILL -QUIT -SEGV -TRAP" + valsig="${valsig} -SYS -EMT -BUS -XCPU -XFSZ -0 -1 -2 -3 -4 -5 -6 -8 -9" + valsig="${valsig} -11 -13 -14 -15 " + + echo "${valsig}" | grep -- " ${1} " > /dev/null + + if [ "${?}" -eq "0" ]; then + return 0 + else + return 1 + fi +} + +################################################################################ +# check_sig_type() # +# Usage: check_signal [ -{signal} | {signal} ] # +# # +# Purpose: Check if signal is a program termination signal or a control signal # +# This is not defined by any LSB draft, however, it is required to # +# check the signals to determine if they are intended to end a # +# program or simply to control it. # +# # +# Inputs: Accepts a single string value in the form or -{signal} or {signal} # +# # +# Return values: # +# 0 - Signal is used for program termination # +# 1 - Signal is used for program control # +################################################################################ +check_sig_type() +{ + local valsig + + # The list of termination signals (limited to generally used items) + valsig=" -ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15 " + + echo "${valsig}" | grep -- " ${1} " > /dev/null + + if [ "${?}" -eq "0" ]; then + return 0 + else + return 1 + fi +} + +################################################################################ +# wait_for_user() # +# # +# Purpose: Wait for the user to respond if not a headless system # +# # +################################################################################ +wait_for_user() +{ + # Wait for the user by default + [ "${HEADLESS=0}" = "0" ] && read ENTER + return 0 +} + +################################################################################ +# is_true() # +# # +# Purpose: Utility to test if a variable is true | yes | 1 # +# # +################################################################################ +is_true() +{ + [ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ] || [ "$1" = "y" ] || + [ "$1" = "t" ] +} + +# End /lib/lsb/init-functions diff --git a/xi/services/ipv4-static b/xi/lib/services/ipv4-static index 51cfa20..7021c29 100755 --- a/xi/services/ipv4-static +++ b/xi/lib/services/ipv4-static @@ -12,21 +12,21 @@ # ######################################################################## -#. /lib/lsb/init-functions +. /lib/lsb/init-functions . ${IFCONFIG} if [ -z "${IP}" ]; then - echo "IP variable missing from ${IFCONFIG}, cannot continue." + log_failure_msg "\nIP variable missing from ${IFCONFIG}, cannot continue." exit 1 fi if [ -z "${PREFIX}" -a -z "${PEER}" ]; then - echo "PREFIX variable missing from ${IFCONFIG}, assuming 24." + log_warning_msg "\nPREFIX variable missing from ${IFCONFIG}, assuming 24." PREFIX=24 args="${args} ${IP}/${PREFIX}" elif [ -n "${PREFIX}" -a -n "${PEER}" ]; then - echo "PREFIX and PEER both specified in ${IFCONFIG}, cannot continue." + log_failure_msg "\nPREFIX and PEER both specified in ${IFCONFIG}, cannot continue." exit 1 elif [ -n "${PREFIX}" ]; then @@ -36,6 +36,10 @@ elif [ -n "${PEER}" ]; then args="${args} ${IP} peer ${PEER}" fi +if [ -n "${LABEL}" ]; then + args="${args} label ${LABEL}" +fi + if [ -n "${BROADCAST}" ]; then args="${args} broadcast ${BROADCAST}" fi @@ -43,33 +47,27 @@ fi case "${2}" in up) if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" = "" ]; then - - # Cosmetic output not needed for multiple services - #if ! $(echo ${SERVICE} | grep -q " "); then - # echo "" # Terminate the previous message - #fi - - echo "Adding IPv4 address ${IP} to the ${1} interface..." + log_info_msg "Adding IPv4 address ${IP} to the ${1} interface..." ip addr add ${args} dev ${1} - #evaluate_retval + evaluate_retval else - echo "Cannot add IPv4 address ${IP} to ${1}. Already present." + log_warning_msg "Cannot add IPv4 address ${IP} to ${1}. Already present." fi ;; down) if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" != "" ]; then - echo "Removing IPv4 address ${IP} from the ${1} interface..." + log_info_msg "Removing IPv4 address ${IP} from the ${1} interface..." ip addr del ${args} dev ${1} - #evaluate_retval + evaluate_retval fi if [ -n "${GATEWAY}" ]; then # Only remove the gateway if there are no remaining ipv4 addresses if [ "$(ip addr show ${1} 2>/dev/null | grep 'inet ')" != "" ]; then - echo "Removing default gateway..." + log_info_msg "Removing default gateway..." ip route del default - #evaluate_retval + evaluate_retval fi fi ;; diff --git a/xi/lib/services/ipv4-static-route b/xi/lib/services/ipv4-static-route new file mode 100755 index 0000000..4db3a5d --- /dev/null +++ b/xi/lib/services/ipv4-static-route @@ -0,0 +1,98 @@ +#!/bin/sh +######################################################################## +# Begin /lib/services/ipv4-static-route +# +# Description : IPV4 Static Route Script +# +# Authors : Kevin P. Fleming - kpfleming@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org +# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# +# Version : LFS 7.0 +# +######################################################################## + +. /lib/lsb/init-functions +. ${IFCONFIG} + +case "${TYPE}" in + ("" | "network") + need_ip=1 + need_gateway=1 + ;; + + ("default") + need_gateway=1 + args="${args} default" + desc="default" + ;; + + ("host") + need_ip=1 + ;; + + ("unreachable") + need_ip=1 + args="${args} unreachable" + desc="unreachable " + ;; + + (*) + log_failure_msg "Unknown route type (${TYPE}) in ${IFCONFIG}, cannot continue." + exit 1 + ;; +esac + +if [ -n "${GATEWAY}" ]; then + MSG="The GATEWAY variable cannot be set in ${IFCONFIG} for static routes.\n" + log_failure_msg "$MSG Use STATIC_GATEWAY only, cannot continue" + exit 1 +fi + +if [ -n "${need_ip}" ]; then + if [ -z "${IP}" ]; then + log_failure_msg "IP variable missing from ${IFCONFIG}, cannot continue." + exit 1 + fi + + if [ -z "${PREFIX}" ]; then + log_failure_msg "PREFIX variable missing from ${IFCONFIG}, cannot continue." + exit 1 + fi + + args="${args} ${IP}/${PREFIX}" + desc="${desc}${IP}/${PREFIX}" +fi + +if [ -n "${need_gateway}" ]; then + if [ -z "${STATIC_GATEWAY}" ]; then + log_failure_msg "STATIC_GATEWAY variable missing from ${IFCONFIG}, cannot continue." + exit 1 + fi + args="${args} via ${STATIC_GATEWAY}" +fi + +if [ -n "${SOURCE}" ]; then + args="${args} src ${SOURCE}" +fi + +case "${2}" in + up) + log_info_msg "Adding '${desc}' route to the ${1} interface..." + ip route add ${args} dev ${1} + evaluate_retval + ;; + + down) + log_info_msg "Removing '${desc}' route from the ${1} interface..." + ip route del ${args} dev ${1} + evaluate_retval + ;; + + *) + echo "Usage: ${0} [interface] {up|down}" + exit 1 + ;; +esac + +# End /lib/services/ipv4-static-route diff --git a/xi/mkinitrd/init.in b/xi/mkinitrd/init.in deleted file mode 100644 index 2466e0d..0000000 --- a/xi/mkinitrd/init.in +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -PATH=/bin:/usr/bin:/sbin:/usr/sbin -export PATH - -problem() -{ - printf "Encountered a problem!\n\nDropping you to a shell.\n\n" - sh -} - -no_device() -{ - printf "The device %s, which is supposed to contain the\n" $1 - printf "root file system, does not exist.\n" - printf "Please fix this problem and exit this shell.\n\n" -} - -no_mount() -{ - printf "Could not mount device %s\n" $1 - printf "Sleeping forever. Please reboot and fix the kernel command line.\n\n" - printf "Maybe the device is formatted with an unsupported file system?\n\n" - printf "Or maybe filesystem type autodetection went wrong, in which case\n" - printf "you should add the rootfstype=... parameter to the kernel command line.\n\n" - printf "Available partitions:\n" -} - -do_mount_root() -{ - mkdir /.root - [ -n "$rootflags" ] && rootflags="$rootflags," - rootflags="$rootflags$ro" - - case "$root" in - /dev/* ) device=$root ;; - UUID=* ) eval $root; device="/dev/disk/by-uuid/$UUID" ;; - LABEL=*) eval $root; device="/dev/disk/by-label/$LABEL" ;; - "" ) echo "No root device specified." ; problem ;; - esac - - while [ ! -b "$device" ] ; do - no_device $device - problem - done - - if ! mount -n -t "$rootfstype" -o "$rootflags" "$device" /.root ; then - no_mount $device - cat /proc/partitions - while true ; do sleep 10000 ; done - else - echo "Successfully mounted device $root" - fi -} - -init=/sbin/init -root= -rootdelay= -rootfstype=auto -ro="ro" -rootflags= -device= - -mount -n -t devtmpfs devtmpfs /dev -mount -n -t proc proc /proc -mount -n -t sysfs sysfs /sys -mount -n -t tmpfs tmpfs /run - -read -r cmdline < /proc/cmdline - -for param in $cmdline ; do - case $param in - init=* ) init=${param#init=} ;; - root=* ) root=${param#root=} ;; - rootdelay=* ) rootdelay=${param#rootdelay=} ;; - rootfstype=*) rootfstype=${param#rootfstype=} ;; - rootflags=* ) rootflags=${param#rootflags=} ;; - ro ) ro="ro" ;; - rw ) ro="rw" ;; - esac -done - -# udevd location depends on version -if [ -x /sbin/udevd ]; then - UDEVD=/sbin/udevd -elif [ -x /lib/udev/udevd ]; then - UDEVD=/lib/udev/udevd -elif [ -x /lib/systemd/systemd-udevd ]; then - UDEVD=/lib/systemd/systemd-udevd -else - echo "Cannot find udevd nor systemd-udevd" - problem -fi - -${UDEVD} --daemon --resolve-names=never -udevadm trigger -udevadm settle - -if [ -f /etc/mdadm.conf ] ; then mdadm -As ; fi -if [ -x /sbin/vgchange ] ; then /sbin/vgchange -a y > /dev/null ; fi -if [ -n "$rootdelay" ] ; then sleep "$rootdelay" ; fi - -do_mount_root - -killall -w ${UDEVD##*/} - -exec switch_root /.root "$init" "$@" - diff --git a/xi/mkinitrd/mkinitramfs b/xi/mkinitrd/mkinitramfs deleted file mode 100755 index 952de75..0000000 --- a/xi/mkinitrd/mkinitramfs +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/bash -# This file based in part on the mkinitramfs script for the LFS LiveCD -# written by Alexander E. Patrakov and Jeremy Huntwork. - -copy() -{ - local file - - if [ "$2" == "lib" ]; then - file=$(PATH=/lib:/usr/lib type -p $1) - else - file=$(type -p $1) - fi - - if [ -n $file ] ; then - cp $file $WDIR/$2 - else - echo "Missing required file: $1 for directory $2" - rm -rf $WDIR - exit 1 - fi -} - -if [ -z $1 ] ; then - INITRAMFS_FILE=initrd.img-no-kmods -else - KERNEL_VERSION=$1 - INITRAMFS_FILE=initrd.img-$KERNEL_VERSION -fi - -if [ -n "$KERNEL_VERSION" ] && [ ! -d "/lib/modules/$1" ] ; then - echo "No modules directory named $1" - exit 1 -fi - -printf "Creating $INITRAMFS_FILE... " - -binfiles="sh cat cp dd killall ls mkdir mknod mount " -binfiles="$binfiles umount sed sleep ln rm uname" -binfiles="$binfiles readlink basename" - -# Systemd installs udevadm in /bin. Other udev implementations have it in /sbin -if [ -x /bin/udevadm ] ; then binfiles="$binfiles udevadm"; fi - -sbinfiles="modprobe blkid switch_root" - -#Optional files and locations -for f in mdadm mdmon udevd udevadm; do - if [ -x /sbin/$f ] ; then sbinfiles="$sbinfiles $f"; fi -done - -unsorted=$(mktemp /tmp/unsorted.XXXXXXXXXX) - -DATADIR=/usr/share/mkinitramfs -INITIN=/usr/share/init.in - -# Create a temporary working directory -WDIR=$(mktemp -d /tmp/initrd-work.XXXXXXXXXX) - -# Create base directory structure -mkdir -p $WDIR/{bin,dev,lib/firmware,run,sbin,sys,proc,usr} -mkdir -p $WDIR/etc/{modprobe.d,udev/rules.d} -touch $WDIR/etc/modprobe.d/modprobe.conf -ln -s lib $WDIR/lib64 -ln -s ../bin $WDIR/usr/bin - -# Create necessary device nodes -mknod -m 640 $WDIR/dev/console c 5 1 -mknod -m 664 $WDIR/dev/null c 1 3 - -# Install the udev configuration files -if [ -f /etc/udev/udev.conf ]; then - cp /etc/udev/udev.conf $WDIR/etc/udev/udev.conf -fi - -for file in $(find /etc/udev/rules.d/ -type f) ; do - cp $file $WDIR/etc/udev/rules.d -done - -# Install any firmware present -cp -a /lib/firmware $WDIR/lib - -# Copy the RAID configuration file if present -if [ -f /etc/mdadm.conf ] ; then - cp /etc/mdadm.conf $WDIR/etc -fi - -# Install the init file -install -m0755 $DATADIR/$INITIN $WDIR/init - -if [ -n "$KERNEL_VERSION" ] ; then - if [ -x /bin/kmod ] ; then - binfiles="$binfiles kmod" - else - binfiles="$binfiles lsmod" - sbinfiles="$sbinfiles insmod" - fi -fi - -# Install basic binaries -for f in $binfiles ; do - if [ -e /bin/$f ]; then d="/bin"; else d="/usr/bin"; fi - ldd $d/$f | sed "s/\t//" | cut -d " " -f1 >> $unsorted - copy $d/$f bin -done - -# Add lvm if present -if [ -x /sbin/lvm ] ; then sbinfiles="$sbinfiles lvm dmsetup"; fi - -for f in $sbinfiles ; do - ldd /sbin/$f | sed "s/\t//" | cut -d " " -f1 >> $unsorted - copy $f sbin -done - -# Add udevd libraries if not in /sbin -if [ -x /lib/udev/udevd ] ; then - ldd /lib/udev/udevd | sed "s/\t//" | cut -d " " -f1 >> $unsorted -elif [ -x /lib/systemd/systemd-udevd ] ; then - ldd /lib/systemd/systemd-udevd | sed "s/\t//" | cut -d " " -f1 >> $unsorted -fi - -# Add module symlinks if appropriate -if [ -n "$KERNEL_VERSION" ] && [ -x /bin/kmod ] ; then - ln -s kmod $WDIR/bin/lsmod - ln -s kmod $WDIR/bin/insmod -fi - -# Add lvm symlinks if appropriate -# Also copy the lvm.conf file -if [ -x /sbin/lvm ] ; then - ln -s lvm $WDIR/sbin/lvchange - ln -s lvm $WDIR/sbin/lvrename - ln -s lvm $WDIR/sbin/lvextend - ln -s lvm $WDIR/sbin/lvcreate - ln -s lvm $WDIR/sbin/lvdisplay - ln -s lvm $WDIR/sbin/lvscan - - ln -s lvm $WDIR/sbin/pvchange - ln -s lvm $WDIR/sbin/pvck - ln -s lvm $WDIR/sbin/pvcreate - ln -s lvm $WDIR/sbin/pvdisplay - ln -s lvm $WDIR/sbin/pvscan - - ln -s lvm $WDIR/sbin/vgchange - ln -s lvm $WDIR/sbin/vgcreate - ln -s lvm $WDIR/sbin/vgscan - ln -s lvm $WDIR/sbin/vgrename - ln -s lvm $WDIR/sbin/vgck - # Conf file(s) - cp -a /etc/lvm $WDIR/etc -fi - -# Install libraries -sort $unsorted | uniq | while read library ; do - if [ "$library" == "linux-vdso.so.1" ] || - [ "$library" == "linux-gate.so.1" ]; then - continue - fi - - copy $library lib -done - -if [ -d /lib/udev ]; then - cp -a /lib/udev $WDIR/lib -fi -if [ -d /lib/systemd ]; then - cp -a /lib/systemd $WDIR/lib -fi - -# Install the kernel modules if requested -if [ -n "$KERNEL_VERSION" ]; then - find \ - /lib/modules/$KERNEL_VERSION/kernel/{crypto,fs,lib} \ - /lib/modules/$KERNEL_VERSION/kernel/drivers/{block,ata,md,firewire} \ - /lib/modules/$KERNEL_VERSION/kernel/drivers/{scsi,message,pcmcia,virtio} \ - /lib/modules/$KERNEL_VERSION/kernel/drivers/usb/{host,storage} \ - -type f 2> /dev/null | cpio --make-directories -p --quiet $WDIR - - cp /lib/modules/$KERNEL_VERSION/modules.{builtin,order} \ - $WDIR/lib/modules/$KERNEL_VERSION - - depmod -b $WDIR $KERNEL_VERSION -fi - -( cd $WDIR ; find . | cpio -o -H newc --quiet | gzip -9 ) > $INITRAMFS_FILE - -# Remove the temporary directory and file -rm -rf $WDIR $unsorted -printf "done.\n" - diff --git a/xi/s6/base/bin/halt b/xi/s6/base/bin/halt deleted file mode 100755 index a2c7938..0000000 --- a/xi/s6/base/bin/halt +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init-hpr -h $@ diff --git a/xi/s6/base/bin/init b/xi/s6/base/bin/init deleted file mode 100755 index 278e493..0000000 --- a/xi/s6/base/bin/init +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init -c "/etc/s6/base" -m 0022 -p "/bin:/sbin:/usr/bin" -D "default" -- "$@" diff --git a/xi/s6/base/bin/poweroff b/xi/s6/base/bin/poweroff deleted file mode 100755 index 8177a96..0000000 --- a/xi/s6/base/bin/poweroff +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init-hpr -p $@ diff --git a/xi/s6/base/bin/reboot b/xi/s6/base/bin/reboot deleted file mode 100755 index 8e82d11..0000000 --- a/xi/s6/base/bin/reboot +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init-hpr -r $@ diff --git a/xi/s6/base/bin/shutdown b/xi/s6/base/bin/shutdown deleted file mode 100755 index 6c1b0c3..0000000 --- a/xi/s6/base/bin/shutdown +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init-shutdown $@ diff --git a/xi/s6/base/bin/telinit b/xi/s6/base/bin/telinit deleted file mode 100755 index 823def0..0000000 --- a/xi/s6/base/bin/telinit +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -S0 - -s6-linux-init-telinit $@ diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGHUP b/xi/s6/base/run-image/service/.s6-svscan/SIGHUP deleted file mode 100755 index 130ab12..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGHUP +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P - diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGINT b/xi/s6/base/run-image/service/.s6-svscan/SIGINT deleted file mode 100755 index 9a7eeaf..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGINT +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -s6-linux-init-shutdown -a -r -- now diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGPWR b/xi/s6/base/run-image/service/.s6-svscan/SIGPWR deleted file mode 100755 index bc55899..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGPWR +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -s6-linux-init-shutdown -a -p -- now diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGQUIT b/xi/s6/base/run-image/service/.s6-svscan/SIGQUIT deleted file mode 100755 index 130ab12..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGQUIT +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P - diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGTERM b/xi/s6/base/run-image/service/.s6-svscan/SIGTERM deleted file mode 100755 index 130ab12..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGTERM +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P - diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGUSR1 b/xi/s6/base/run-image/service/.s6-svscan/SIGUSR1 deleted file mode 100755 index bc55899..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGUSR1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -s6-linux-init-shutdown -a -p -- now diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGUSR2 b/xi/s6/base/run-image/service/.s6-svscan/SIGUSR2 deleted file mode 100755 index 5bbca00..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGUSR2 +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -s6-linux-init-shutdown -a -h -- now diff --git a/xi/s6/base/run-image/service/.s6-svscan/SIGWINCH b/xi/s6/base/run-image/service/.s6-svscan/SIGWINCH deleted file mode 100755 index 130ab12..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/SIGWINCH +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P - diff --git a/xi/s6/base/run-image/service/.s6-svscan/crash b/xi/s6/base/run-image/service/.s6-svscan/crash deleted file mode 100755 index e5a9440..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/crash +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P - -redirfd -w 2 /dev/console -fdmove -c 1 2 -foreground { s6-linux-init-echo -- "s6-svscan crashed. Rebooting." } -s6-linux-init-hpr -fr diff --git a/xi/s6/base/run-image/service/.s6-svscan/finish b/xi/s6/base/run-image/service/.s6-svscan/finish deleted file mode 100755 index ad17596..0000000 --- a/xi/s6/base/run-image/service/.s6-svscan/finish +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P - -redirfd -w 2 /dev/console -fdmove -c 1 2 -foreground { s6-linux-init-echo -- "s6-svscan exited. Rebooting." } -s6-linux-init-hpr -fr diff --git a/xi/s6/base/run-image/service/s6-linux-init-early-getty/run b/xi/s6/base/run-image/service/s6-linux-init-early-getty/run deleted file mode 100755 index 646423b..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-early-getty/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -/sbin/agetty -L -8 tty1 115200 diff --git a/xi/s6/base/run-image/service/s6-linux-init-logouthookd/notification-fd b/xi/s6/base/run-image/service/s6-linux-init-logouthookd/notification-fd deleted file mode 100644 index d00491f..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-logouthookd/notification-fd +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/xi/s6/base/run-image/service/s6-linux-init-logouthookd/run b/xi/s6/base/run-image/service/s6-linux-init-logouthookd/run deleted file mode 100755 index 9698c56..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-logouthookd/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/execlineb -P - -s6-ipcserver -1 -a 0700 -c 1000 -C 1000 -- s -s6-linux-init-logouthookd diff --git a/xi/s6/base/run-image/service/s6-linux-init-runleveld/notification-fd b/xi/s6/base/run-image/service/s6-linux-init-runleveld/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-runleveld/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/base/run-image/service/s6-linux-init-runleveld/run b/xi/s6/base/run-image/service/s6-linux-init-runleveld/run deleted file mode 100755 index 1196d8d..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-runleveld/run +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/execlineb -P - -fdmove -c 2 1 -fdmove 1 3 -s6-ipcserver -1 -a 0700 -c 1 -- s -s6-sudod -dt30000 -- -"/etc/s6/base"/scripts/runlevel diff --git a/xi/s6/base/run-image/service/s6-linux-init-shutdownd/run b/xi/s6/base/run-image/service/s6-linux-init-shutdownd/run deleted file mode 100755 index 8258d75..0000000 --- a/xi/s6/base/run-image/service/s6-linux-init-shutdownd/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P - -s6-linux-init-shutdownd -c "/etc/s6/base" -g 3000 diff --git a/xi/s6/base/run-image/service/s6-svscan-log/notification-fd b/xi/s6/base/run-image/service/s6-svscan-log/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/base/run-image/service/s6-svscan-log/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/base/run-image/service/s6-svscan-log/run b/xi/s6/base/run-image/service/s6-svscan-log/run deleted file mode 100755 index 7028d1b..0000000 --- a/xi/s6/base/run-image/service/s6-svscan-log/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P - -redirfd -w 1 /dev/null -redirfd -rnb 0 fifo -s6-log -bpd3 -- T /run/uncaught-logs diff --git a/xi/s6/base/run-image/service/utmpd/notification-fd b/xi/s6/base/run-image/service/utmpd/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/base/run-image/service/utmpd/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/base/run-image/service/utmpd/run b/xi/s6/base/run-image/service/utmpd/run deleted file mode 100755 index 35c60c5..0000000 --- a/xi/s6/base/run-image/service/utmpd/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/execlineb -P - -fdmove -c 2 1 -s6-setuidgid "utmp" -cd /run/utmps -fdmove 1 3 -s6-ipcserver -1 -c 1000 -- /run/utmps/.utmpd-socket -utmps-utmpd diff --git a/xi/s6/base/run-image/service/wtmpd/notification-fd b/xi/s6/base/run-image/service/wtmpd/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/base/run-image/service/wtmpd/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/base/run-image/service/wtmpd/run b/xi/s6/base/run-image/service/wtmpd/run deleted file mode 100755 index 79815bb..0000000 --- a/xi/s6/base/run-image/service/wtmpd/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/execlineb -P - -fdmove -c 2 1 -s6-setuidgid "utmp" -cd /run/utmps -fdmove 1 3 -s6-ipcserver -1 -c 1000 -- /run/utmps/.wtmpd-socket -utmps-wtmpd diff --git a/xi/s6/base/scripts/rc.init b/xi/s6/base/scripts/rc.init deleted file mode 100755 index 56c3e7b..0000000 --- a/xi/s6/base/scripts/rc.init +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -e - -rl="$1" -shift - -### argv now contains the arguments of the kernel command line that are -### not of the form key=value. (The key=value arguments were stored by -### s6-linux-init into an envdir, if instructed so via the -s option.) -### Normally this argv remains unused because programs that need the -### kernel command line usually read it later on from /proc/cmdline - -### but just in case, it's available here. - - -### 1. Early preparation -### This is done only once at boot time. -### Ideally, this phase should just initialize the service manager. - -### If your services are managed by sysv-rc: -# /etc/init.d/rcS - -### If your services are managed by OpenRC: -# /sbin/openrc sysinit -# /sbin/openrc boot - -### If your services are managed by s6-rc: -### (replace /run/service with your scandir) -s6-rc-init -c /etc/s6/db/current /run/service - - -### 2. Starting the wanted set of services -### This is also called every time you change runlevels with telinit. -### (edit the location to suit your installation) -### By default, $rl is the string "default", unless you changed it -### via the -D option to s6-linux-init-maker. -### Numeric arguments from 1 to 5 on the kernel command line will -### override the default. - -exec /etc/s6/base/scripts/runlevel "$rl" - - -### If this script is run in a container, then 1. and 2. above do not -### apply and you should just call your CMD, if any, or let your -### services run. -### Something like this: - -# if test -z "$*" ; then return 0 ; fi -# $@ -# echo $? > /run/s6-linux-init-container-results/exitcode -# halt diff --git a/xi/s6/base/scripts/rc.shutdown b/xi/s6/base/scripts/rc.shutdown deleted file mode 100755 index f759ba7..0000000 --- a/xi/s6/base/scripts/rc.shutdown +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -e - -### Things to do before hardware halt/reboot/poweroff. -### Ideally, it should be a single call to the service manager, -### telling it to bring all the services down. - -### If your s6-linux-init-maker invocation was made with the -1 -### option, messages from rc.shutdown will appear on /dev/console -### as well as be logged by the catch-all logger. -### If your s6-linux-init-maker invocation did NOT include the -1 -### option, messages from rc.shutdown will only be logged by the -### catch-all logger and will NOT appear on /dev/console. In order -### to print them to /dev/console instead, you may want to -### uncomment the following line: -exec >/dev/console 2>&1 - -### If your services are managed by sysv-rc: -### also remove the K11reboot link from /etc/rc6.d to prevent -### sysv-rc from rebooting prematurely - because sysvinit does -### not properly separate state changes from system init/shutdown. -# exec /etc/init.d/rc 6 - -### If your services are managed by OpenRC: -### also remove the "killprocs" and "mount-ro" symlinks from -### /etc/runlevels/shutdown - because OpenRC does not properly -### separate the service manager from the shutdown manager either. -# exec /sbin/openrc shutdown - -### If your services are managed by s6-rc: -exec s6-rc -v2 -bda change diff --git a/xi/s6/base/scripts/rc.shutdown.final b/xi/s6/base/scripts/rc.shutdown.final deleted file mode 100755 index 3f46b87..0000000 --- a/xi/s6/base/scripts/rc.shutdown.final +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -e - -### Things to do *right before* the machine gets rebooted or -### powered off, at the very end of the shutdown sequence, -### when all the filesystems are unmounted. - -### This is a last resort hook; normally nothing should be -### done here (your rc.shutdown script should have taken care -### of everything) and you should leave this script empty. - -### Some distributions, however, may need to perform some -### actions after unmounting the filesystems: typically if -### an additional teardown action is required on a filesystem -### after unmounting it, or if the system needs to be -### pivot_rooted before it can be shut down, etc. - -### Those are all exceptional cases. If you don't know for -### certain that you need to do something here, you don't. diff --git a/xi/s6/base/scripts/runlevel b/xi/s6/base/scripts/runlevel deleted file mode 100755 index d266171..0000000 --- a/xi/s6/base/scripts/runlevel +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -e - -### This script is called once at boot time by rc.init, and is -### also called by the runleveld service every time the user -### requests a machine state change via telinit. -### Ideally, it should just be a call to the service manager. - -test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; } - - -### If your services are managed by sysv-rc: -# exec /etc/init.d/rc "$1" - -### If your services are managed by OpenRC: -# exec /sbin/openrc "$1" - -### If your services are managed by s6-rc: -exec s6-rc -v2 -up change "$1" diff --git a/xi/s6/db/basic/db b/xi/s6/db/basic/db Binary files differdeleted file mode 100644 index e85e344..0000000 --- a/xi/s6/db/basic/db +++ /dev/null diff --git a/xi/s6/db/basic/lock b/xi/s6/db/basic/lock deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/db/basic/lock +++ /dev/null diff --git a/xi/s6/db/basic/n b/xi/s6/db/basic/n Binary files differdeleted file mode 100644 index 806eabf..0000000 --- a/xi/s6/db/basic/n +++ /dev/null diff --git a/xi/s6/db/basic/resolve.cdb b/xi/s6/db/basic/resolve.cdb Binary files differdeleted file mode 100644 index 62fe7a8..0000000 --- a/xi/s6/db/basic/resolve.cdb +++ /dev/null diff --git a/xi/s6/db/basic/servicedirs/agetty2/run b/xi/s6/db/basic/servicedirs/agetty2/run deleted file mode 100755 index 6562e22..0000000 --- a/xi/s6/db/basic/servicedirs/agetty2/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -exec /sbin/agetty -L -8 tty2 115200 diff --git a/xi/s6/db/basic/servicedirs/agetty3/run b/xi/s6/db/basic/servicedirs/agetty3/run deleted file mode 100755 index a6117c5..0000000 --- a/xi/s6/db/basic/servicedirs/agetty3/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -exec /sbin/agetty -L -8 tty3 115200 diff --git a/xi/s6/db/basic/servicedirs/agetty4/run b/xi/s6/db/basic/servicedirs/agetty4/run deleted file mode 100755 index 1176c91..0000000 --- a/xi/s6/db/basic/servicedirs/agetty4/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -exec /sbin/agetty -L -8 tty4 115200 diff --git a/xi/s6/db/basic/servicedirs/agetty5/run b/xi/s6/db/basic/servicedirs/agetty5/run deleted file mode 100755 index c720902..0000000 --- a/xi/s6/db/basic/servicedirs/agetty5/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -exec /sbin/agetty -L -8 tty5 115200 diff --git a/xi/s6/db/basic/servicedirs/agetty6/run b/xi/s6/db/basic/servicedirs/agetty6/run deleted file mode 100755 index 9d0fc1a..0000000 --- a/xi/s6/db/basic/servicedirs/agetty6/run +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/execlineb -P -exec /sbin/agetty -L -8 tty6 115200 diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/autofilled b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/autofilled deleted file mode 100644 index 5a7694f..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/autofilled +++ /dev/null @@ -1 +0,0 @@ -udevd-log diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/allow b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/allow deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/allow +++ /dev/null diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/env b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/env deleted file mode 120000 index dbe1277..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/gid/0/env +++ /dev/null @@ -1 +0,0 @@ -../../uid/0/env
\ No newline at end of file diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/allow b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/allow deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/allow +++ /dev/null diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_GETDUMP b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_GETDUMP deleted file mode 100644 index 8b13789..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_GETDUMP +++ /dev/null @@ -1 +0,0 @@ - diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_LIST b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_LIST deleted file mode 100644 index 8b13789..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_LIST +++ /dev/null @@ -1 +0,0 @@ - diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_RETRIEVE_REGEX b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_RETRIEVE_REGEX deleted file mode 120000 index 8534683..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_RETRIEVE_REGEX +++ /dev/null @@ -1 +0,0 @@ -S6_FDHOLDER_STORE_REGEX
\ No newline at end of file diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_SETDUMP b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_SETDUMP deleted file mode 100644 index 8b13789..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_SETDUMP +++ /dev/null @@ -1 +0,0 @@ - diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_STORE_REGEX b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_STORE_REGEX deleted file mode 100644 index d1e45dc..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/0/env/S6_FDHOLDER_STORE_REGEX +++ /dev/null @@ -1 +0,0 @@ -^pipe:s6rc- diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/self b/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/self deleted file mode 120000 index c227083..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/data/rules/uid/self +++ /dev/null @@ -1 +0,0 @@ -0
\ No newline at end of file diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/notification-fd b/xi/s6/db/basic/servicedirs/s6rc-fdholder/notification-fd deleted file mode 100644 index d00491f..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/notification-fd +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/xi/s6/db/basic/servicedirs/s6rc-fdholder/run b/xi/s6/db/basic/servicedirs/s6rc-fdholder/run deleted file mode 100755 index 0a400c7..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-fdholder/run +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/execlineb -P -pipeline -dw -- -{ - if -n -- - { - forstdin -x 1 -- i - exit 1 - } - if -nt -- - { - redirfd -r 0 ./data/autofilled - s6-ipcclient -l0 -- s - /lib/s6-rc/s6-rc-fdholder-filler -1 -- - } - s6-svc -t . -} -s6-fdholder-daemon -1 -i data/rules -- s diff --git a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/gid/0/allow b/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/gid/0/allow deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/gid/0/allow +++ /dev/null diff --git a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/0/allow b/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/0/allow deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/0/allow +++ /dev/null diff --git a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/self b/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/self deleted file mode 120000 index c227083..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/data/rules/uid/self +++ /dev/null @@ -1 +0,0 @@ -0
\ No newline at end of file diff --git a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/notification-fd b/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/run b/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/run deleted file mode 100755 index d819a25..0000000 --- a/xi/s6/db/basic/servicedirs/s6rc-oneshot-runner/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/execlineb -P -fdmove -c 2 1 -fdmove 1 3 -s6-ipcserver-socketbinder -- s -s6-ipcserverd -1 -- -s6-ipcserver-access -v0 -E -l0 -i data/rules -- -s6-sudod -t 30000 -- -/lib/s6-rc/s6-rc-oneshot-run -l ../.. -- diff --git a/xi/s6/db/basic/servicedirs/udevd-log/notification-fd b/xi/s6/db/basic/servicedirs/udevd-log/notification-fd deleted file mode 100644 index 00750ed..0000000 --- a/xi/s6/db/basic/servicedirs/udevd-log/notification-fd +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/xi/s6/db/basic/servicedirs/udevd-log/run b/xi/s6/db/basic/servicedirs/udevd-log/run deleted file mode 100755 index a8ac83f..0000000 --- a/xi/s6/db/basic/servicedirs/udevd-log/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -s6-fdholder-retrieve ../s6rc-fdholder/s "pipe:s6rc-r-udevd-log" -./run.user diff --git a/xi/s6/db/basic/servicedirs/udevd-log/run.user b/xi/s6/db/basic/servicedirs/udevd-log/run.user deleted file mode 100755 index 0bf9ad7..0000000 --- a/xi/s6/db/basic/servicedirs/udevd-log/run.user +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P -foreground { if -n -t { test -d /var/log/udevd } install -d -m 0755 -o s6log -g s6log /var/log/udevd } -envfile /etc/s6/sv/udevd-log/conf -importas -sCiu DIRECTIVES DIRECTIVES -s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/udevd diff --git a/xi/s6/db/basic/servicedirs/udevd-srv/run b/xi/s6/db/basic/servicedirs/udevd-srv/run deleted file mode 100755 index f5f8202..0000000 --- a/xi/s6/db/basic/servicedirs/udevd-srv/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P -fdmove 1 0 -s6-fdholder-retrieve ../s6rc-fdholder/s "pipe:s6rc-w-udevd-log" -fdswap 0 1 -./run.user diff --git a/xi/s6/db/basic/servicedirs/udevd-srv/run.user b/xi/s6/db/basic/servicedirs/udevd-srv/run.user deleted file mode 100755 index fea1782..0000000 --- a/xi/s6/db/basic/servicedirs/udevd-srv/run.user +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P -# Initiate udev -fdmove -c 2 1 -if { s6-echo -- "[ udev-daemon ] 1/1 : Starting udev..." } -exec -c -udevd diff --git a/xi/s6/db/current b/xi/s6/db/current deleted file mode 120000 index 5dc1ed1..0000000 --- a/xi/s6/db/current +++ /dev/null @@ -1 +0,0 @@ -/etc/s6/db/basic
\ No newline at end of file diff --git a/xi/s6/rc.local b/xi/s6/rc.local deleted file mode 100644 index c266bff..0000000 --- a/xi/s6/rc.local +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# -# Enter custom commands here. By default, they will be executed on startup with the -# "boot" bundle before running services. If you need these commands to wait on certain -# services being up, you can edit the /etc/s6/sv/rc-local/dependencies file and then -# recompile the database. diff --git a/xi/s6/s6.conf b/xi/s6/s6.conf deleted file mode 100644 index 6f8ed19..0000000 --- a/xi/s6/s6.conf +++ /dev/null @@ -1,37 +0,0 @@ -# /etc/s6/s6.conf - system configuration - -# Set HARDWARECLOCK to UTC if your Hardware Clock is set to UTC (also known as -# Greenwich Mean Time). If that clock is set to the local time, then -# set HARDWARECLOCK to localtime. Note that if you dual boot with Windows, then -# you should set it to localtime. - -HARDWARECLOCK=localtime - -# cgroups mode -# legacy mounts cgroups version 1 on /sys/fs/cgroup -# unified mounts cgroups version 2 on /sys/fs/cgroup -# hybrid mounts cgroups version 2 on /sys/fs/cgroup/unified and -# cgroups version 1 on /sys/fs/cgroup - -CGROUP_MODE=hybrid - -# This is a list of controllers which should be enabled for cgroups version 2. -# If hybrid mode is being used, controllers listed here will not be -# available for cgroups version 1. none means no controllers will be used -# For none, put "" - -CGROUP_CONTROLLERS="" - -# This switch controls whether or not cgroups version 1 controllers are -# individually mounted under -# /sys/fs/cgroup in hybrid or legacy mode - -HAVE_CONTROLLER1_GROUPS=true - -# Which gettys to enable by default. Only tty2 - tty6 are valid (tty1 is provided -# by s6-linux-init). Note that every value must be separated by a space. -#GETTYS="tty2 tty3 tty4 tty5 tty6" -# **Option is broken** - -# Force the root filesystem to be checked at (every) boot -FORCECHECK=no diff --git a/xi/s6/scripts/clean_tmp.sh b/xi/s6/scripts/clean_tmp.sh deleted file mode 100755 index 44cbd48..0000000 --- a/xi/s6/scripts/clean_tmp.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -cd /tmp && find . -xdev -mindepth 1 ! -name lost+found -delete diff --git a/xi/s6/scripts/console_set.sh b/xi/s6/scripts/console_set.sh deleted file mode 100755 index 9c0e9f3..0000000 --- a/xi/s6/scripts/console_set.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -[ -r /etc/vconsole.conf ] && . /etc/vconsole.conf -TTYS=${TTYS:-6} -_index=0 -while [ ${_index} -le $TTYS ]; do - if [ -n "$FONT" ]; then - setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} \ - $FONT -C "/dev/tty${_index}" - fi - printf "\033%s" "%G" >/dev/tty${_index} - _index=$((_index + 1)) -done -if [ -n "$KEYMAP" ]; then - loadkeys -q -u ${KEYMAP} -fi diff --git a/xi/s6/scripts/mount-cgroups b/xi/s6/scripts/mount-cgroups deleted file mode 100755 index fd711a0..0000000 --- a/xi/s6/scripts/mount-cgroups +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh - -CGROUP_OPTS=nodev,noexec,nosuid -CGROUP_MODE=$1 -CGROUP_CONTROLLERS=$2 -HAVE_CONTROLLER1_GROUPS=$3 - -#if [ $CGROUP_CONTROLLERS = "none" ]; then -# CGROUP_CONTROLLERS="" -#fi - -cgroup2_find_path() { - if grep -qw cgroup2 /proc/filesystems; then - case "${CGROUP_MODE}" in - hybrid) printf "/sys/fs/cgroup/unified" ;; - unified) printf "/sys/fs/cgroup" ;; - esac - fi - return 0 -} - -cgroup1_base() { - grep -qw cgroup /proc/filesystems || return 0 - if ! mountpoint -q /sys/fs/cgroup; then - local opts="${CGROUP_OPTS},mode=755,size=${rc_cgroupsize:-10m}" - mount -n -t tmpfs -o "${opts}" cgroup_root /sys/fs/cgroup - fi - - if ! mountpoint -q /sys/fs/cgroup/openrc; then - local agent="/etc/s6/sv/mount-cgroups/cgroup-release-agent.sh" - mkdir /sys/fs/cgroup/openrc - mount -n -t cgroup -o none,${CGROUP_OPTS},name=openrc,release_agent="$agent" openrc /sys/fs/cgroup/openrc - printf 1 > /sys/fs/cgroup/openrc/notify_on_release - fi - return 0 -} - -cgroup1_controllers() { - ${HAVE_CONTROLLER1_GROUPS} && [ -e /proc/cgroups ] && grep -qw cgroup /proc/filesystems || return 0 - while read -r name _ _ enabled _; do - case "${enabled}" in - 1) if mountpoint -q "/sys/fs/cgroup/${name}";then continue;fi - local x - for x in $CGROUP_CONTROLLERS; do - [ "${name}" = "blkio" ] && [ "${x}" = "io" ] && - continue 2 - [ "${name}" = "${x}" ] && - continue 2 - done - mkdir "/sys/fs/cgroup/${name}" - mount -n -t cgroup -o "${CGROUP_OPTS},${name}" "${name}" "/sys/fs/cgroup/${name}" - ;; - esac - done < /proc/cgroups - return 0 -} - -cgroup2_base() { - grep -qw cgroup2 /proc/filesystems || return 0 - local base - base="$(cgroup2_find_path)" - mkdir -p "${base}" - mount -t cgroup2 none -o "${CGROUP_OPTS},nsdelegate" "${base}" 2> /dev/null || - mount -t cgroup2 none -o "${CGROUP_OPTS}" "${base}" - return 0 -} - -cgroup2_controllers() { - grep -qw cgroup2 /proc/filesystems || return 0 - local active cgroup_path x y - cgroup_path="$(cgroup2_find_path)" - [ -z "${cgroup_path}" ] && return 0 - [ -e "${cgroup_path}/cgroup.controllers" ] && read -r active < "${cgroup_path}/cgroup.controllers" - for x in ${CGROUP_CONTROLLERS}; do - for y in ${active}; do - [ "$x" = "$y" ] && [ -e "${cgroup_path}/cgroup.subtree_control" ] && - echo "+${x}" > "${cgroup_path}/cgroup.subtree_control" - done - done - return 0 -} - -cgroups_hybrid() { - cgroup1_base - cgroup2_base - cgroup2_controllers - cgroup1_controllers - return 0 -} - -cgroups_legacy() { - cgroup1_base - cgroup1_controllers - return 0 -} - -cgroups_unified() { - cgroup2_base - cgroup2_controllers - return 0 -} - -mount_cgroups() { - case "${CGROUP_MODE}" in - hybrid) cgroups_hybrid ;; - legacy) cgroups_legacy ;; - unified) cgroups_unified ;; - esac - return 0 -} - -mount_cgs() { - if [ -d /sys/fs/cgroup ];then - mount_cgroups - return 0 - fi - return 1 -} - -mount_cgs diff --git a/xi/s6/skel/rc.init b/xi/s6/skel/rc.init deleted file mode 100644 index b467448..0000000 --- a/xi/s6/skel/rc.init +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -e - -rl="$1" -shift - -s6-rc-init -c /etc/s6/db/current /run/service - -exec /etc/s6/base/scripts/runlevel "$rl" - diff --git a/xi/s6/skel/rc.shutdown b/xi/s6/skel/rc.shutdown deleted file mode 100644 index bc5771d..0000000 --- a/xi/s6/skel/rc.shutdown +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -e - -exec s6-rc -bda change diff --git a/xi/s6/skel/rc.shutdown.final b/xi/s6/skel/rc.shutdown.final deleted file mode 100644 index 3f46b87..0000000 --- a/xi/s6/skel/rc.shutdown.final +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -e - -### Things to do *right before* the machine gets rebooted or -### powered off, at the very end of the shutdown sequence, -### when all the filesystems are unmounted. - -### This is a last resort hook; normally nothing should be -### done here (your rc.shutdown script should have taken care -### of everything) and you should leave this script empty. - -### Some distributions, however, may need to perform some -### actions after unmounting the filesystems: typically if -### an additional teardown action is required on a filesystem -### after unmounting it, or if the system needs to be -### pivot_rooted before it can be shut down, etc. - -### Those are all exceptional cases. If you don't know for -### certain that you need to do something here, you don't. diff --git a/xi/s6/skel/runlevel b/xi/s6/skel/runlevel deleted file mode 100644 index f9db6e4..0000000 --- a/xi/s6/skel/runlevel +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -e - -test "$#" -gt 0 || { echo 'runlevel: fatal: too few arguments' 1>&2 ; exit 100 ; } - -exec s6-rc -up change "$1" diff --git a/xi/s6/sv/agetty2/dependencies.d/hostname b/xi/s6/sv/agetty2/dependencies.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/agetty2/dependencies.d/hostname +++ /dev/null diff --git a/xi/s6/sv/agetty2/run b/xi/s6/sv/agetty2/run deleted file mode 100644 index 1bb017f..0000000 --- a/xi/s6/sv/agetty2/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Services ] : Enabling tty2" } -exec /sbin/agetty -L -8 tty2 115200 diff --git a/xi/s6/sv/agetty2/type b/xi/s6/sv/agetty2/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/agetty2/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/agetty3/dependencies.d/hostname b/xi/s6/sv/agetty3/dependencies.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/agetty3/dependencies.d/hostname +++ /dev/null diff --git a/xi/s6/sv/agetty3/run b/xi/s6/sv/agetty3/run deleted file mode 100644 index 5a5cf19..0000000 --- a/xi/s6/sv/agetty3/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Services ] : Enabling tty3" } -exec /sbin/agetty -L -8 tty3 115200 diff --git a/xi/s6/sv/agetty3/type b/xi/s6/sv/agetty3/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/agetty3/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/agetty4/dependencies.d/hostname b/xi/s6/sv/agetty4/dependencies.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/agetty4/dependencies.d/hostname +++ /dev/null diff --git a/xi/s6/sv/agetty4/run b/xi/s6/sv/agetty4/run deleted file mode 100644 index 3f6a88e..0000000 --- a/xi/s6/sv/agetty4/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Services ] : Enabling tty4" } -exec /sbin/agetty -L -8 tty4 115200 diff --git a/xi/s6/sv/agetty4/type b/xi/s6/sv/agetty4/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/agetty4/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/agetty5/dependencies.d/hostname b/xi/s6/sv/agetty5/dependencies.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/agetty5/dependencies.d/hostname +++ /dev/null diff --git a/xi/s6/sv/agetty5/run b/xi/s6/sv/agetty5/run deleted file mode 100644 index 2f2e326..0000000 --- a/xi/s6/sv/agetty5/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Services ] : Enabling tty5" } -exec /sbin/agetty -L -8 tty5 115200 diff --git a/xi/s6/sv/agetty5/type b/xi/s6/sv/agetty5/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/agetty5/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/agetty6/dependencies.d/hostname b/xi/s6/sv/agetty6/dependencies.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/agetty6/dependencies.d/hostname +++ /dev/null diff --git a/xi/s6/sv/agetty6/run b/xi/s6/sv/agetty6/run deleted file mode 100644 index 49f8a3a..0000000 --- a/xi/s6/sv/agetty6/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Services ] : Enabling tty6" } -exec /sbin/agetty -L -8 tty6 115200 diff --git a/xi/s6/sv/agetty6/type b/xi/s6/sv/agetty6/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/agetty6/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/cgroups/dependencies.d/mount-procfs b/xi/s6/sv/cgroups/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/cgroups/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/cgroups/dependencies.d/mount-sysfs b/xi/s6/sv/cgroups/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/cgroups/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/cgroups/dependencies.d/vkfs b/xi/s6/sv/cgroups/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/cgroups/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/cgroups/type b/xi/s6/sv/cgroups/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/cgroups/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/cgroups/up b/xi/s6/sv/cgroups/up deleted file mode 100644 index 51e4246..0000000 --- a/xi/s6/sv/cgroups/up +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 1/9 : Mounting cgroups" } -envfile /etc/s6/s6.conf -importas -iu CGROUP_MODE CGROUP_MODE -importas -iu CGROUP_CONTROLLERS CGROUP_CONTROLLERS -importas -iu HAVE_CONTROLLER1_GROUPS HAVE_CONTROLLER1_GROUPS -exec sh /etc/s6/scripts/mount-cgroups $CGROUP_MODE $CGROUP_CONTROLLERS $HAVE_CONTROLLER1_GROUPS diff --git a/xi/s6/sv/checkfs/dependencies.d/udev b/xi/s6/sv/checkfs/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/checkfs/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/checkfs/type b/xi/s6/sv/checkfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/checkfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/checkfs/up b/xi/s6/sv/checkfs/up deleted file mode 100644 index 9dd2952..0000000 --- a/xi/s6/sv/checkfs/up +++ /dev/null @@ -1,12 +0,0 @@ -envfile /etc/s6/s6.conf -importas -iu FORCECHECK FORCECHECK -ifelse -X { s6-test $FORCECHCK = yes } - { - redirfd -w 1 /dev/console - if { s6-echo -- "[ Checkrootfs ] >>>>> Check of filesystem was asked, please wait" } - foreground { fsck -A -T -a -f noopts=_netdev } - s6-echo -- "[ Checkrootfs ] >>>>> Check of filesystem was asked, please wait" -} -if -t { - fsck -A -T -a noopts=_netdev -} diff --git a/xi/s6/sv/cleantmp/dependencies.d/remount-root b/xi/s6/sv/cleantmp/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/cleantmp/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/cleantmp/down b/xi/s6/sv/cleantmp/down deleted file mode 100644 index c5f65cc..0000000 --- a/xi/s6/sv/cleantmp/down +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Shutdown ] : Cleaning /tmp" } -/bin/sh -c "/etc/s6/scripts/clean_tmp.sh" diff --git a/xi/s6/sv/cleantmp/type b/xi/s6/sv/cleantmp/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/cleantmp/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/cleantmp/up b/xi/s6/sv/cleantmp/up deleted file mode 100644 index 9c24500..0000000 --- a/xi/s6/sv/cleantmp/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 0/6 : Cleaning /tmp" } -/bin/sh -c "/etc/s6/scripts/clean_tmp.sh" diff --git a/xi/s6/sv/console/dependencies.d/udev b/xi/s6/sv/console/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/console/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/console/type b/xi/s6/sv/console/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/console/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/console/up b/xi/s6/sv/console/up deleted file mode 100644 index 416edb9..0000000 --- a/xi/s6/sv/console/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 2/9 : Setting up console" } -sh -c "/etc/s6/scripts/console_set.sh" diff --git a/xi/s6/sv/default/contents.d/machine b/xi/s6/sv/default/contents.d/machine deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/default/contents.d/machine +++ /dev/null diff --git a/xi/s6/sv/default/contents.d/services b/xi/s6/sv/default/contents.d/services deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/default/contents.d/services +++ /dev/null diff --git a/xi/s6/sv/default/contents.d/vkfs b/xi/s6/sv/default/contents.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/default/contents.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/default/type b/xi/s6/sv/default/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/default/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/dmesg/dependencies.d/remount-root b/xi/s6/sv/dmesg/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/dmesg/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/dmesg/dependencies.d/vkfs b/xi/s6/sv/dmesg/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/dmesg/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/dmesg/type b/xi/s6/sv/dmesg/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/dmesg/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/dmesg/up b/xi/s6/sv/dmesg/up deleted file mode 100644 index 872a8d7..0000000 --- a/xi/s6/sv/dmesg/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 2/6 : Logging kernel boot" } -pipeline { dmesg } s6-setuidgid s6log exec -c s6-log -b -- n3 s2000000 T /var/log/dmesg diff --git a/xi/s6/sv/getty/contents.d/agetty2 b/xi/s6/sv/getty/contents.d/agetty2 deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/getty/contents.d/agetty2 +++ /dev/null diff --git a/xi/s6/sv/getty/contents.d/agetty3 b/xi/s6/sv/getty/contents.d/agetty3 deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/getty/contents.d/agetty3 +++ /dev/null diff --git a/xi/s6/sv/getty/contents.d/agetty4 b/xi/s6/sv/getty/contents.d/agetty4 deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/getty/contents.d/agetty4 +++ /dev/null diff --git a/xi/s6/sv/getty/contents.d/agetty5 b/xi/s6/sv/getty/contents.d/agetty5 deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/getty/contents.d/agetty5 +++ /dev/null diff --git a/xi/s6/sv/getty/contents.d/agetty6 b/xi/s6/sv/getty/contents.d/agetty6 deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/getty/contents.d/agetty6 +++ /dev/null diff --git a/xi/s6/sv/getty/type b/xi/s6/sv/getty/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/getty/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/hostname/dependencies.d/mount-procfs b/xi/s6/sv/hostname/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/hostname/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/hostname/type b/xi/s6/sv/hostname/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/hostname/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/hostname/up b/xi/s6/sv/hostname/up deleted file mode 100644 index 72f519e..0000000 --- a/xi/s6/sv/hostname/up +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 3/9 : Setting hostname" } -if -t { s6-test -s /etc/hostname } backtick -n HOSTNAME { head -1 /etc/hostname } -importas -iu HOSTNAME HOSTNAME -if -t { s6-test -n $HOSTNAME } redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME diff --git a/xi/s6/sv/hwclock/dependencies.d/udev b/xi/s6/sv/hwclock/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/hwclock/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/hwclock/down b/xi/s6/sv/hwclock/down deleted file mode 100644 index 5349d21..0000000 --- a/xi/s6/sv/hwclock/down +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Shutdown ] : Saving sytem clock to rtc0" } -envfile /etc/s6/s6.conf -importas -iu HARDWARECLOCK HARDWARECLOCK -foreground { if { s6-test $HARDWARECLOCK = UTC } hwclock --systohc --utc --noadjfile } -foreground { if { s6-test $HARDWARECLOCK = localtime } hwclock --systohc --localtime --noadjfile } diff --git a/xi/s6/sv/hwclock/type b/xi/s6/sv/hwclock/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/hwclock/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/hwclock/up b/xi/s6/sv/hwclock/up deleted file mode 100644 index ee88cbf..0000000 --- a/xi/s6/sv/hwclock/up +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 4/9 : Setting system clock from rtc0" } -envfile /etc/s6/s6.conf -importas -iu HARDWARECLOCK HARDWARECLOCK -foreground { if { s6-test $HARDWARECLOCK = UTC } hwclock --systz --utc --noadjfile } -foreground { if { s6-test $HARDWARECLOCK = localtime } hwclock --systz --localtime --noadjfile } diff --git a/xi/s6/sv/kermod/dependencies.d/mount-procfs b/xi/s6/sv/kermod/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/kermod/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/kermod/dependencies.d/mount-sysfs b/xi/s6/sv/kermod/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/kermod/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/kermod/type b/xi/s6/sv/kermod/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/kermod/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/kermod/up b/xi/s6/sv/kermod/up deleted file mode 100644 index f8d4d90..0000000 --- a/xi/s6/sv/kermod/up +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 5/9 : Setting up Kernel Static Node(s)" } -foreground { if -n { test -d /run/tmpfiles.d } mkdir /run/tmpfiles.d } -foreground { kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf } diff --git a/xi/s6/sv/machine/contents.d/rofs b/xi/s6/sv/machine/contents.d/rofs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/machine/contents.d/rofs +++ /dev/null diff --git a/xi/s6/sv/machine/contents.d/rwfs b/xi/s6/sv/machine/contents.d/rwfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/machine/contents.d/rwfs +++ /dev/null diff --git a/xi/s6/sv/machine/dependencies.d/vkfs b/xi/s6/sv/machine/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/machine/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/machine/type b/xi/s6/sv/machine/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/machine/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/mnt-devpts/dependencies.d/mount-procfs b/xi/s6/sv/mnt-devpts/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mnt-devpts/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/mnt-devpts/dependencies.d/prep-dev b/xi/s6/sv/mnt-devpts/dependencies.d/prep-dev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mnt-devpts/dependencies.d/prep-dev +++ /dev/null diff --git a/xi/s6/sv/mnt-devpts/type b/xi/s6/sv/mnt-devpts/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mnt-devpts/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mnt-devpts/up b/xi/s6/sv/mnt-devpts/up deleted file mode 100644 index 32609fa..0000000 --- a/xi/s6/sv/mnt-devpts/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 3/6 : Mounting /dev/pts" } -s6-mount -t devpts -o mode=0620,gid=5,nosuid,noexec devpts /dev/pts diff --git a/xi/s6/sv/mnt-shm/dependencies.d/mount-procfs b/xi/s6/sv/mnt-shm/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mnt-shm/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/mnt-shm/dependencies.d/prep-dev b/xi/s6/sv/mnt-shm/dependencies.d/prep-dev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mnt-shm/dependencies.d/prep-dev +++ /dev/null diff --git a/xi/s6/sv/mnt-shm/type b/xi/s6/sv/mnt-shm/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mnt-shm/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mnt-shm/up b/xi/s6/sv/mnt-shm/up deleted file mode 100644 index a461bfc..0000000 --- a/xi/s6/sv/mnt-shm/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 4/6 : Mounting /dev/shm" } -s6-mount -t tmpfs -o mode=1777,nosuid,nodev shm /dev/shm diff --git a/xi/s6/sv/modules/dependencies.d/mount-procfs b/xi/s6/sv/modules/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/modules/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/modules/dependencies.d/udev b/xi/s6/sv/modules/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/modules/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/modules/type b/xi/s6/sv/modules/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/modules/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/modules/up b/xi/s6/sv/modules/up deleted file mode 100644 index a475dc9..0000000 --- a/xi/s6/sv/modules/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 6/9 : Loading any kernel modules" } -sh -c "modules-load" diff --git a/xi/s6/sv/mount-devfs/contents.d/mnt-devpts b/xi/s6/sv/mount-devfs/contents.d/mnt-devpts deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-devfs/contents.d/mnt-devpts +++ /dev/null diff --git a/xi/s6/sv/mount-devfs/contents.d/mnt-shm b/xi/s6/sv/mount-devfs/contents.d/mnt-shm deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-devfs/contents.d/mnt-shm +++ /dev/null diff --git a/xi/s6/sv/mount-devfs/contents.d/prep-dev b/xi/s6/sv/mount-devfs/contents.d/prep-dev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-devfs/contents.d/prep-dev +++ /dev/null diff --git a/xi/s6/sv/mount-devfs/dependencies.d/mount-procfs b/xi/s6/sv/mount-devfs/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-devfs/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/mount-devfs/type b/xi/s6/sv/mount-devfs/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/mount-devfs/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/mount-efivars/dependencies.d/mount-sysfs b/xi/s6/sv/mount-efivars/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-efivars/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/mount-efivars/type b/xi/s6/sv/mount-efivars/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mount-efivars/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mount-efivars/up b/xi/s6/sv/mount-efivars/up deleted file mode 100644 index 3c2fe6e..0000000 --- a/xi/s6/sv/mount-efivars/up +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 6/6 : Mounting EFI-vars-fs" } -foreground { - if { test -d /sys/firmware/efi } - if -n { mountpoint -q /sys/firmware/efi/efivars } - mount -n -t efivarfs -o ro efivarfs /sys/firmware/efi/efivars -} diff --git a/xi/s6/sv/mount-ksecurity/dependencies.d/mount-sysfs b/xi/s6/sv/mount-ksecurity/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-ksecurity/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/mount-ksecurity/type b/xi/s6/sv/mount-ksecurity/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mount-ksecurity/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mount-ksecurity/up b/xi/s6/sv/mount-ksecurity/up deleted file mode 100644 index b7c4240..0000000 --- a/xi/s6/sv/mount-ksecurity/up +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 5/6 : Mounting securityfs" } -foreground { - if { test -d /sys/kernel } - if -n { mountpoint -q /sys/kernel/security } - mount -n -t securityfs securityfs /sys/kernel/security - -} diff --git a/xi/s6/sv/mount-procfs/type b/xi/s6/sv/mount-procfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mount-procfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mount-procfs/up b/xi/s6/sv/mount-procfs/up deleted file mode 100644 index 130a2a9..0000000 --- a/xi/s6/sv/mount-procfs/up +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "|--((( S6+S6-rc Bootscripts v 5.0.0 )))---| " } -if { s6-echo "[ Virtual-FS ] 1/6 : Mounting /proc" } -s6-mount -t proc -o nosuid,noexec,nodev proc /proc diff --git a/xi/s6/sv/mount-sysfs/dependencies.d/mount-procfs b/xi/s6/sv/mount-sysfs/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/mount-sysfs/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/mount-sysfs/type b/xi/s6/sv/mount-sysfs/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/mount-sysfs/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/mount-sysfs/up b/xi/s6/sv/mount-sysfs/up deleted file mode 100644 index c655ddc..0000000 --- a/xi/s6/sv/mount-sysfs/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 2/6 : Mounting /sys" } -s6-mount -t sysfs -o nosuid,noexec,nodev sys /sys diff --git a/xi/s6/sv/net-lo/dependencies.d/remount-root b/xi/s6/sv/net-lo/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/net-lo/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/net-lo/dependencies.d/vkfs b/xi/s6/sv/net-lo/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/net-lo/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/net-lo/type b/xi/s6/sv/net-lo/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/net-lo/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/net-lo/up b/xi/s6/sv/net-lo/up deleted file mode 100644 index a1b6f9e..0000000 --- a/xi/s6/sv/net-lo/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 3/6 : Setting up network loopback device" } -ip link set up dev lo diff --git a/xi/s6/sv/networking/dependencies.d/machine b/xi/s6/sv/networking/dependencies.d/machine deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/networking/dependencies.d/machine +++ /dev/null diff --git a/xi/s6/sv/networking/dependencies.d/vkfs b/xi/s6/sv/networking/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/networking/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/networking/down b/xi/s6/sv/networking/down deleted file mode 100644 index f749735..0000000 --- a/xi/s6/sv/networking/down +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/execlineb -P -fdmove -c 2 1 -if { s6-echo -- [ Shutdown ] : Shutting down WiFi & Ethernet... } -export IN_BOOT 1 -foreground { echo "[ Shutdown ] : Stopping networking interfaces..." } -elglob -0 FILES /etc/sysconfig/ifconfig.* -forx INTERFACE { ${FILES} } - importas -u INTERFACE INTERFACE - backtick IFACE { pipeline { echo ${INTERFACE} } cut -d . -f 2 } - importas -nu IFACE IFACE - /sbin/ifdown ${IFACE} - -s6-echo -- [ Shutdown ] : Networking Disabled. diff --git a/xi/s6/sv/networking/type b/xi/s6/sv/networking/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/networking/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/networking/up b/xi/s6/sv/networking/up deleted file mode 100644 index b7213b6..0000000 --- a/xi/s6/sv/networking/up +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/execlineb -P -fdmove -c 2 1 -if { s6-echo -- "[ Networking ] : Bringing up any network interfaces..." } -export IN_BOOT 1 -elglob -0 FILES /etc/sysconfig/ifconfig.* -forx INTERFACE { ${FILES} } - importas -u INTERFACE INTERFACE - backtick IFACE { pipeline { echo ${INTERFACE} } cut -d . -f 2 } - importas -nu IFACE IFACE - /sbin/ifup ${IFACE} - -if { s6-echo -- "[ Networking ] : Setup done" } diff --git a/xi/s6/sv/prep-dev/dependencies.d/mount-procfs b/xi/s6/sv/prep-dev/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/prep-dev/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/prep-dev/type b/xi/s6/sv/prep-dev/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/prep-dev/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/prep-dev/up b/xi/s6/sv/prep-dev/up deleted file mode 100644 index abb0bd4..0000000 --- a/xi/s6/sv/prep-dev/up +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Virtual-FS ] 0/6 : Creating mount points" } -s6-mkdir /dev/shm -s6-mkdir /dev/pts diff --git a/xi/s6/sv/random-seed/dependencies.d/mount-devfs b/xi/s6/sv/random-seed/dependencies.d/mount-devfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/random-seed/dependencies.d/mount-devfs +++ /dev/null diff --git a/xi/s6/sv/random-seed/dependencies.d/mount-procfs b/xi/s6/sv/random-seed/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/random-seed/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/random-seed/dependencies.d/mount-sysfs b/xi/s6/sv/random-seed/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/random-seed/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/random-seed/dependencies.d/remount-root b/xi/s6/sv/random-seed/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/random-seed/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/random-seed/dependencies.d/udevadm b/xi/s6/sv/random-seed/dependencies.d/udevadm deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/random-seed/dependencies.d/udevadm +++ /dev/null diff --git a/xi/s6/sv/random-seed/type b/xi/s6/sv/random-seed/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/random-seed/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/random-seed/up b/xi/s6/sv/random-seed/up deleted file mode 100644 index 9591e6c..0000000 --- a/xi/s6/sv/random-seed/up +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 4/6 : Restoring random seed" } -#foreground { umask 077; cp /var/lib/random-seed /dev/urandom } -foreground { cp /var/lib/random-seed /dev/urandom } -backtick -n bytes { cat /proc/sys/kernel/random/poolsize } -importas -iu bytes bytes -foreground { if { s6-test -z $bytes } define bytes 512 } -foreground { redirfd -w 2 /dev/null dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=$bytes } diff --git a/xi/s6/sv/remount-root/dependencies.d/checkfs b/xi/s6/sv/remount-root/dependencies.d/checkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/remount-root/dependencies.d/checkfs +++ /dev/null diff --git a/xi/s6/sv/remount-root/type b/xi/s6/sv/remount-root/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/remount-root/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/remount-root/up b/xi/s6/sv/remount-root/up deleted file mode 100644 index da6bf4c..0000000 --- a/xi/s6/sv/remount-root/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 1/6 : Remounting root filesystem as rw" } -s6-mount -o remount,rw / / diff --git a/xi/s6/sv/rofs/contents.d/cgroups b/xi/s6/sv/rofs/contents.d/cgroups deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/cgroups +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/checkfs b/xi/s6/sv/rofs/contents.d/checkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/checkfs +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/console b/xi/s6/sv/rofs/contents.d/console deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/console +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/hostname b/xi/s6/sv/rofs/contents.d/hostname deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/hostname +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/hwclock b/xi/s6/sv/rofs/contents.d/hwclock deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/hwclock +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/kermod b/xi/s6/sv/rofs/contents.d/kermod deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/kermod +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/modules b/xi/s6/sv/rofs/contents.d/modules deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/modules +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/swap b/xi/s6/sv/rofs/contents.d/swap deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/swap +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/sysctl b/xi/s6/sv/rofs/contents.d/sysctl deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/sysctl +++ /dev/null diff --git a/xi/s6/sv/rofs/contents.d/udev b/xi/s6/sv/rofs/contents.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/contents.d/udev +++ /dev/null diff --git a/xi/s6/sv/rofs/dependencies.d/vkfs b/xi/s6/sv/rofs/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rofs/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/rofs/type b/xi/s6/sv/rofs/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/rofs/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/rwfs-end/dependencies.d/dmesg b/xi/s6/sv/rwfs-end/dependencies.d/dmesg deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/dmesg +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/dependencies.d/net-lo b/xi/s6/sv/rwfs-end/dependencies.d/net-lo deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/net-lo +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/dependencies.d/random-seed b/xi/s6/sv/rwfs-end/dependencies.d/random-seed deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/random-seed +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/dependencies.d/remount-root b/xi/s6/sv/rwfs-end/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-dev b/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-dev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-dev +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-setup b/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-setup deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs-end/dependencies.d/tmpfiles-setup +++ /dev/null diff --git a/xi/s6/sv/rwfs-end/type b/xi/s6/sv/rwfs-end/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/rwfs-end/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/rwfs-end/up b/xi/s6/sv/rwfs-end/up deleted file mode 100644 index 6946d37..0000000 --- a/xi/s6/sv/rwfs-end/up +++ /dev/null @@ -1 +0,0 @@ -s6-true diff --git a/xi/s6/sv/rwfs/contents.d/cleantmp b/xi/s6/sv/rwfs/contents.d/cleantmp deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/cleantmp +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/dmesg b/xi/s6/sv/rwfs/contents.d/dmesg deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/dmesg +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/net-lo b/xi/s6/sv/rwfs/contents.d/net-lo deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/net-lo +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/random-seed b/xi/s6/sv/rwfs/contents.d/random-seed deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/random-seed +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/remount-root b/xi/s6/sv/rwfs/contents.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/rwfs-end b/xi/s6/sv/rwfs/contents.d/rwfs-end deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/rwfs-end +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/tmpfiles-dev b/xi/s6/sv/rwfs/contents.d/tmpfiles-dev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/tmpfiles-dev +++ /dev/null diff --git a/xi/s6/sv/rwfs/contents.d/tmpfiles-setup b/xi/s6/sv/rwfs/contents.d/tmpfiles-setup deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/contents.d/tmpfiles-setup +++ /dev/null diff --git a/xi/s6/sv/rwfs/dependencies.d/rofs b/xi/s6/sv/rwfs/dependencies.d/rofs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/dependencies.d/rofs +++ /dev/null diff --git a/xi/s6/sv/rwfs/dependencies.d/vkfs b/xi/s6/sv/rwfs/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/rwfs/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/rwfs/type b/xi/s6/sv/rwfs/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/rwfs/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/services/contents.d/getty b/xi/s6/sv/services/contents.d/getty deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/services/contents.d/getty +++ /dev/null diff --git a/xi/s6/sv/services/contents.d/networking b/xi/s6/sv/services/contents.d/networking deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/services/contents.d/networking +++ /dev/null diff --git a/xi/s6/sv/services/type b/xi/s6/sv/services/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/services/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/swap/dependencies.d/mount-sysfs b/xi/s6/sv/swap/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/swap/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/swap/dependencies.d/udev b/xi/s6/sv/swap/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/swap/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/swap/down b/xi/s6/sv/swap/down deleted file mode 100644 index 09fda29..0000000 --- a/xi/s6/sv/swap/down +++ /dev/null @@ -1 +0,0 @@ -swapoff -a diff --git a/xi/s6/sv/swap/type b/xi/s6/sv/swap/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/swap/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/swap/up b/xi/s6/sv/swap/up deleted file mode 100644 index 29bf079..0000000 --- a/xi/s6/sv/swap/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 7/9 : Turning on any swap/swap-files" } -swapon -a diff --git a/xi/s6/sv/sysctl/dependencies.d/mount-procfs b/xi/s6/sv/sysctl/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/sysctl/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/sysctl/dependencies.d/mount-sysfs b/xi/s6/sv/sysctl/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/sysctl/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/sysctl/dependencies.d/udev b/xi/s6/sv/sysctl/dependencies.d/udev deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/sysctl/dependencies.d/udev +++ /dev/null diff --git a/xi/s6/sv/sysctl/type b/xi/s6/sv/sysctl/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/sysctl/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/sysctl/up b/xi/s6/sv/sysctl/up deleted file mode 100644 index 670f8e3..0000000 --- a/xi/s6/sv/sysctl/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ Read-Only Mode ] 0/9 : Setting kernel parameters" } -redirfd -w 1 /dev/null sysctl --system diff --git a/xi/s6/sv/tmpfiles-dev/dependencies.d/cleantmp b/xi/s6/sv/tmpfiles-dev/dependencies.d/cleantmp deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-dev/dependencies.d/cleantmp +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-dev/dependencies.d/remount-root b/xi/s6/sv/tmpfiles-dev/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-dev/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-dev/dependencies.d/vkfs b/xi/s6/sv/tmpfiles-dev/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-dev/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-dev/type b/xi/s6/sv/tmpfiles-dev/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/tmpfiles-dev/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/tmpfiles-dev/up b/xi/s6/sv/tmpfiles-dev/up deleted file mode 100644 index 84cea2a..0000000 --- a/xi/s6/sv/tmpfiles-dev/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 6/6 : Setting up tmpfiles" } -tmpfiles --prefix=/dev --create --boot diff --git a/xi/s6/sv/tmpfiles-setup/dependencies.d/cleantmp b/xi/s6/sv/tmpfiles-setup/dependencies.d/cleantmp deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-setup/dependencies.d/cleantmp +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-setup/dependencies.d/remount-root b/xi/s6/sv/tmpfiles-setup/dependencies.d/remount-root deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-setup/dependencies.d/remount-root +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-setup/dependencies.d/rofs b/xi/s6/sv/tmpfiles-setup/dependencies.d/rofs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/tmpfiles-setup/dependencies.d/rofs +++ /dev/null diff --git a/xi/s6/sv/tmpfiles-setup/type b/xi/s6/sv/tmpfiles-setup/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/tmpfiles-setup/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/tmpfiles-setup/up b/xi/s6/sv/tmpfiles-setup/up deleted file mode 100644 index e694ec8..0000000 --- a/xi/s6/sv/tmpfiles-setup/up +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/execlineb -P -if { s6-echo "[ ReadWrite Mode ] 5/6 : Cleaning tempfiles" } -tmpfiles --exclude-prefix=/dev --create --remove --boot diff --git a/xi/s6/sv/udev/contents.d/udevadm b/xi/s6/sv/udev/contents.d/udevadm deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udev/contents.d/udevadm +++ /dev/null diff --git a/xi/s6/sv/udev/contents.d/udevd b/xi/s6/sv/udev/contents.d/udevd deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udev/contents.d/udevd +++ /dev/null diff --git a/xi/s6/sv/udev/dependencies.d/vkfs b/xi/s6/sv/udev/dependencies.d/vkfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udev/dependencies.d/vkfs +++ /dev/null diff --git a/xi/s6/sv/udev/type b/xi/s6/sv/udev/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/udev/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/s6/sv/udevadm/dependencies.d/mount-devfs b/xi/s6/sv/udevadm/dependencies.d/mount-devfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevadm/dependencies.d/mount-devfs +++ /dev/null diff --git a/xi/s6/sv/udevadm/dependencies.d/mount-procfs b/xi/s6/sv/udevadm/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevadm/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/udevadm/dependencies.d/mount-sysfs b/xi/s6/sv/udevadm/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevadm/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/udevadm/dependencies.d/udevd b/xi/s6/sv/udevadm/dependencies.d/udevd deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevadm/dependencies.d/udevd +++ /dev/null diff --git a/xi/s6/sv/udevadm/type b/xi/s6/sv/udevadm/type deleted file mode 100644 index bdd22a1..0000000 --- a/xi/s6/sv/udevadm/type +++ /dev/null @@ -1 +0,0 @@ -oneshot diff --git a/xi/s6/sv/udevadm/up b/xi/s6/sv/udevadm/up deleted file mode 100644 index 8e77db2..0000000 --- a/xi/s6/sv/udevadm/up +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/execlineb -P -# Initiate udev devices & subsystems -fdmove -c 2 1 -if { s6-echo "[ Read-Only Mode ] 9/9 : Setting up devices & subsystems" } -if { - foreground { udevadm trigger --action=add --type=subsystems } - foreground { udevadm trigger --action=add --type=devices } - udevadm settle -} diff --git a/xi/s6/sv/udevd/dependencies.d/mount-devfs b/xi/s6/sv/udevd/dependencies.d/mount-devfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevd/dependencies.d/mount-devfs +++ /dev/null diff --git a/xi/s6/sv/udevd/dependencies.d/mount-procfs b/xi/s6/sv/udevd/dependencies.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevd/dependencies.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/udevd/dependencies.d/mount-sysfs b/xi/s6/sv/udevd/dependencies.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/udevd/dependencies.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/udevd/run b/xi/s6/sv/udevd/run deleted file mode 100644 index 552ab1d..0000000 --- a/xi/s6/sv/udevd/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/execlineb -P -# Initiate udev -fdmove -c 2 1 -if { s6-echo "[ Read-Only Mode ] 8/9 : Intializing udev daemon" } -exec -c -udevd diff --git a/xi/s6/sv/udevd/type b/xi/s6/sv/udevd/type deleted file mode 100644 index 5883cff..0000000 --- a/xi/s6/sv/udevd/type +++ /dev/null @@ -1 +0,0 @@ -longrun diff --git a/xi/s6/sv/vkfs/contents.d/mount-devfs b/xi/s6/sv/vkfs/contents.d/mount-devfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/vkfs/contents.d/mount-devfs +++ /dev/null diff --git a/xi/s6/sv/vkfs/contents.d/mount-efivars b/xi/s6/sv/vkfs/contents.d/mount-efivars deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/vkfs/contents.d/mount-efivars +++ /dev/null diff --git a/xi/s6/sv/vkfs/contents.d/mount-ksecurity b/xi/s6/sv/vkfs/contents.d/mount-ksecurity deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/vkfs/contents.d/mount-ksecurity +++ /dev/null diff --git a/xi/s6/sv/vkfs/contents.d/mount-procfs b/xi/s6/sv/vkfs/contents.d/mount-procfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/vkfs/contents.d/mount-procfs +++ /dev/null diff --git a/xi/s6/sv/vkfs/contents.d/mount-sysfs b/xi/s6/sv/vkfs/contents.d/mount-sysfs deleted file mode 100644 index e69de29..0000000 --- a/xi/s6/sv/vkfs/contents.d/mount-sysfs +++ /dev/null diff --git a/xi/s6/sv/vkfs/type b/xi/s6/sv/vkfs/type deleted file mode 100644 index 757b422..0000000 --- a/xi/s6/sv/vkfs/type +++ /dev/null @@ -1 +0,0 @@ -bundle diff --git a/xi/bin/ifdown b/xi/sbin/ifdown index a133c25..05d7b41 100755 --- a/xi/bin/ifdown +++ b/xi/sbin/ifdown @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash ######################################################################## # Begin /sbin/ifdown # @@ -30,7 +30,7 @@ while [ $# -gt 0 ]; do -*) echo "ifup: ${1}: invalid option" >&2 echo "${USAGE}" >& 2 exit 2 ;; - + *) break ;; esac done @@ -53,17 +53,17 @@ file=/etc/sysconfig/ifconfig.${1} # Skip backup files [ "${file}" = "${file%""~""}" ] || exit 0 -#. /lib/lsb/init-functions +. /lib/lsb/init-functions if [ ! -r "${file}" ]; then - echo "${file} is missing or cannot be accessed." + log_warning_msg "${file} is missing or cannot be accessed." exit 1 fi . ${file} if [ "$IFACE" = "" ]; then - echo "${file} does not define an interface [IFACE]." + log_failure_msg "${file} does not define an interface [IFACE]." exit 1 fi @@ -77,11 +77,11 @@ if ip link show ${IFACE} > /dev/null 2>&1; then MSG="Unable to process ${file}. Either " MSG="${MSG}the SERVICE variable was not set " MSG="${MSG}or the specified service cannot be executed." - echo "$MSG" + log_failure_msg "$MSG" exit 1 fi else - echo "Interface ${1} doesn't exist." + log_warning_msg "Interface ${1} doesn't exist." fi # Leave the interface up if there are additional interfaces in the device @@ -90,9 +90,9 @@ link_status=`ip link show ${IFACE} 2>/dev/null` if [ -n "${link_status}" ]; then if [ "$(echo "${link_status}" | grep UP)" != "" ]; then if [ "$(ip addr show ${IFACE} | grep 'inet ')" == "" ]; then - echo "Bringing down the ${IFACE} interface..." + log_info_msg "Bringing down the ${IFACE} interface..." ip link set ${IFACE} down - #evaluate_retval + evaluate_retval fi fi fi diff --git a/xi/bin/ifup b/xi/sbin/ifup index 7466150..4c70810 100755 --- a/xi/bin/ifup +++ b/xi/sbin/ifup @@ -7,8 +7,9 @@ # Authors : Nathan Coulson - nathan@linuxfromscratch.org # Kevin P. Fleming - kpfleming@linuxfromscratch.org # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org +# DJ Lucas - dj@linuxfromscratch.org # -# Version : LFS 7.2 +# Version : LFS 7.7 # # Notes : The IFCONFIG variable is passed to the SERVICE script # in the /lib/services directory, to indicate what file the @@ -18,6 +19,8 @@ up() { + log_info_msg "Bringing up the ${1} interface..." + if ip link show $1 > /dev/null 2>&1; then link_status=`ip link show $1` @@ -28,12 +31,14 @@ up() fi else - echo "Interface ${IFACE} doesn't exist." + log_failure_msg "Interface ${IFACE} doesn't exist." exit 1 fi + + evaluate_retval } -RELEASE="7.2" +RELEASE="7.7" USAGE="Usage: $0 [ -hV ] [--help] [--version] interface" VERSTR="LFS ifup, version ${RELEASE}" @@ -43,11 +48,11 @@ while [ $# -gt 0 ]; do --help | -h) help="y"; break ;; --version | -V) echo "${VERSTR}"; exit 0 ;; - + -*) echo "ifup: ${1}: invalid option" >&2 echo "${USAGE}" >& 2 exit 2 ;; - + *) break ;; esac done @@ -70,66 +75,75 @@ file=/etc/sysconfig/ifconfig.${1} # Skip backup files [ "${file}" = "${file%""~""}" ] || exit 0 -#. /lib/lsb/init-functions - -echo "Bringing up the ${1} interface... " +. /lib/lsb/init-functions if [ ! -r "${file}" ]; then - echo "${file} is missing or cannot be accessed." + log_failure_msg "Unable to bring up ${1} interface! ${file} is missing or cannot be accessed." exit 1 fi -. $file +. $file if [ "$IFACE" = "" ]; then - echo "${file} does not define an interface [IFACE]." + log_failure_msg "Unable to bring up ${1} interface! ${file} does not define an interface [IFACE]." exit 1 fi # Do not process this service if started by boot, and ONBOOT # is not set to yes if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then - echo "skipped" exit 0 fi +# Bring up the interface +if [ "$VIRTINT" != "yes" ]; then + up ${IFACE} +fi + for S in ${SERVICE}; do if [ ! -x "/lib/services/${S}" ]; then - echo "Unable to process ${file}. Either " - echo "${MSG}the SERVICE '${S} was not present " - echo "${MSG}or cannot be executed." - echo "$MSG" + MSG="\nUnable to process ${file}. Either " + MSG="${MSG}the SERVICE '${S} was not present " + MSG="${MSG}or cannot be executed." + log_failure_msg "$MSG" exit 1 fi done +if [ "${SERVICE}" = "wpa" ]; then log_success_msg; fi + # Create/configure the interface -for S in ${SERVICE}; do +for S in ${SERVICE}; do IFCONFIG=${file} /lib/services/${S} ${IFACE} up done -# Bring up the interface and any components -for I in $IFACE $INTERFACE_COMPONENTS; do up $I; done +# Set link up virtual interfaces +if [ "${VIRTINT}" == "yes" ]; then + up ${IFACE} +fi + +# Bring up any additional interface components +for I in $INTERFACE_COMPONENTS; do up $I; done # Set MTU if requested. Check if MTU has a "good" value. if test -n "${MTU}"; then if [[ ${MTU} =~ ^[0-9]+$ ]] && [[ $MTU -ge 68 ]] ; then - for I in $IFACE $INTERFACE_COMPONENTS; do - ip link set dev $I mtu $MTU; + for I in $IFACE $INTERFACE_COMPONENTS; do + ip link set dev $I mtu $MTU; done else - echo "Invalid MTU $MTU" + log_info_msg2 "Invalid MTU $MTU" fi -fi +fi # Set the route default gateway if requested if [ -n "${GATEWAY}" ]; then if ip route | grep -q default; then - echo "Gateway already setup; skipping." + log_warning_msg "Gateway already setup; skipping." else - echo "Setting up default gateway..." + log_info_msg "Adding default gateway ${GATEWAY} to the ${IFACE} interface..." ip route add default via ${GATEWAY} dev ${IFACE} - #evaluate_retval + evaluate_retval fi fi diff --git a/xi/sbin/ifup.8 b/xi/sbin/ifup.8 new file mode 100644 index 0000000..2fb7873 --- /dev/null +++ b/xi/sbin/ifup.8 @@ -0,0 +1,185 @@ +ifup(8) ifup(8) + +NAME + ifup - bring a network interface up + ifdown - take a network interface down + +SYNOPSIS + ifup IFACE + ifup -h|--help + ifup -V|--version + + ifdown IFACE + ifdown -h|--help + ifdown -V|--version + +DESCRIPTION + The ifup and ifdown commands may be used to configure + (or, respectively, deconfigure) a network interface based + on interface definitions in the file + /etc/sysconfig/ifconfig.IFACE. + +OPTIONS + A summary of options is included below. + + -h, --help + Show summary of options. + + -V, --version + Show version information. + +EXAMPLES + ifup eth0 + Bring up the interface defined in the file + /etc/sysconfig/ifconfig.eth0 + + ONBOOT=no + IFACE=eth0 + SERVICE=ipv4-static + IP=192.168.1.22 + GATEWAY=192.168.1.1 + PREFIX=24 + BROADCAST=192.168.1.255 + + ifdown eth0:2 + Bring down the interface defined in the file + /etc/sysconfig/ifconfig.eth0:2 + + ONBOOT=no + IFACE=eth0 + LABEL=eth0:2 + SERVICE=dhcpcd + + DHCP_START="--waitip" + DHCP_STOP="-k" + + # Set PRINTIP="yes" to have the script print the DHCP IP address + PRINTIP="yes" + + # Set PRINTALL="yes" to print the DHCP assigned values for + # IP, SM, DG, and 1st NS. + PRINTALL="no" + + ifup br0 + Bring up the interface defined in the file + /etc/sysconfig/ifconfig.br0 + + ONBOOT=yes + IFACE=br0 + SERVICE="bridge ipv4-static" + IP=192.168.1.22 + GATEWAY=192.168.1.1 + PREFIX=24 + BROADCAST=192.168.1.255 + STP=no # Spanning tree protocol, default no + INTERFACE_COMPONENTS=eth0 # Add to IFACE + IP_FORWARD=true + +NOTES + The program does not configure network interfaces direct- + ly. It runs scripts defined by the SERVICE variable in + the network configuration file. + + The configuration files must have the following environ- + ment variables set: + + IFACE - The interface to configure, e.g. eth0. It must + be available in /sys/class/net. + + SERVICE - The service script to run to bring up the inter- + face. Standard services are ipv4-static and + ipv4-static-route. Other services such as dhcp + or bridge may be installed. This value may + be a list of services when the interface is a + compound device such as a bridge. + + ONBOOT - If set to 'yes', the specified interface is + configured by the netowrk boot script. + + GATEWAY - The default IP address to use for routing if + the destination IP address is not in a static + route or on a local network, e.g., 192.168.1.1. + For secondary IP addresses on an interface, this + parameter should not be specified. If the service + is ipv4-static-route, this parameter must NOT + be set. + + STATIC_GATEWAY - The default IP address to use for routing + when setting a static routing address. + + INTERFACE_COMPONENTS - A list of component interfaces + only needed for a compound device such as a bridge. + This list is normally a single value, e.g. eth0, + for use with a virtual host such as kvm. + + Other paramters that are service specific include: + + ipv4-static + + IP - The IP address of the interface, + e.g. 192.168.1.2. + + PREFIX - The number of bits that specify the network + number of the interface. The default, if not + specified, is 24. + + LABEL - The label to be assigned to the interface. + This is normally specified for assigning + additional IP addresses to a network + device. Example: eth0:2 (optional) + + BROADCAST - The brodcast address for this interface, + e.g 192.168.1.255. If not specified, + the broadcast address will be calculated + from the IP and PREFIX. + + ipv4-static-route + + TYPE - The type of route, typically 'default', + 'network', 'or host'. + + IP - The IP address for a network or host, if the + TYPE is not 'default'. + + PREFIX - The prefix for the associated IP address. + + STATIC_GATEWAY - The IP address for a network route. + + SOURCE - The source IP address to prefer when sending + to the destinations covered by the specified + route. (optional) + + dhcp/dhclient + + DHCP_START - Optional parameters to pass to the dhcp client + at startup. + + DHCP_STOP - Optional paremeters to pass to the dhcp client + at shutdown. + + PRINTIP - Flag to print the dhcp address to stdout + + PRINTALL - Flag to print all obtained dhcp data to stdout + + bridge + + IP_FORWARD - An optional flag to enable the system to forward + inbound IP packets received by one interface to + another outbound interface. + + STP - Set bridge spanning tree protocol. Default is no. + +FILES + /etc/sysconfig/ifconfig.* + definitions of network interfaces + +AUTHORS + The ifup/ifdown suite was written by Nathan Coulson + <nathan@linuxfromscratch.org> and Kevin P. Fleming + <kpfleming@linuxfromscratch.org> + and updated by Bruce Dubbs <bdubbs@linuxfromscratch>. + +SEE ALSO + ip(8). + +IFUP/IFDOWN 8 February 2015 ifup(8) diff --git a/xi/services/dhcpcd b/xi/services/dhcpcd deleted file mode 100755 index 050413c..0000000 --- a/xi/services/dhcpcd +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# Begin services/dhcpcd - -# Origianlly dased upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up} -# Rewritten by Nathan Coulson <nathan@linuxfromscratch.org> -# Adapted for dhcpcd by DJ Lucas <dj@linuxfromscratch.org> -# Update for LFS 7.0 by Bruce Dubbs <bdubbs@linuxfromscratch,org> - -# Call with: IFCONFIG=<filename> /lib/services/dhcpcd <IFACE> <up | down> - -#$LastChangedBy: bdubbs $ -#$Date: 2012-04-09 19:48:51 +0000 (Mon, 09 Apr 2012) $ - -#. /lib/lsb/init-functions -. $IFCONFIG - -pidfile="/var/run/dhcpcd-$1.pid" - -case "$2" in - up) - # Cosmetic output not needed for multiple services - #if ! $(echo ${SERVICE} | grep -q " "); then - # log_info_msg2 "\n" # Terminate the previous message - #fi - - echo "Starting dhcpcd on the $1 interface..." - - # Test to see if there is a stale pid file - if [ -f "$pidfile" ]; then - ps `cat "$pidfile"` | grep dhcpcd > /dev/null - - if [ $? != 0 ]; then - rm -f /var/run/dhcpcd-$1.pid > /dev/null - - else - echo "dhcpcd is already running!" - exit 2 - fi - fi - - /sbin/dhcpcd $1 $DHCP_START - #evaluate_retval - ;; - - down) - echo "Stopping dhcpcd on the $1 interface..." - - if [ -z "$DHCP_STOP" ]; then - kill -9 $(cat ${pidfile}) - rm -f ${pidfile} - - else - /sbin/dhcpcd $1 $DHCP_STOP &> /dev/null - - if [ "$?" -eq 1 ]; then - echo "dhcpcd not running!" - exit 2 - fi - fi - - #evaluate_retval - ;; - - *) - echo "Usage: $0 [interface] {up|down}" - exit 1 - ;; -esac - -# End services/dhcpcd diff --git a/xi/services/wpa b/xi/services/wpa deleted file mode 100755 index bf176e9..0000000 --- a/xi/services/wpa +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -# Begin services/wpa - -# Origianlly based upon lfs-bootscripts-1.12 $NETWORK_DEVICES/if{down,up} -# Written by Armin K. <krejzi at email dot com> - -# Call with: IFCONFIG=<filename> /lib/services/wpa <IFACE> <up | down> - -#$LastChangedBy: krejzi $ -#$Date: 2013-03-24 15:39:14 +0000 (Sun, 24 Mar 2013) $ - -#. /lib/lsb/init-functions -. $IFCONFIG - -CFGFILE=/etc/sysconfig/wpa_supplicant-${IFCONFIG##*.}.conf -PIDFILE=/run/wpa_supplicant/$1.pid -CONTROL_IFACE=/run/wpa_supplicant/$1 - -case "$2" in - up) - - if [ -e ${PIDFILE} ]; then - ps $(cat ${PIDFILE}) | grep wpa_supplicant >/dev/null - if [ "$?" = "0" ]; then - echo "wpa_supplicant already running on $1." - exit 0 - else - rm ${PIDFILE} - fi - fi - - if [ ! -e ${CFGFILE} ]; then - echo "wpa_supplicant configuration file ${CFGFILE} not present." - echo "wpa_supplicant cannot be started." - exit 1 - fi - - echo "Starting wpa_supplicant on the $1 interface..." - - mkdir -p /run/wpa_supplicant - - /sbin/wpa_supplicant -q -B -Dnl80211,wext -P${PIDFILE} -C/run/wpa_supplicant -c${CFGFILE} -i$1 ${WPA_ARGS} - - if [ "$?" != "0" ]; then - echo "wpa_supplicant failed to start." - exit 1 - fi - - echo "wpa_supplicant successfully started." - - if [ -n "${WPA_SERVICE}" ]; then - if [ ! -e /lib/services/${WPA_SERVICE} -a ! -x /lib/services/${WPA_SERVICE} ]; then - echo "Cannot start ${WPA_SERVICE} on $1" - #log_failure_msg2 - exit 1 - fi - - IFCONFIG=${IFCONFIG} /lib/services/${WPA_SERVICE} $1 up - fi - ;; - - down) - if [ -n "${WPA_SERVICE}" ]; then - if [ ! -e /lib/services/${WPA_SERVICE} -a ! -x /lib/services/${WPA_SERVICE} ]; then - echo "Cannot stop ${WPA_SERVICE} on $1" - else - IFCONFIG=${IFCONFIG} /lib/services/${WPA_SERVICE} $1 down - fi - fi - - echo "Stopping wpa_supplicant on the $1 interface..." - - if [ -e ${PIDFILE} ]; then - kill -9 $(cat ${PIDFILE}) - rm -f ${PIDFILE} ${CONTROL_IFACE} - #evaluate_retval - else - echo "wpa_supplicant already stopped on $1" - exit 0 - fi - ;; - - *) - echo "Usage: $0 [interface] {up|down}" - exit 1 - ;; -esac - -# End services/wpa diff --git a/xi/sysconfig/createfiles b/xi/sysconfig/createfiles new file mode 100644 index 0000000..3d85874 --- /dev/null +++ b/xi/sysconfig/createfiles @@ -0,0 +1,31 @@ +######################################################################## +# Begin /etc/sysconfig/createfiles +# +# Description : Createfiles script config file +# +# Authors : +# +# Version : 00.00 +# +# Notes : The syntax of this file is as follows: +# if type is equal to "file" or "dir" +# <filename> <type> <permissions> <user> <group> +# if type is equal to "dev" +# <filename> <type> <permissions> <user> <group> <devtype> +# <major> <minor> +# +# <filename> is the name of the file which is to be created +# <type> is either file, dir, or dev. +# file creates a new file +# dir creates a new directory +# dev creates a new device +# <devtype> is either block, char or pipe +# block creates a block device +# char creates a character deivce +# pipe creates a pipe, this will ignore the <major> and +# <minor> fields +# <major> and <minor> are the major and minor numbers used for +# the device. +######################################################################## + +# End /etc/sysconfig/createfiles diff --git a/xi/sysconfig/modules b/xi/sysconfig/modules new file mode 100644 index 0000000..0fce3f3 --- /dev/null +++ b/xi/sysconfig/modules @@ -0,0 +1,18 @@ +######################################################################## +# Begin /etc/sysconfig/modules +# +# Description : Module auto-loading configuration +# +# Authors : +# +# Version : 00.00 +# +# Notes : The syntax of this file is as follows: +# <module> [<arg1> <arg2> ...] +# +# Each module should be on its own line, and any options that you want +# passed to the module should follow it. The line deliminator is either +# a space or a tab. +######################################################################## + +# End /etc/sysconfig/modules diff --git a/xi/sysconfig/rc.site b/xi/sysconfig/rc.site new file mode 100644 index 0000000..0f89264 --- /dev/null +++ b/xi/sysconfig/rc.site @@ -0,0 +1,92 @@ +# rc.site +# Optional parameters for boot scripts. + +# Distro Information +# These values, if specified here, override the defaults +#DISTRO="XiLinux" # The distro name +#DISTRO_CONTACT="xi@davidovski.xyz" # Bug report address +#DISTRO_MINI="Xi" # Short name used in filenames for distro config + +# Define custom colors used in messages printed to the screen + +# Please consult `man console_codes` for more information +# under the "ECMA-48 Set Graphics Rendition" section +# +# Warning: when switching from a 8bit to a 9bit font, +# the linux console will reinterpret the bold (1;) to +# the top 256 glyphs of the 9bit font. This does +# not affect framebuffer consoles + +# These values, if specified here, override the defaults +#BRACKET="\\033[1;34m" # Blue +#FAILURE="\\033[1;31m" # Red +#INFO="\\033[1;36m" # Cyan +#NORMAL="\\033[0;39m" # Grey +#SUCCESS="\\033[1;32m" # Green +#WARNING="\\033[1;33m" # Yellow + +# Use a colored prefix +# These values, if specified here, override the defaults +#BMPREFIX=" " +#SUCCESS_PREFIX="${SUCCESS} * ${NORMAL} " +#FAILURE_PREFIX="${FAILURE}*****${NORMAL} " +#WARNING_PREFIX="${WARNING} *** ${NORMAL} " + +# Manually seet the right edge of message output (characters) +# Useful when resetting console font during boot to override +# automatic screen width detection +#COLUMNS=120 + +# Interactive startup +#IPROMPT="yes" # Whether to display the interactive boot prompt +#itime="3" # The amount of time (in seconds) to display the prompt + +# The total length of the distro welcome string, without escape codes +#wlen=$(echo "Welcome to ${DISTRO}" | wc -c ) +#welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}" + +# The total length of the interactive string, without escape codes +#ilen=$(echo "Press 'I' to enter interactive startup" | wc -c ) +#i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup" + +# Set scripts to skip the file system check on reboot +#FASTBOOT=yes + +# Skip reading from the console +#HEADLESS=yes + +# Write out fsck progress if yes +#VERBOSE_FSCK=no + +# Speed up boot without waiting for settle in udev +#OMIT_UDEV_SETTLE=y + +# Speed up boot without waiting for settle in udev_retry +#OMIT_UDEV_RETRY_SETTLE=yes + +# Skip cleaning /tmp if yes +#SKIPTMPCLEAN=no + +# For setclock +#UTC=1 +#CLOCKPARAMS= + +# For consolelog (Note that the default, 7=debug, is noisy) +#LOGLEVEL=7 + +# For network +#HOSTNAME=xilinux + +# Delay between TERM and KILL signals at shutdown +#KILLDELAY=3 + +# Optional sysklogd parameters +#SYSKLOGD_PARMS="-m 0" + +# Console parameters +#UNICODE=1 +#KEYMAP="de-latin1" +#KEYMAP_CORRECTIONS="euro2" +#FONT="lat0-16 -m 8859-15" +#LEGACY_CHARSET= + diff --git a/xi/sysconfig/udev_retry b/xi/sysconfig/udev_retry new file mode 100644 index 0000000..9878f48 --- /dev/null +++ b/xi/sysconfig/udev_retry @@ -0,0 +1,19 @@ +######################################################################## +# Begin /etc/sysconfig/udev_retry +# +# Description : udev_retry script configuration +# +# Authors : +# +# Version : 00.00 +# +# Notes : Each subsystem that may need to be re-triggered after mountfs +# runs should be listed in this file. Probable subsystems to be +# listed here are rtc (due to /var/lib/hwclock/adjtime) and sound +# (due to both /var/lib/alsa/asound.state and /usr/sbin/alsactl). +# Entries are whitespace-separated. +######################################################################## + +rtc + +# End /etc/sysconfig/udev_retry diff --git a/xi/vconsole.conf b/xi/vconsole.conf deleted file mode 100644 index 27f787d..0000000 --- a/xi/vconsole.conf +++ /dev/null @@ -1 +0,0 @@ -FONT=ter-i12n |