NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

init.root (chroot) and ttys



Hi all,

I have recently attempted to use the init.root sysctl to define a chroot
environment from init to run a NetBSD system from a vnd device. This is
*briefly* described in a thread found (For use with a cgd device):
http://mail-index.netbsd.org/tech-userlevel/2005/05/15/0000.html

Or the entire thread (PATCH: init(8) - multiuser under chroot):
http://osdir.com/ml/netbsd.devel.userlevel/2005-05/threads.html#00044

Reading the thread where the patch was provided: "Due to limited
interface of gettyent() and friends, we use /etc/ttys and _not_
${chroot}/etc/ttys."

I experienced this problem, and was required to add /etc/ttys file to my
minimal "original root" filesystem. Then after that there were
complaints about utmp records (and a few other things), so i added the
following to the "original root" too:
/var/run/utmp
/var/run/utmpx
/var/log/wtmp
/var/log/wtmpx
/var/log/lastlog
/var/log/lastlogx

So after those changes it gets a bit further but the kernel-panics with
the following errors (When getty is started i think):
init: can't add utmpx record for 'system boot': Bad file descriptor
init: can't add utmpx record for 'runlevel': Undefined error 0
init: can't add utmpx record for 'console': Bad file descriptor
followed by a kernel panic.

Can anyone point me in the right direction where i can find information
about configuring such a system? Google does not seem to produce much
for me when searching for init.root and i cant find it in the
documentation anywhere. Do i need to null mount things like /dev from my
"original root" into my new root or something like that?

Thanks,
Brendon.



Home | Main Index | Thread Index | Old Index