Continuing yesterday's thread: we left off with dinit launching, but /etc being messed up.
I fixed /etc! The trick ended up mounting shit on top of each other after chrooting.
Next step: make the netbsd core stuff read-only.
Discussion
Continuing yesterday's thread: we left off with dinit launching, but /etc being messed up.
I fixed /etc! The trick ended up mounting shit on top of each other after chrooting.
Next step: make the netbsd core stuff read-only.
This is more complicated than anticipated! Setting up the network is non-trivial work.
I might cheat there a bit.
Lets go with even smaller steps... first: adjust dinit to take care of mounting the necessary kernel filesystems like /proc, /kern, etc.
Done!
Now we'll do a bit of cheating.
Oh. I need to do the /var mounting sooner, because dhcpcd requires that.
Hrm. /etc/rc.d/dhcpcd onestart runs, but doesn't get an IP.
Aand I have network!
Uhhuh. Hm. Users will be a bit of a bother in the longer run, because the passwords are in a binary thingamajiggy. But for now, I'll shove it onto persistence.
Haha. Funny. I have no $HOME and I want to scream.
In the long run, $HOME will be tmpfs too - but not today yet.
$HOME sweet $HOME.
❯ ssh carrot -- pwd
/sexshop/bdsm/homes/algernon
I could null-mount it, so it would appear as /home/algernon, but... I like it this way.
Now to set -o hidden for most of the null mounts, because...
❯ ssh carrot -- df -h
Filesystem Size Used Avail %Cap Mounted on
tmpfs 4.0M 12K 4.0M 1% /
/dev/dk0 9.7G 1.0G 8.2G 11% /sexshop/bondage
/dev/dk2 39G 28M 37G 1% /sexshop/toys
/dev/dk3 39G 3.3M 37G 1% /sexshop/bdsm
/sexshop/bondage/dev 9.7G 1.0G 8.2G 11% /dev
/sexshop/bondage/bin 9.7G 1.0G 8.2G 11% /bin
/sexshop/bondage/sbin 9.7G 1.0G 8.2G 11% /sbin
/sexshop/bondage/lib 9.7G 1.0G 8.2G 11% /lib
/sexshop/bondage/libdata 9.7G 1.0G 8.2G 11% /libdata
/sexshop/bondage/libexec 9.7G 1.0G 8.2G 11% /libexec
/sexshop/bondage/usr/bin 9.7G 1.0G 8.2G 11% /usr/bin
/sexshop/bondage/usr/sbin 9.7G 1.0G 8.2G 11% /usr/sbin
/sexshop/bondage/usr/include 9.7G 1.0G 8.2G 11% /usr/include
/sexshop/bondage/usr/lib 9.7G 1.0G 8.2G 11% /usr/lib
/sexshop/bondage/usr/libdata 9.7G 1.0G 8.2G 11% /usr/libdata
/sexshop/bondage/usr/libexec 9.7G 1.0G 8.2G 11% /usr/libexec
/sexshop/bondage/usr/mdec 9.7G 1.0G 8.2G 11% /usr/mdec
/sexshop/bondage/usr/share 9.7G 1.0G 8.2G 11% /usr/share
/sexshop/bondage/rescue 9.7G 1.0G 8.2G 11% /rescue
<above>:/sexshop/bdsm/system/etc 40G 1.0G 37G 3% /sexshop/bondage/etc
tmpfs 4.0G 0B 4.0G 0% /tmp
kernfs 1.0K 1.0K 0B 100% /kern
procfs 4.0K 4.0K 0B 100% /proc
ptyfs 1.0K 1.0K 0B 100% /dev/pts
<above>:/sexshop/bdsm/system/var 40G 1.0G 37G 3% /sexshop/bondage/var
This is very silly.
❯ ssh carrot -- df -h
Filesystem Size Used Avail %Cap Mounted on
tmpfs 4.0M 12K 4.0M 1% /
/dev/dk0 9.7G 1.0G 8.2G 11% /sexshop/bondage
/dev/dk2 39G 28M 37G 1% /sexshop/toys
/dev/dk3 39G 3.3M 37G 1% /sexshop/bdsm
procfs 4.0K 4.0K 0B 100% /proc
tmpfs 4.0G 0B 4.0G 0% /tmp
ptyfs 1.0K 1.0K 0B 100% /dev/pts
kernfs 1.0K 1.0K 0B 100% /kern
/dev/dk4 93G 14G 74G 17% /legacy
Much better.
Next thing to fix: rebooting. Need to do the filesystem unmount dance there.
Would also need to fsck the filesystems too...
I'll also need to teach my initrd init to mount filesystems by ID, rather than /dk$N, because /dk$N is discovery ordered, and can vary between reboots.
Aha! getfsspecname(3)!
That was reasonably easy.