File README changed (mode: 100644) (index f04e1ce..396fe3d) |
... |
... |
Configure in conf.mk, then run make and follow the instruction. |
3 |
3 |
The scsi_scan_wait, is a module that will hold while loading until the scsi |
The scsi_scan_wait, is a module that will hold while loading until the scsi |
4 |
4 |
async scan is complete. You can remove it once done. |
async scan is complete. You can remove it once done. |
5 |
5 |
|
|
6 |
|
This is a toolbox to build a combine initramfs and main init process. |
|
|
6 |
|
This is a toolbox to build a combined initramfs and main init process. |
|
7 |
|
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. |
7 |
10 |
|
|
8 |
11 |
coding style is c99 compact: |
coding style is c99 compact: |
9 |
12 |
- indent is 2 spaces |
- indent is 2 spaces |
File init.c changed (mode: 100644) (index b999a45..ef0997f) |
... |
... |
static k_i sysinit_clone(void) |
102 |
102 |
|
|
103 |
103 |
if(r) return (k_i)r; |
if(r) return (k_i)r; |
104 |
104 |
|
|
|
105 |
|
k_ul mask=(~0); |
|
106 |
|
r=sysc(rt_sigprocmask,4,K_SIG_UNBLOCK,&mask,0,sizeof(mask)); |
|
107 |
|
if(K_ISERR(r)){ |
|
108 |
|
OUT("ERROR(%ld):unable to unblock all signals for sysinit\n",r); |
|
109 |
|
sysc(exit_group,1,-1); |
|
110 |
|
} |
|
111 |
|
|
105 |
112 |
r=sysc(execve,4,SYSINIT,0,0,0); |
r=sysc(execve,4,SYSINIT,0,0,0); |
106 |
113 |
if(K_ISERR(r)) |
if(K_ISERR(r)) |
107 |
114 |
OUT("ERROR(%ld):unable to run " SYSINIT "\n",r); |
OUT("ERROR(%ld):unable to run " SYSINIT "\n",r); |
|
... |
... |
static k_i getty_spawn(k_u8 *tty) |
114 |
121 |
OUT(PRE "getty %s...\n",tty); |
OUT(PRE "getty %s...\n",tty); |
115 |
122 |
k_l r=sysc(clone,5,K_SIGCHLD,0,0,0,0); |
k_l r=sysc(clone,5,K_SIGCHLD,0,0,0,0); |
116 |
123 |
if(K_ISERR(r)){ |
if(K_ISERR(r)){ |
117 |
|
OUT("ERROR(%ld):unable to clone for getty\n",r); |
|
|
124 |
|
OUT("ERROR(%ld):unable to clone for getty(%s)\n",r,tty); |
118 |
125 |
sysc(exit_group,1,-1); |
sysc(exit_group,1,-1); |
119 |
126 |
} |
} |
120 |
127 |
|
|
121 |
128 |
if(r) return r; |
if(r) return r; |
122 |
129 |
|
|
|
130 |
|
k_ul mask=(~0); |
|
131 |
|
r=sysc(rt_sigprocmask,4,K_SIG_UNBLOCK,&mask,0,sizeof(mask)); |
|
132 |
|
if(K_ISERR(r)){ |
|
133 |
|
OUT("ERROR(%ld):unable to unblock all signals for getty(%s) clone\n",r,tty); |
|
134 |
|
sysc(exit_group,1,-1); |
|
135 |
|
} |
|
136 |
|
|
123 |
137 |
r=sysc(setsid,0); |
r=sysc(setsid,0); |
124 |
138 |
if(K_ISERR(r)){ |
if(K_ISERR(r)){ |
125 |
|
OUT("ERROR(%ld):unable to setsid the getty clone\n",r); |
|
|
139 |
|
OUT("ERROR(%ld):unable to setsid the getty(%s) clone\n",r,tty); |
126 |
140 |
sysc(exit_group,1,-1); |
sysc(exit_group,1,-1); |
127 |
141 |
} |
} |
128 |
142 |
|
|
129 |
143 |
k_u8 *argv[]={(k_u8*)"/sbin/agetty",tty,0}; |
k_u8 *argv[]={(k_u8*)"/sbin/agetty",tty,0}; |
130 |
144 |
r=sysc(execve,4,"/sbin/agetty",argv,0,0); |
r=sysc(execve,4,"/sbin/agetty",argv,0,0); |
131 |
145 |
if(K_ISERR(r)){ |
if(K_ISERR(r)){ |
132 |
|
OUT("ERROR(%ld):unable to run /sbin/agetty on %s\n",r,tty); |
|
|
146 |
|
OUT("ERROR(%ld):unable to run /sbin/agetty(%s)\n",r,tty); |
133 |
147 |
sysc(exit_group,1,-1); |
sysc(exit_group,1,-1); |
134 |
148 |
} |
} |
135 |
149 |
__builtin_unreachable(); |
__builtin_unreachable(); |