List of commits:
Subject Hash Author Date (UTC)
init have more children than gettys 57f4231ffd8e97b7511226bfc4f058e0814a4e8e Sylvain BERTRAND 2012-01-31 13:10:32
clean sigprogmask for children 89a379820196e9a4de7d6bf38ec49a679f9de917 Sylvain BERTRAND 2012-01-31 12:52:11
ready to be used 51f3d5adedf51ab5b47a61724035141bcbb71354 Sylvain BERTRAND 2012-01-30 15:27:56
ready, now need to know why init libc is crashing 39e165e544af1632e0d1926a686173e8b7543bdd Sylvain BERTRAND 2011-12-30 02:35:57
uevents cleanup 082938475c119d68ce5def18a1c21f69c596b1a1 Sylvain BERTRAND 2011-12-26 23:32:00
uevent monitor to ulinux patterns e9e2e03953d3a28e08aeb3a7388b334cda8a8479 Sylvain BERTRAND 2011-12-26 22:38:45
modules properly loaded ac79794945662bad9e97562c479dea5afe455687 Sylvain BERTRAND 2011-12-26 22:08:54
ulinux patterns: insert a kernel module ed879829ce6c44b77bddcd9c106a106261f47301 Sylvain BERTRAND 2011-12-26 21:29:33
ulinux dir_parse pattern 63cc7acc186efc291a76255e97d86e80901174e5 Sylvain BERTRAND 2011-12-26 02:24:55
ulinux improvements and more patterns a458c52301d3a34e8b51794fea7c1cb06c1c34f8 Sylvain BERTRAND 2011-12-22 22:09:06
ulinux patterns:network server 60c167bcd530f95d0a57189035620c3bc80f1e34 Sylvain BERTRAND 2011-12-20 00:39:56
ulinux cleanup and samples 92c893f28ef42f11943c0bf80a037a5b5f34ebef Sylvain BERTRAND 2011-12-16 01:51:22
uevent listener 55657699f291575139858aec466340e7624cd66a Sylvain BERTRAND 2011-12-15 18:01:06
uevent monitor e241bd4db4af8510902a5c606eee0e1e2dbdecda Sylvain BERTRAND 2011-12-13 00:37:45
block signals 91772917669645b5634563d0c06e361c87cf3e84 Sylvain BERTRAND 2011-12-09 17:04:34
initial commit 5310fde2d021e3505f8f1d5d9091726c236967ec Sylvain BERTRAND 2011-12-07 11:29:18
Commit 57f4231ffd8e97b7511226bfc4f058e0814a4e8e - init have more children than gettys
Author: Sylvain BERTRAND
Author date (UTC): 2012-01-31 13:10
Committer name: Sylvain BERTRAND
Committer date (UTC): 2012-01-31 13:10
Parent(s): 89a379820196e9a4de7d6bf38ec49a679f9de917
Signing key:
Tree: c31ccafe998b2c7d9b1bf78e728547903cbb8fe6
File Lines added Lines deleted
README 3 2
init.c 1 5
script/example_init.sh 104 0
script/example_shutdown.sh 12 0
File README changed (mode: 100644) (index 396fe3d..cad49c8)
... ... async scan is complete. You can remove it once done.
5 5
6 6 This is a toolbox to build a combined initramfs and main init process. This is a toolbox to build a combined initramfs and main init process.
7 7 During early user space, it loads the modules requiered to mount the root file During early user space, it loads the modules requiered to mount the root file
8 system, then it runs a process of your choice which will init the system, to
9 finally spawns some gettys on ttys, respawning them when they die.
8 system, then it runs a process of your choice which will init the system (see
9 examples in script dir), to finally spawns some gettys on ttys, respawning them
10 when they die.
10 11
11 12 coding style is c99 compact: coding style is c99 compact:
12 13 - indent is 2 spaces - indent is 2 spaces
File init.c changed (mode: 100644) (index ef0997f..3989b58)
... ... static void loop(void)
172 172 } }
173 173 if(siginfo.fields.sigchld.pid==tty1) tty1=getty_spawn((k_u8*)"tty1"); if(siginfo.fields.sigchld.pid==tty1) tty1=getty_spawn((k_u8*)"tty1");
174 174 else if(siginfo.fields.sigchld.pid==tty2) tty2=getty_spawn((k_u8*)"tty2"); else if(siginfo.fields.sigchld.pid==tty2) tty2=getty_spawn((k_u8*)"tty2");
175 else{
176 OUT("ERROR:dead init child(pid=%d) is unknown)\n",
177 siginfo.fields.sigchld.pid);
178 sysc(exit_group,1,-1);
179 }
175 //ignore the other children
180 176 } }
181 177 } }
182 178
File script/example_init.sh added (mode: 100755) (index 0000000..a9caab8)
1 #!/bin/bash --login
2
3 /bin/mount -o nosuid,nodev,noexec,relatime -t proc proc /proc
4 /bin/mount -o nosuid,nodev,noexec,relatime -t sysfs sysfs /sys
5
6 #-------------------------------------------------------------------------------
7 #mount /dev
8 /bin/mount -o exec,nosuid,relatime,size=10M,mode=0755 -t tmpfs udev /dev
9
10 [ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
11 [ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
12 [ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
13
14 #udevd will dup its stdin/stdout/stderr to /dev/null
15 #and we do not want a file which gets buffered in ram
16 [ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
17
18 # so udev can add its start-message to dmesg
19 [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
20
21 /bin/mkdir -m 0755 -p /dev/pts
22 /bin/mount -o relatime,gid=5,mode=0620 -t devpts devpts /dev/pts
23
24 #may be useless
25 /bin/mkdir -m 1777 -p /dev/shm
26 /bin/mount -o nosuid,nodev,noexec,relatime -t tmpfs shm /dev/shm
27 #-------------------------------------------------------------------------------
28
29 /bin/mount -o nosuid,nodev,relatime,mode=0755 -t tmpfs tmpfs /run
30 /bin/rm -Rf /tmp/*
31 /bin/hostname "freedom"
32
33 #-------------------------------------------------------------------------------
34 #udev
35 /sbin/modprobe unix
36 /bin/rm -Rf /run/udev
37 echo "" >/sys/kernel/uevent_helper
38 /sbin/udevd --daemon
39 /sbin/udevadm trigger --type=subsystems --action=add
40 /sbin/udevadm trigger --type=devices --action=add
41
42 #those modules need /dev nodes
43 /sbin/modprobe rtc-cmos
44 /sbin/modprobe radeon
45 /sbin/modprobe fbcon
46
47 /sbin/udevadm settle
48 #-------------------------------------------------------------------------------
49
50 #-------------------------------------------------------------------------------
51 #network
52 /sbin/modprobe sch-dsmark
53 /sbin/ip addr add 127.0.0.1/8 dev lo
54 /sbin/ip addr add 192.168.1.2/24 dev eth0
55 #-------------------------------------------------------------------------------
56
57 #-------------------------------------------------------------------------------
58 #CPUs
59 /sbin/modprobe -r microcode
60 /sbin/modprobe microcode
61 /sbin/modprobe powernow-k8
62 /usr/bin/cpufreq-set --related --governor ondemand
63 #-------------------------------------------------------------------------------
64
65 #-------------------------------------------------------------------------------
66 /sbin/hwclock --utc --hctosys
67 #-------------------------------------------------------------------------------
68
69 /usr/sbin/alsactl restore
70
71 #-------------------------------------------------------------------------------
72 #block scheduler
73 /sbin/modprobe cfq-iosched
74 echo "cfq" > /sys/block/sda/queue/scheduler
75 #-------------------------------------------------------------------------------
76
77 /sbin/swapon -a
78 /sbin/sysctl
79
80 #-------------------------------------------------------------------------------
81 #console terminal setup
82 printf "\033%s" "%G" >/dev/tty1
83 /usr/bin/kbd_mode -u -C /dev/tty1
84 printf "\033%s" "%G" >/dev/tty2
85 /usr/bin/kbd_mode -u -C /dev/tty2
86 printf "\033%s" "%G" >/dev/tty3
87 /usr/bin/kbd_mode -u -C /dev/tty3
88 /usr/bin/loadkeys -q dvorak
89 #-------------------------------------------------------------------------------
90
91 #-------------------------------------------------------------------------------
92 #utmp/wtmp
93 : >/var/run/utmp
94 /bin/chgrp utmp /var/run/utmp 2>/dev/null
95 /bin/chmod 0664 /var/run/utmp
96 if test ! -e /var/log/wtmp; then
97 : >/var/log/wtmp
98 /bin/chgrp utmp /var/log/wtmp 2>/dev/null
99 /bin/chmod 0664 /var/log/wtmp
100 fi
101 #-------------------------------------------------------------------------------
102
103 /usr/sbin/syslog-ng
104 /usr/sbin/fcron
File script/example_shutdown.sh added (mode: 100755) (index 0000000..3587caa)
1 #!/bin/bash
2 /usr/sbin/alsactl store
3 /sbin/hwclock --utc --systohc
4
5 /bin/sync
6 if test $0 = "reboot.sh"; then
7 /sbin/reboot -f
8 fi
9
10 if test $0 = "poweroff.sh"; then
11 /sbin/poweroff -f
12 fi
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/cinitramfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/cinitramfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/cinitramfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main