You are not logged in.

#1 2017-09-17 18:34:49

fdmillion
Member
Registered: 2014-07-04
Posts: 8

Project idea: using Arch as the base for a super-minimal distro

First of all, something may exist already - if so let me know.

I've been an Arch user for a few years now and it's my favorite distro - the only one I really enjoy using. The wiki has been extremely helpful even when dealing with non-Arch systems, but the wealth of information maintained by this community is just awesome.

So I just came into a handful of x86-based thin clients. They have 1GB of RAM and only 1GB of onboard flash storage. I'd like to set these up with an Arch install. The problem is, however, even a "minimal" default Arch install easily consumes around 1.2GB of disk with the package cache. Even after removing a bunch of things you can live without (linux-firmware, include files, docs, etc.) I still haven't gotten a stock install down below about 750MB. Of course Arch's core repos serve a general use case, so optimizing features out of packages that aren't needed for special use cases isn't really an option.

In the past I've used Linux From Scratch to build fully customized from-the-ground-up Linux instances. I was once able to build a functional NAS server with HTTP and Samba access in about 70MB of storage. I did this mostly by carefully tuning each package build in LFS to only include the things I need. I also once built an LXDE desktop with Firefox in about 200MB using LFS. This would be an awesome setup for these thin clients.

So my idea is to setup my own locally-hosted custom repo on my webserver, and then build all of the core system packages from scratch, applying my own configurations to the PKGBUILDs. For example, I don't need internationalization support so I could build glibc without it. I don't need man pages so I could have the PKGBUILD either ignore them or remove them from the build directory before packaging. I may even be able to rebuild the whole system against something like uclibc or diet-libc...? It's worth noting that with the deprecation of x86-32 as a target platform,  this defines another reason for me to do this - the thin clients are x86 processors without 64-bit support.

Wondering if anyone has attempted something like this before. The ideal scenario would be: a locally-hosted repo that contains only those packages I need for my minimal installs, and the ability to pull in, modify and rebuild core packages as they're updated (e.g. Samba). I could then setup pacstrap to pull from my repo. (I'd setup my PKGBUILDs to have a group of base, so that I could basically use the same tools to get things up and running that you do for a stock Arch install, just pointing it at a different mirror.)

I've done plenty of makepkg's, but I haven't ever attempted rebuilding an entire system from source from scratch and building core system packages. Just looking to see if anyone has tried this, any tips, caveats, or dangers to be aware of!

Last edited by fdmillion (2017-09-17 18:36:11)

Offline

#2 2017-09-18 03:00:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Project idea: using Arch as the base for a super-minimal distro

Well, https://archlinux32.org is doing just this to carry on i686 support. See the github organization for the tools used to rebuild all packages with custom i686 modifications.

As for modified packages, archlinux32 is simply appending customizations to the PKGBUILDs derived from the Arch Build System, before running makepkg.
For some things you don't need to modify the PKGBUILD at all, e.g. see PURGE_TARGETS in makepkg.conf(5) to clean manpages. Or use the NoExtract directive in pacman.conf

Note that at this point you likely won't be using Arch at all, you will be using a custom OS that happens to use the excellent pacman tool as its package manager. big_smile
This isn't a bad thing, in fact I know there are people who use pacman as their package manager for LFS too.

Last edited by eschwartz (2017-09-18 03:01:35)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2017-09-18 03:12:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,559
Website

Re: Project idea: using Arch as the base for a super-minimal distro

fdmillion wrote:

I may even be able to rebuild the whole system against something like uclibc or diet-libc...?

You'd probably have better luck with musl.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-09-18 07:14:51

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Project idea: using Arch as the base for a super-minimal distro

I would suggest Alpine.

Offline

#5 2017-09-19 12:17:39

mis
Member
Registered: 2016-03-16
Posts: 234

Re: Project idea: using Arch as the base for a super-minimal distro

Maybe you want to have a look at Void Linux.
They have i686, musl, split out headers in *-devel packages and you can easily build your own packages with the xbps packaging system.

Offline

Board footer

Powered by FluxBB