[HN Gopher] Adventures in Creating a Minimal Alpine Linux Installer
       ___________________________________________________________________
        
       Adventures in Creating a Minimal Alpine Linux Installer
        
       Author : bradley_taunt
       Score  : 59 points
       Date   : 2022-12-08 15:28 UTC (7 hours ago)
        
 (HTM) web link (bt.ht)
 (TXT) w3m dump (bt.ht)
        
       | ffhhj wrote:
       | Is there a distribution of Alpine Linux under 50MB (terminal
       | only), iso or raw image, with APK intalled? Every minimal Linux
       | installer brings Busybox without a proper package manager.
        
         | yjftsjthsd-h wrote:
         | I don't understand what you're asking for. Alpine is a Linux
         | distro, and any version of Alpine will have apk, which is a
         | proper package manager. If you just want Alpine with a smaller
         | disk footprint, the big problem is actually drivers, but you
         | can work around that by removing what you don't need. In fact,
         | it appears that the "virt" image - https://dl-
         | cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/... is 49MB,
         | so unless I missed something, what you're asking for exists?
        
       | butz wrote:
       | Has anyone tried running Linux without xorg/xwayland, only pure
       | Wayland?
        
       | LoganDark wrote:
       | I would like to see a glibc version of Alpine.
       | 
       | My favorite feature (the killer feature) of Alpine is that rootfs
       | is not persistent. Persistent storage actually only contains the
       | base system itself and each package you install. On startup, the
       | system is loaded into a tmpfs and all your packages are loaded on
       | top of it. I've successfully created a desktop install using this
       | method, it boots off a USB stick and the only persistent
       | partition is /home. I find the cleanliness of this extremely
       | impressive.
       | 
       | IIRC, it only works this way if you don't use the official
       | installer, which wants to make a persistent rootfs. I feel like
       | Alpine has shown me "true level" [0] and I feel dirty using any
       | distro with a persistent rootfs... in fact it's the single
       | largest reason why I haven't felt motivated to try Linux in a
       | while (aside from KISS since it was interesting enough).
       | 
       | There are no other distros like this, so the fact that it uses
       | musl is a little disappointing if I want to use it as a desktop
       | (which I know it's not designed for).
       | 
       | NixOS comes close, but is fully declarative and I don't really
       | want to learn a new DSL today. I should probably just settle and
       | go with Arch or something.
       | 
       | [0]: https://www.youtube.com/watch?v=Q1zBtJhgwBI
        
         | Rediscover wrote:
         | Regarding the persistent storage, is that anything like
         | PuppyLinux [0] ?
         | 
         | Boot off of something (eg, usb drive), it loads the first layer
         | (ro) into tmpfs, then the 2nd-X layers (also ro) over that, and
         | finally a read/write layer of your saves (/home, config changes
         | under /etc, ...), remove boot medium, eventually do a save to
         | some medium.
         | 
         | [0] https://puppylinux.com
         | 
         | which redirects to
         | 
         | https://puppylinux-woof-ce.github.io/
        
         | silisili wrote:
         | Have you considered something like Fedora Silverblue?
        
       | peter_d_sherman wrote:
       | Great article!
       | 
       | You know, I would love to see an "Alpnix" in the future -- all of
       | Alpine's speed and lightness, all of NixOS's hermetic and
       | reproducible build capabilities...
        
         | MuffinFlavored wrote:
         | > NixOS is a Linux distribution built on top of the Nix package
         | manager
         | 
         | Can the Nix package manager not be added to Alpine?
         | 
         | I guess you'd have to replace apk?
        
           | yjftsjthsd-h wrote:
           | I think they're actually asking for the other way around;
           | they want nixpkgs packages that are as light on disk space as
           | alpine, which probably needs some config tweaks (which nix
           | lends itself to) and possibly using musl (which I _think_ you
           | just do with an overlay? I know it 's doable, but I'm not
           | familiar)
        
       | LinuxBender wrote:
       | As someone that uses Alpine on literally everything except for a
       | desktop I think this is great and would love to see it
       | contributed upstream and integrated by the Alpine developers to
       | be a fully supported installer option.
        
       | euclaise wrote:
       | I really like Alpine, even as a desktop OS. musl is a downside
       | but I guess flatpaks and whatnot help that
        
         | squarefoot wrote:
         | What problems did you encounter? I installed Alpine on some
         | laptops for desktop use and never had a problem except with one
         | HP small netbook where the energy management seems broken as
         | the kernel rewrites somewhere the screen backlight value with a
         | value of 4 (= almost invisible) as soon as I pull the DC plug
         | but doesn't update it when I plug it back. This also happens
         | with ACPI and all power management uninstalled, so I sorta
         | solved this by installing ACPI and making scripts to echo the
         | right value back. This problem aside, I could install a lot of
         | non trivial things, including for example WINE and Yabridge to
         | use music plugins. Unless the system pulled them unbeknownst to
         | me, I made no use of flatpaks and the like. The more I use
         | Alpine, the more I like it.
        
           | LoganDark wrote:
           | > What problems did you encounter?
           | 
           | I personally found it difficult to get Nvidia drivers & Steam
           | working. The latter worked with flatpaks, but Nvidia is
           | always annoying.
           | 
           | Yes. You may laugh at me for trying to use Linux on a
           | computer that was not built for it.
        
             | LAC-Tech wrote:
             | I bought a barebones PC specifically for my linux work
             | station. One criteria from the outset was no NVIDIA.
        
             | squarefoot wrote:
             | One of my favorite quotes, no idea about the author or the
             | date, is "discoveries are made by not following
             | instructions". Laughing because you're trying to get more
             | from a machine that is built to give less would be really
             | stupid; that is actually clever and admirable, and when one
             | succeeds it gives extreme satisfaction. As for Nvidia
             | drivers I can't help because my last experience with their
             | cards is quite old, possibly older than the Nouveau
             | drivers, but keep trying; it couldn't be a Alpine Linux
             | failure as Nvidia, according to a famous Linus Torvalds
             | quote, has already been less than friendly to Linux
             | developers in the past.
        
               | Gordonjcp wrote:
               | And yet NVidia have the only graphics cards with working
               | 3D acceleration and GPU compute capabilities.
        
         | stonogo wrote:
         | It's funny what different people find interesting in Alpine. I
         | started using it expressly _because_ it uses musl. Void is a
         | distro with similar principles that offers a glibc version, so
         | I use that when I need GNU.
        
           | sph wrote:
           | What's the benefit of musl that you don't get with glibc?
        
             | yjftsjthsd-h wrote:
             | I'm given to understand that musl tends to use less memory
             | and disk, at the expense of being slower to execute. (YMMV
             | on all counts)
        
             | LoganDark wrote:
             | musl is statically linked, so each binary can update at
             | their own leisure. There are no system-wide libc updates to
             | break anything.
        
               | MuffinFlavored wrote:
               | How much space is added to each app to include the needed
               | parts of app-level libc?
        
               | netr0ute wrote:
               | I don't know, but for statically linked glibc, it adds a
               | couple megabytes to each binary that uses it. That may or
               | may not be great if you're concerned about cache
               | optimization, which is one big reason why dynamic linking
               | is still so popular.
        
               | ComputerGuru wrote:
               | glibc doesn't actually support statically linking. (You
               | can force it, but it breaks things.)
        
               | anyfoo wrote:
               | Yep. There's a reason why macOS and iOS have a giant
               | (easily 1GB) "shared cache" that is most of the libraries
               | that make up the OS in a giant file, mapped into every
               | process's address space.
               | 
               | Without shared linking, in your example you end up with a
               | copy of glibc and whatever else in every process. Without
               | some fancy page deduplication scheme (that would come
               | with its own set of problems), the kernel cannot know
               | that all these pages in all these processes are the same.
               | And they might not even be, because different versions
               | and just the process of static linking itself might make
               | an arbitrary number of them look slightly different.
               | 
               | Not every program needs all of glibc, so not all of it
               | will be paged in, but still, it looks like you will
               | pollute your CPU caches with many copies of essentially
               | the same thing.
        
               | stonogo wrote:
               | I'ts trivial. Only the functions needed are built into
               | the binary.
        
       | alexklarjr wrote:
       | Wow, magical linux distro that cut Firefox memory usage in half.
        
       ___________________________________________________________________
       (page generated 2022-12-08 23:01 UTC)