HNHacker News
TopNewBestAskShowJobs

zygology

4 karma · joined March 8, 2024

submissionscomments
zygology··on The SpaceX IPO will be the theft of the century
why would i want to take ownership in something that very clearly looks like a scam on paper.

this IPO is to pay debts for failing tech.

zygology··on The SpaceX IPO will be the theft of the century
and it turns out people can be convinced to overpay for hot air and "futurism"

does that make it truly valuable?

zygology··on Now is the best time to be a duct tape engineer
have you considered the ethical implications of vibe coding while controlling a 2 ton projectile around living humans?
zygology··on Uber president says AI spending is getting 'harder to justify'
> you're mocking a sizeable proportion of the commenters on this site.

some would call this god's work

zygology··on Build Initramfs Rootless
My understanding is that pretty much every modern init system has a service for mounting the devtmpfs, even if it's not in the fstab, and depending on the switch_root binary being used, mounts made in the initramfs may or may not be re-mounted in the new root.

You don't even need a devtmpfs in the initramfs environment, and it may or may not even persist into the fully booted system. I believe Systemd has a tmpfs unit file, and OpenRC has a service for it which is enabled by default.

zygology··on Build Initramfs Rootless
It's also easy enough to just add a mount command to your initramfs init, or embed required device nodes in the CPIO.
zygology··on Build Initramfs Rootless
You can't make them on the filesystem itself, gen_init_cpio lets you specify device nodes to be created within the archive, but they are not actually created on the live system and do not require privileges.

I made my own CPIO library: https://github.com/desultory/pycpio and one of the main goals was this behavior, so I could create CPIO archives with device nodes without privileges. It's really as simple as writing some bytes to a file saying "when you extract this, create this device node". It's not like any archive actually has a device node, just instructions for where to put them, and what properties they have.

Certainly, you can't extract these archives as non-root, but you have to go out of your way to make an initramfs have non-root privileges.

zygology··on Build Initramfs Rootless
You don't actually have to make a device node, you can just create it directly within the CPIO archive.
zygology··on Build Initramfs Rootless
I've had good luck making environments in a qemu user chroot, then you can more or less just copy the whole filesystem to a SD card and boot it, considering the boot partition of course.
zygology··on Build Initramfs Rootless
I've been working on this for the last year or so: https://github.com/desultory/ugrd

It's mostly made to work with Gentoo (uses pax-utils for finding dependencies), but should work with any distro. It does most of the initramfs creation process rootless. The main consideration is that you need privileges to make device nodes, but I just create them synthetically within the cpio image.

On most systems, this tool still requires root to copy the mount binary.