#!/bin/sh . /usr/share/ltsp/ltsp-client-functions scriptsdir="/usr/share/ltsp/init-ltsp.d" # workaround Debian bug in initramfs-tools: # http://bugs.debian.org/660297 mountpoint -q /sys || mount -t sysfs -o nodev,noexec,nosuid sysfs /sys mountpoint -q /proc || mount -t proc -o nodev,noexec,nosuid proc /proc # Workaround Gentoo's genkernel initramfs not mounting /run: mountpoint -q /run || mount -t tmpfs -o "noexec,nosuid,size=10%,mode=0755" tmpfs /run # Provide an ltsp.break= kernel parameter which will offer a shell # right before sourcing that script. for x in $(cat /proc/cmdline); do case "$x" in ltsp.break=*) breakscript="$scriptsdir/${x#ltsp.break=}" break; ;; esac done for script in $(run_parts_list "$scriptsdir") ; do if [ "$script" = "$breakscript" ]; then warn "Spawning shell before $script" bash -l warn "Continuing init-ltsp execution" fi debug "Sourcing $script" . "$script" done debug "Done" # init=/sbin/init-ltsp can be used to launch this script, which should then # chain to /sbin/init. # To run it from the initramfs instead, set the EXEC_INIT environment variable # to "false". if [ "$EXEC_INIT" != "false" ]; then exec /sbin/init fi