HackerTrans
TopNewTrendsCommentsPastAskShowJobs

astralbijection

no profile record

Submissions

curl > /dev/sda: How I made a Linux distro that runs wget | dd

astrid.tech
172 points·by astralbijection·4 เดือนที่ผ่านมา·65 comments

comments

astralbijection
·3 เดือนที่ผ่านมา·discuss
> An archive of files and directories is in itself not a program.

Okay, but you can make the same argument to say that ELF files aren't programs in and of themselves either. In fact, some ELF files are dynamic libraries without an entrypoint, and therefore not actually executable in any meaningful way unless connected to yet another program.

If you can accept that some ELF files are executables and some aren't, then you can also accept that some CPIOs are executables and some aren't. What's the difference between ld.so unpacking an ELF file into RAM and running its entrypoint, and the Linux kernel unpacking an initramfs into RAM and running its entrypoint?
astralbijection
·3 เดือนที่ผ่านมา·discuss
This one is an interpreter for CPIO files.
astralbijection
·3 เดือนที่ผ่านมา·discuss
... I think you're reading a bit much into it. It's less that I couldn't afford to pay that, and more that I didn't want to pay that, and iterating on the solution I used to dodge that led me down a giant rabbit hole of learning more about Linux while solving stupider and stupider problems posed for myself.
astralbijection
·4 เดือนที่ผ่านมา·discuss
I did learn about systemctl switch-root after finishing my kexec solution, but I think if you're at the point of reimaging a server over the network, you probably don't care enough to shut it down correctly :)
astralbijection
·4 เดือนที่ผ่านมา·discuss
Does it make it more cursed that the distro was built off of NixOS Anywhere, and then it theseus shipped NixOS Anywhere out of it?
astralbijection
·4 เดือนที่ผ่านมา·discuss
To be honest, even this has plenty of room to go down. I get the feeling I could have squeezed a couple more MB off if I had actually cut things off of the default Nixpkgs busybox, and possibly also cut a couple of kernel drivers out.
astralbijection
·4 เดือนที่ผ่านมา·discuss
Part 2 presents a fully automated proof of concept that does all of this: https://astrid.tech/2026/03/24/2/how-to-pass-secrets-between...
astralbijection
·4 เดือนที่ผ่านมา·discuss
From what it sounds like, because you have a console and therefore aren't dependent on SSHD not getting overwritten, you can just dd the live running system here?
astralbijection
·4 เดือนที่ผ่านมา·discuss
That script sounds extremely unhinged, and I mean it as a compliment :)

Without spoiling too much, the command at the very end of the series does something adjacent to this.
astralbijection
·4 เดือนที่ผ่านมา·discuss
It does get linked at the very bottom, though admittedly it could be made clearer. https://astrid.tech/2026/03/24/1/swap-out-the-root-before-bo...
astralbijection
·4 เดือนที่ผ่านมา·discuss
All of those things get covered in parts 2, 3, and 4 :)