id: 2: initdefault: # Boot-time system configuration / initialization script. # This is a run first except when booting in emergency (-b) mode. si :: sysinit: /etc/init.d/rcS # What to do in single-user mode. ~~: S: wait: / sbin / sulogin # Runlevel 0 is halt. # Runlevel 1 is single-user. # Runlevels 2-5 are multi-user. # Runlevel 6 is reboot. l0: 0: wait: /etc/init.d/rc 0 l1: 1: wait: /etc/init.d/rc 1 l2: 2: wait: /etc/init.d/rc 2 l3: 3: wait: /etc/init.d/rc 3 l4: 4: wait: /etc/init.d/rc 4 l5: 5: wait: /etc/init.d/rc 5 l6: 6: wait: /etc/init.d/rc 6
20: 06: 22.33157 Uncompressing Linux ... done, booting the kernel. 20: 06: 22.99351 - runit: $! Id: 25da3b86f7bed4038b8a039d2f8e8c9bbcf0822b $: booting. 20: 06: 22.99351 - runit: enter stage: / etc / runit / 1 20: 06: 24.07955 - runit: leave stage: / etc / runit / 1 20: 06: 24.07955 - runit: enter stage: / etc / runit / 2 20: 06: 25.41956 20: 06: 25.41957 Debian GNU / Linux 7.0 x10-02 ttyO0 20: 06: 25.41957 20: 06: 25.41957 x10-02 login:
#!/bin/sh exec 2>&1 exec setsid /sbin/agetty --nohostname tty5 38400 linux
20: 06: 19.31769 U-Boot SPL 2011.09-00000-gf63b270-dirty (Apr 24 2012 - 09:51:01) 20: 06: 19.52354 Texas Instruments Revision detection unimplemented 20: 06: 19.94867 No AC power, disabling frequency switch 20: 06: 19.94868 OMAP SD / MMC: 0 20: 06: 19.94868 reading u-boot.img 20: 06: 19.94868 reading u-boot.img 20: 06: 19.94868 20: 06: 19.94868 20: 06: 19.94869 U-Boot 2011.09-00000-gf63b270-dirty (Apr 24 2012 - 09:51:01) 20: 06: 20.20756 20: 06: 20.20756 I2C: ready 20: 06: 20.20756 DRAM: 256 MiB 20: 06: 20.39067 No daughter card present 20: 06: 20.39067 NAND: HW ECC Hamming Code selected 20: 06: 20.39067 nand_get_flash_type: unknown NAND device: Manufacturer ID: 0x10, Chip ID: 0x10 20: 06: 20.39970 No NAND device found !!! 20: 06: 20.39970 0 MiB 20: 06: 20.39970 MMC: OMAP SD / MMC: 0 20: 06: 20.39970 *** Warning - readenv () failed, using default environment 20: 06: 20.65954 20: 06: 20.65954 Net: cpsw 20: 06: 20.65955 Hit any key to stop autoboot: 0 20: 06: 21.54266 SD / MMC found on device 0 20: 06: 21.54266 reading uEnv.txt 20: 06: 21.54266 20: 06: 21.54266 202 bytes read 20: 06: 21.54266 Loaded environment from uEnv.txt 20: 06: 21.54266 Importing environment from mmc ... 20: 06: 21.74756 reading uimage 20: 06: 21.87867 20: 06: 21.87868 3083432 bytes read 20: 06: 21.87869 ## Booting kernel from Legacy Image at 80007fc0 ... 20: 06: 21.87870 Image Name: Angstrom / 3.2.18 / beaglebone 20: 06: 21.88761 Image Type: ARM Linux Kernel Image (uncompressed) 20: 06: 21.88761 Data Size: 3083368 Bytes = 2.9 MiB 20: 06: 21.94465 Load Address: 80008000 20: 06: 21.94465 Entry Point: 80008000 20: 06: 21.94465 Verifying Checksum ... OK 20: 06: 21.94465 XIP Kernel Image ... OK 20: 06: 22.33156 OK 20: 06: 22.33156 20: 06: 22.33156 Starting kernel ... 20: 06: 22.33156 20: 06: 22.33157 Uncompressing Linux ... done, booting the kernel. 20: 06: 22.99351 - runit: $! Id: 25da3b86f7bed4038b8a039d2f8e8c9bbcf0822b $: booting. 20: 06: 22.99351 - runit: enter stage: / etc / runit / 1 20: 06: 24.07955 - runit: leave stage: / etc / runit / 1 20: 06: 24.07955 - runit: enter stage: / etc / runit / 2 20: 06: 25.41956 20: 06: 25.41957 Debian GNU / Linux 7.0 x10-02 ttyO0 20: 06: 25.41957 20: 06: 25.41957 x10-02 login:
#!/bin/bash # system one time tasks PATH=/sbin:/bin:/usr/sbin:/usr/bin # re-exec this script with a controlling tty if [ "$(tty)" = "/dev/console" ]; then mountpoint -q /sys || \ mount -t sysfs sys /sys -o nosuid,noexec,nodev mountpoint -q /proc || \ mount -t proc proc /proc -o nosuid,noexec,nodev tty=$(</sys/class/tty/console/active) tty=/dev/${tty##* } exec setsid sh -c "exec bash /etc/runit/1 <$tty >$tty 2>&1" fi trap : INT TSTP QUIT trap 'sulogin -p <>$(tty) 2>&1' ERR mountpoint -q /proc || \ mount -t proc proc /proc -o nosuid,noexec,nodev mountpoint -q /sys || \ mount -t sysfs sys /sys -o nosuid,noexec,nodev mountpoint -q /dev || \ mount -t devtmpfs dev /dev -o mode=0755,nosuid test -e /dev/fd || ln -s /proc/self/fd /dev/fd exec 2> >(sed 's/^/:: /') # set -v . /etc/rc.conf mountpoint -q /run || \ mount -t tmpfs run /run -o mode=0755,nosuid,nodev mountpoint -q /dev || \ mount -t devtmpfs dev /dev -o mode=0755,nosuid mkdir -p -m0755 /run/runit /run/lock /run/user /dev/pts /dev/shm \ /run/network /run/runit mountpoint -q /dev/pts || mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec mountpoint -q /dev/shm || \ mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev mkdir -p -m 0755 /var/lib/supervise mountpoint -q /var/lib/supervise || \ mount -n -t tmpfs tmpfs /var/lib/supervise -o mode=1777,nosuid,nodev #mkdir -p -m 0755 /var/log #mountpoint -q /var/log || \ # mount -n -t tmpfs tmpfs /var/log -o mode=1777,nosuid,nodev mount -o remount,ro / ip link set up dev lo echo $HOSTNAME > /proc/sys/kernel/hostname mount -o remount,rw / mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev #cp /var/lib/random-seed /dev/urandom &>/dev/null || true #( umask 077; dd if=/dev/urandom of=/var/lib/random-seed count=1 #bs=512 &>/dev/n ull ) install -m0664 -o root -g utmp /dev/null /var/run/utmp install -m0 /dev/null /run/runit/stopit install -m0 /dev/null /run/runit/reboot install -m0644 -o root -g utmp /dev/null /var/log/lastlog dmesg > /var/log/dmesg
#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin exec 2> >(sed 's/^/:: /') # set -v . /etc/rc.conf # sysctl --system for i in ${DAEMONS[@]}; do d=/var/lib/supervise/${i} mkdir -p $d ${d}.log l=/var/log/${i} mkdir -p $l done exec env - PATH=$PATH \ runsvdir -P /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
#!/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin exec 2> >(sed 's/^/:: /') # set -v LAST=0 test -x /etc/runit/reboot && LAST=6 echo 'Waiting for services to stop...' sv -w196 force-stop /etc/service/* sv exit /etc/service/* stty onlcr echo Shutdown... udevadm control --exit killall5 -15 i=10; while killall5 -18 && (( i-- )) ; do echo -n .; sleep 0.5; done; echo killall5 -9 umount /tmp mount -o remount,ro / sleep 1 sync
Source: https://habr.com/ru/post/264263/
All Articles