4c2c7b2c94
If the environment doesn't offer a working /dev/console, the existing version of init(8) will simply refuse running rc(8) scripts. This means you'll only have a system running init(8) and nothing else. Change the code to do the following: - Open /dev/console like we used to do, but make it more robust to use O_NONBLOCK to prevent blocking on a carrier. - If this fails, use /dev/null as stdin and /var/log/init.log as stdout and stderr. - If even this fails, use /dev/null as stdin, stdout and stderr. So why us this useful? Well, if you remove the `getpid() == 1' check in main(), you can now use init(8) inside jails to properly execute rc(8). It still requires some polishing, as existing tools assume init(8) has PID 1. Also it is now possible to use use init(8) on `headless' devices that don't even have a serial boot console. |
||
---|---|---|
.. | ||
bluetooth | ||
defaults | ||
devd | ||
etc.amd64 | ||
etc.arm | ||
etc.i386 | ||
etc.ia64 | ||
etc.mips | ||
etc.pc98 | ||
etc.powerpc | ||
etc.sparc64 | ||
gss | ||
mtree | ||
namedb | ||
pam.d | ||
periodic | ||
ppp | ||
rc.d | ||
root | ||
sendmail | ||
amd.map | ||
apmd.conf | ||
auth.conf | ||
crontab | ||
csh.cshrc | ||
csh.login | ||
csh.logout | ||
ddb.conf | ||
devd.conf | ||
devfs.conf | ||
dhclient.conf | ||
disktab | ||
fbtab | ||
freebsd-update.conf | ||
ftpusers | ||
gettytab | ||
group | ||
hosts | ||
hosts.allow | ||
hosts.equiv | ||
hosts.lpd | ||
inetd.conf | ||
libalias.conf | ||
login.access | ||
login.conf | ||
mac.conf | ||
Makefile | ||
man.alias | ||
master.passwd | ||
minfree | ||
motd | ||
netconfig | ||
netstart | ||
network.subr | ||
networks | ||
newsyslog.conf | ||
nls.alias | ||
nscd.conf | ||
nsmb.conf | ||
nsswitch.conf | ||
ntp.conf | ||
opieaccess | ||
pccard_ether | ||
pf.os | ||
phones | ||
portsnap.conf | ||
printcap | ||
profile | ||
protocols | ||
rc | ||
rc.bsdextended | ||
rc.firewall | ||
rc.initdiskless | ||
rc.resume | ||
rc.sendmail | ||
rc.shutdown | ||
rc.subr | ||
rc.suspend | ||
regdomain.xml | ||
remote | ||
rpc | ||
services | ||
shells | ||
snmpd.config | ||
sysctl.conf | ||
syslog.conf | ||
termcap.small |