Skip to content

Comment on Revisiting the NetBSD Build Systemparent

Comments

why would you even need root to compile an OS

Usually it's to make it easier dealing with file system ("disk") image files, which may require root privileges to mount and use with regular programs (though FUSE and similar subsystems can help.) In a mounted filesystem, root privileges may be required to set permission bits like setuid.

The NetBSD toolchain probably includes utilities to make it easy to copy data in and out of file system images, ideally concurrently and without corruption.

In addition to building filesystem images, a common use of root for operating system building is to chroot into a "clean" environment to avoid environmental corruption. (In general, chroot is reserved to uid 0 due to issues with setuid binaries -- on some systems chroot can be made available to non-root users by turning off setuid behaviour.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.