List of commits:
Subject Hash Author Date (UTC)
/sbin to /bin 5031de4134243797ac2ab9f85262040098ca1bfe Sylvain BERTRAND 2015-02-14 23:29:30
use a real life sysstart 28421b744d0937334e1e0254dff39f45e7d4480d Sylvain BERTRAND 2015-01-20 17:44:51
remove some bash-ism 688ff57cfe8077c235a5ec485ba6b72b0d066dc4 Sylvain BERTRAND 2015-01-07 00:39:53
add some examples 4c3c939272dde88eee1242955d1a7832612d4bbb Sylvain BERTRAND 2014-12-08 17:29:16
Initial commit c72c14065b547486a05ade1b5975e3a1deaf9d18 Sylvain BERTRAND 2014-12-08 15:27:00
Commit 5031de4134243797ac2ab9f85262040098ca1bfe - /sbin to /bin
Author: Sylvain BERTRAND
Author date (UTC): 2015-02-14 23:29
Committer name: Sylvain BERTRAND
Committer date (UTC): 2015-02-14 23:29
Parent(s): 28421b744d0937334e1e0254dff39f45e7d4480d
Signing key:
Tree: 28430b610eabcf07b28e7fb65cc59021afe61b67
File Lines added Lines deleted
init.c 10 10
File init.c changed (mode: 100644) (index e37d414..8651c40)
... ... static i sysstart_clone(void)
35 35 l r; l r;
36 36 ul mask; ul mask;
37 37
38 OUT(PRE "clone and execve /sbin/sysstart...\n");
38 OUT(PRE "clone and execve /bin/sysstart...\n");
39 39 r=clone(SIGCHLD); r=clone(SIGCHLD);
40 40 if(ISERR(r)){ if(ISERR(r)){
41 OUT("ERROR(%ld):unable to clone sysinit for /sbin/sysstart\n",r);
41 OUT("ERROR(%ld):unable to clone sysinit for /bin/sysstart\n",r);
42 42 exit_group(-1); exit_group(-1);
43 43 } }
44 44
 
... ... static i sysstart_clone(void)
47 47 mask=(~0); mask=(~0);
48 48 r=rt_sigprocmask(SIG_UNBLOCK,&mask,sizeof(mask)); r=rt_sigprocmask(SIG_UNBLOCK,&mask,sizeof(mask));
49 49 if(ISERR(r)){ if(ISERR(r)){
50 OUT("ERROR(%ld):unable to unblock all signals for /sbin/sysstart\n",r);
50 OUT("ERROR(%ld):unable to unblock all signals for /bin/sysstart\n",r);
51 51 exit_group(-1); exit_group(-1);
52 52 } }
53 53
54 r=execve("/sbin/sysstart",0);
55 if(ISERR(r)) {OUT("ERROR(%ld):unable to execve /sbin/sysstart\n",r);}
54 r=execve("/bin/sysstart",0);
55 if(ISERR(r)) {OUT("ERROR(%ld):unable to execve /bin/sysstart\n",r);}
56 56 exit_group(-1); exit_group(-1);
57 57 #ifdef __GNUC__ #ifdef __GNUC__
58 58 return 0;/*unreachable not detected at the end of function*/ return 0;/*unreachable not detected at the end of function*/
 
... ... static i getty_spawn(void *tty)
64 64 { {
65 65 l r; l r;
66 66 ul mask; ul mask;
67 void *argv[]={"/sbin/agetty",tty,0};/*0 for envp is not "portable"*/
67 void *argv[]={"/bin/agetty",tty,0};/*0 for envp is not "portable"*/
68 68
69 69 OUT(PRE "getty %s...\n",tty); OUT(PRE "getty %s...\n",tty);
70 70
 
... ... static i getty_spawn(void *tty)
89 89 exit_group(-1); exit_group(-1);
90 90 } }
91 91
92 r=execve("/sbin/agetty",argv);
93 if(ISERR(r)) {OUT("ERROR(%ld):unable to run /sbin/agetty(%s)\n",r,tty);}
92 r=execve("/bin/agetty",argv);
93 if(ISERR(r)) {OUT("ERROR(%ld):unable to run /bin/agetty(%s)\n",r,tty);}
94 94 exit_group(-1); exit_group(-1);
95 95 #ifdef __GNUC__ #ifdef __GNUC__
96 96 return 0;/*unreachable not detected at the end of function*/ return 0;/*unreachable not detected at the end of function*/
 
... ... static void sysstart(void)
103 103 i pid=sysstart_clone(); i pid=sysstart_clone();
104 104 l r=waitid(P_PID,pid,0,WEXITED); l r=waitid(P_PID,pid,0,WEXITED);
105 105 if(ISERR(r)){ if(ISERR(r)){
106 OUT("ERROR(%ld):unable to wait for /sbin/sysstart to exit\n",r);
106 OUT("ERROR(%ld):unable to wait for /bin/sysstart to exit\n",r);
107 107 exit_group(-1); exit_group(-1);
108 108 } }
109 109 } }
 
... ... static void main_loop(void)
131 131 struct siginfo siginfo; struct siginfo siginfo;
132 132 l r=waitid(P_ALL,0,&siginfo,WEXITED); l r=waitid(P_ALL,0,&siginfo,WEXITED);
133 133 if(ISERR(r)){ if(ISERR(r)){
134 OUT("ERROR(%ld):unable to wait on /sbin/agetty clone and orphan process terminations\n",r);
134 OUT("ERROR(%ld):unable to wait on /bin/agetty clone and orphan process terminations\n",r);
135 135 exit_group(-1); exit_group(-1);
136 136 } }
137 137 if(siginfo.fields.sigchld.pid==tty1) tty1=getty_spawn("tty1"); if(siginfo.fields.sigchld.pid==tty1) tty1=getty_spawn("tty1");
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/muinit

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

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

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