godarch / distributions

Base images for use in Darch.
https://godarch.com/
11 stars 11 forks source link

Docker Hub images, Void Dockerfile all unusable #8

Closed kwshi closed 3 years ago

kwshi commented 3 years ago

I've been playing with Darch the past few days and trying to get it to work on one of my computers, but I've been unable to get any sort of usable system with Darch so far. In particular, none of the existing pre-built images on Docker Hub (godarch/{void,void-musl,arch,ubuntu,debian}) successfully stage, and while your personal recipes do stage successfully, they result in either an out-of-memory kernel panic or a blank screen for me.

I've included a list of all the different things I've tried so far and what I've found at the bottom. Let me just start by saying thank you for doing this; it's a very cool, attractive project that feels like exactly what I'm looking for (having come from NixOS, I enjoy having reproducible build steps but did not enjoy all the extra Nix layers and the complexity it adds); and thank you for the effort you put into making this accessible to other folks! I also want to say that I don't intend to put any stress/pressure on you to maintain this project and fix all my problems, and I totally understand if you're busy with other things and don't have the time for a project you consider "done"!

So all I ask is this: it would be fantastic if you can help give me some coarse descriptions/point me to some resources about what Linux boot-loading magic (in your words, "special scripts that take into account the kernel, initramfs and root file system") involves and how those steps fit into the Darch staging + booting pipeline. I would love to help out with fixing/updating the documentation and these Dockerfiles (as well as add even more distributions or contribute to Darch V1.0) to make it even more accessible, but I currently have minimal clue how any of this works, so if you can help me get started I'd gladly contribute back!


List of unsuccessful attempts:

kwshi commented 3 years ago

Update: following the "test drive" instructions to pull and run pauldotknopf/darch-arch-base doesn't work either. Pulling fails with a

INFO[0057] apply failure, attempting cleanup        error="failed to extract layer sha256:81e2ef41a8ebca.....: mkparent /var/lib/darch/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/35/fs/usr/lib/systemd/system-generators: not a directory: unknown" key="extract-49363929-2dho sha256:32ac130aa52dff51193......."
darch: failed to unpack image on snapshotter overlayfs: failed to extract layer ........... not a directory: unknown
kwshi commented 3 years ago

Oh well--I have since given up on figuring Darch out, so I'm going to close this issue.

For those still interested in a solution/doing this for their own distro of choice on a UEFI system: I've managed to achieve essentially the same setup as Darch "from scratch", i.e. via manually building a container & exporting the contents to a squashfs live image. The high-level steps are as follows:

  1. Write some Dockerfiles that build an OS image with everything you want installed & configured.
    • It's important that this image also includes "system-level" software not normally found in container images, e.g. bootloaders, kernels, etc.
    • It's also important to configure whatever builds your initramfs (e.g., dracut for Void), to support booting from a live image, by adding to /etc/dracut.conf.d/ a file specifying add_dracutmodules+='dmsquash-live' before dracut is run/installed.
  2. docker run the container to do some last-minute configs, e.g. setting user passwords.
  3. docker export the container to a tar archive; unpack the output to a folder in order to modify the filesystem's etc/hostname (because of how containers work, you can't set hostnames within the container--hence this last-minute hack).
  4. Re-pack the folder contents into a tar archive, with something like tar --xform 's:^\./::' -cf live.tar -C <root-path> ..
  5. Use tar2sqfs to pack the archive into a SquashFS image.
  6. Depending on how your bootloader works, add a bootloader entry to boot from the initramfs & vmlinuz from your extracted filesystem (you'll probably need to copy those into a folder under /boot or whatever your EFI system partition is).

Those instructions are not very detailed and will still require you to do some digging into how to set each part up, but hopefully it gives future hobbyists a solid starting point. I have a repo with the Containerfiles & dotfiles I use to implement this setup; if anyone comes across this and wants me to explain more about how to do this, feel free to open an issue on that repo & I'll be happy to help!