File README changed (mode: 100644) (index 5f453dc..0f3164a) |
... |
... |
of /sbin/agetty, but can just "wait" on orphan processes (--no-tty option). |
3 |
3 |
Before that, it will execve|run /sbin/sysstart to start the operating system |
Before that, it will execve|run /sbin/sysstart to start the operating system |
4 |
4 |
and wait for its completion. |
and wait for its completion. |
5 |
5 |
|
|
|
6 |
|
See some examples of shell script to start/stop a linux box in script |
|
7 |
|
directory. Don't forget to have linux binfmt_script support:module is loaded |
|
8 |
|
by early userspace, or it's built-in. |
|
9 |
|
|
6 |
10 |
No libc dependency (Oh... Yeaah!). Only a super thin wrapper layer, ulinux. |
No libc dependency (Oh... Yeaah!). Only a super thin wrapper layer, ulinux. |
7 |
11 |
|
|
8 |
12 |
See ./make --help (you should have all required options for cross compiling |
See ./make --help (you should have all required options for cross compiling |
File script/sysstart added (mode: 100755) (index 0000000..a325ab5) |
|
1 |
|
#!/bin/sh |
|
2 |
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin |
|
3 |
|
|
|
4 |
|
mount -o nosuid,nodev,noexec,relatime -t proc proc /proc |
|
5 |
|
mount -o nosuid,nodev,noexec,relatime -t sysfs sysfs /sys |
|
6 |
|
|
|
7 |
|
#------------------------------------------------------------------------------- |
|
8 |
|
#mount /dev |
|
9 |
|
mount -o exec,nosuid,relatime,size=10M,mode=0755 -t devtmpfs udev /dev |
|
10 |
|
|
|
11 |
|
mkdir -m 0755 -p /dev/pts |
|
12 |
|
mount -o relatime,gid=5,mode=0620 -t devpts devpts /dev/pts |
|
13 |
|
|
|
14 |
|
mkdir -m 1777 -p /dev/shm |
|
15 |
|
mount -o nosuid,nodev,noexec,relatime -t tmpfs shm /dev/shm |
|
16 |
|
#------------------------------------------------------------------------------- |
|
17 |
|
|
|
18 |
|
mount -o nosuid,nodev,relatime,mode=0755 -t tmpfs tmpfs /run |
|
19 |
|
rm -Rf /tmp/* |
|
20 |
|
rm -Rf /tmp/.?* |
|
21 |
|
hostname "amddev" |
|
22 |
|
|
|
23 |
|
#------------------------------------------------------------------------------- |
|
24 |
|
#mudev |
|
25 |
|
modprobe unix |
|
26 |
|
rm -Rf /run/udev |
|
27 |
|
echo "" >/sys/kernel/uevent_helper |
|
28 |
|
udevd --daemon |
|
29 |
|
udevadm trigger --type=subsystems --action=add |
|
30 |
|
udevadm trigger --type=devices --action=add |
|
31 |
|
|
|
32 |
|
#those modules need /dev nodes |
|
33 |
|
modprobe rtc-cmos |
|
34 |
|
|
|
35 |
|
udevadm settle |
|
36 |
|
#------------------------------------------------------------------------------- |
|
37 |
|
|
|
38 |
|
#------------------------------------------------------------------------------- |
|
39 |
|
#usb |
|
40 |
|
modprobe ehci-hcd |
|
41 |
|
modprobe ohci-hcd |
|
42 |
|
modprobe usbhid |
|
43 |
|
modprobe evdev |
|
44 |
|
#------------------------------------------------------------------------------- |
|
45 |
|
|
|
46 |
|
#------------------------------------------------------------------------------- |
|
47 |
|
#network, could be NetworkManager (KLUDGE!), or a simple dhcp client, or IPv6 |
|
48 |
|
#autoconfiguration... |
|
49 |
|
ip addr add 127.0.0.1/8 dev lo |
|
50 |
|
ip addr add 192.168.1.5/24 dev eth0 |
|
51 |
|
ip link set dev lo up |
|
52 |
|
ip link set dev eth0 up |
|
53 |
|
ip route add default via 192.168.1.1 dev eth0 |
|
54 |
|
#------------------------------------------------------------------------------- |
|
55 |
|
|
|
56 |
|
#------------------------------------------------------------------------------- |
|
57 |
|
#CPUs |
|
58 |
|
#BROKEN ON linux 3.15.3 |
|
59 |
|
#modprobe acpi-cpufreq |
|
60 |
|
#modprobe cpufreq_ondemand |
|
61 |
|
#cpufreq-set --cpu 0 --governor ondemand |
|
62 |
|
#cpufreq-set --cpu 1 --governor ondemand |
|
63 |
|
#------------------------------------------------------------------------------- |
|
64 |
|
|
|
65 |
|
hwclock --utc --hctosys |
|
66 |
|
|
|
67 |
|
#------------------------------------------------------------------------------- |
|
68 |
|
#block scheduler, for a SSD drive, cfq I/O scheduler is useless |
|
69 |
|
#modprobe cfq-iosched |
|
70 |
|
#echo "cfq" > /sys/block/sda/queue/scheduler |
|
71 |
|
#------------------------------------------------------------------------------- |
|
72 |
|
|
|
73 |
|
#------------------------------------------------------------------------------- |
|
74 |
|
#utmp/wtmp (I don't even use that stuff anymore, just for reference) |
|
75 |
|
: >/var/run/utmp |
|
76 |
|
chgrp utmp /var/run/utmp 2>/dev/null |
|
77 |
|
chmod 0664 /var/run/utmp |
|
78 |
|
if test ! -e /var/log/wtmp; then |
|
79 |
|
: >/var/log/wtmp |
|
80 |
|
chgrp utmp /var/log/wtmp 2>/dev/null |
|
81 |
|
chmod 0664 /var/log/wtmp |
|
82 |
|
fi |
|
83 |
|
#------------------------------------------------------------------------------- |
|
84 |
|
|
|
85 |
|
#------------------------------------------------------------------------------- |
|
86 |
|
syslog-ng & |
|
87 |
|
chronyd & |
|
88 |
|
/usr/libexec/fcron & |
|
89 |
|
/usr/sbin/sshd & |
|
90 |
|
#------------------------------------------------------------------------------- |
File script/sysstop added (mode: 100755) (index 0000000..6994645) |
|
1 |
|
#!/bin/sh |
|
2 |
|
trap - INT QUIT TERM |
|
3 |
|
|
|
4 |
|
if test -e /run/chronyd.pid; then |
|
5 |
|
/usr/bin/pkill --pidfile /run/chronyd.pid |
|
6 |
|
else |
|
7 |
|
echo "missing /run/chronyd.pid" 1>&2 |
|
8 |
|
fi |
|
9 |
|
|
|
10 |
|
if test -e /var/run/fcron.pid; then |
|
11 |
|
/usr/bin/pkill --pidfile /var/run/fcron.pid |
|
12 |
|
else |
|
13 |
|
echo "missing /var/run/fcron.pid" 1>&2 |
|
14 |
|
fi |
|
15 |
|
|
|
16 |
|
#we used static configuration, hence no dhcp client |
|
17 |
|
#/sbin/dhcpcd --exit |
|
18 |
|
|
|
19 |
|
if test -e /var/run/syslog-ng.pid; then |
|
20 |
|
/usr/bin/pkill --pidfile /var/run/syslog-ng.pid |
|
21 |
|
else |
|
22 |
|
echo "missing /var/run/syslog-ng.pid" 1>&2 |
|
23 |
|
fi |
|
24 |
|
|
|
25 |
|
/sbin/udevadm control --exit |
|
26 |
|
/sbin/hwclock --utc --systohc |
|
27 |
|
|
|
28 |
|
/bin/sync |
|
29 |
|
|
|
30 |
|
if test "$(basename $0)" = "sysreboot"; then |
|
31 |
|
/sbin/reboot -f |
|
32 |
|
fi |
|
33 |
|
|
|
34 |
|
/sbin/poweroff -f |