You are not logged in.

#1 2018-03-15 07:17:40

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

Revisiting Arch on i586 and building everything from scratch?

I recently came into a small batch of Alix boards and a couple thin clients with Transmeta chips. Both of these CPUs are i586-class machines and report as such. This throws Pacman off unless you force it to recognize the architecture as i686. I am able to boot Arch32 on both of these CPUs just fine, but there are some scenarios where the lack of i686 support is a clear issue. One specific example I found was nodejs, which generally fails with "illegal instruction", which indicates it must be using something i686-specific. Another is "netdata", which also fails to start on either a Geode or a Transmeta with "illegal instruction".

I've seen some posts on here exploring Arch on older machines, and it looks like at one time there was even an i586 branch, but none of that effort seems to have been brought forward. There hasn't been much discussion on this topic since around 2010, back when mainline Arch still widely supported i686.

I'm not afraid to get my hands dirty with patching, editing compiler flags, etc. and I've successfully gone through LFS a few times before. Some may say "use a different distro" or "it's not worth the time" but honestly this is just as much a "because-I-can" and "because-I-want-to-learn-and-try-it" geek project as much as it is to build a JeOS type environment for these boards to do something useful with them, while using the distro I prefer and that I'm most familiar with.

What I'm really seeking is some advice or a guide on how to "bootstrap" Arch Linux from source. My idea would be that I could use a VM and install a distro that is supported on the older architecture (say, i486 Gentoo) and then from there build the necessary core packages for Arch. Along the way, I could also optimize the builds to exclude things I may not need. So yes, I'd be messing with PKGBUILDs a lot, which is fine. Yes, it may come off as "another distro" but it would still be Arch at its core, just like Arch Arm or Arch32. If I can figure out a thorough process I'd even be happy to write a Wiki page describing how someone else might go about doing "LFS but with Arch".  Obviously this has been done before (arch32, ArchLinuxArm, and in the past ArchPPC and Arch i586), so I'm just looking to see "how it was done" so I can replicate the process and hopefully provide some solid documentation to the community on how to go about doing something like this.

Yes, of course, if you do this you become responsible for recompiling and updating packages. Yes, this can be a pain. But that's another exercise I'd love to mess around with (how to automate that process as much as possible).  For now my goal is to compile the packages that I need for my scenario, but I'm not eliminating the possibility of revisiting these old architectures on a broader scale... Of course I know this is unsupported (especially with i686 being deprecated in mainline) but my question is more about the process and where to get started.

This is the high-level abstract process I would imagine I would need to accomplish, loosely based on LFS:

1. Build a toolchain (maybe using LFS) that can compile for the desired target architecture (i586).
2. After setting up the system to use the new toolchain, get Pacman compiled for the same architecture using the new toolchain.
3. Figure out which packages need to be built for a baseline system.
4. Grab all the PKGBUILDs for those packages and modify them as desired (adding the target architecture, modifying any configure options to trim down installed size, etc.) LFS is a good guide on this.
5. Get makepkg to use the new toolchain, then compile a minimal dev environment using makepkg.
6. Install this minimal dev environment into a chroot.
7. From there I should be able to build any packages I need targeting the desired architecture using normal procedures.
8. To bootstrap a new system, setup a pacman repo on my internal web server, and then use pacstrap to install the core packages after pointing "core" to my own repo.  (I've successfully built my own  customized live Arch iso's, so I could build an i586 iso to boot systems from, or more likely just use pacstrap to install to a CF card and handle all the setup out-of-system - this is actually how I got the Alix boards to boot already using arch32.)

Does this sound like a reasonable strategy? Any other tips (other than "don't bother", please)?

Last edited by fdmillion (2018-03-15 07:25:03)

Offline

#2 2018-03-15 11:28:57

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

Re: Revisiting Arch on i586 and building everything from scratch?

You could look at this for inspiration: https://github.com/archlinux32/bootstrap32


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

Offline

#3 2018-03-15 11:47:49

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

Re: Revisiting Arch on i586 and building everything from scratch?

I know you didn't want to be pointed to other distros - but just in case you aren't familiar with it, you may want to check out Alpine linux.  It has a lot of overlap with arch in approach and philosophy.  Their package scripts are APKBUILDs which are pretty much just PKGBUILDs with a different name.  I'm pretty sure it runs on 586 'out of the box'.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2018-03-15 14:53:45

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,193

Re: Revisiting Arch on i586 and building everything from scratch?

I also acknowledge that you don't want to be pointed at other distros, but I would seriously suggest looking at Gentoo.  It will most definitely let you learn about the nitty gritty while providing an excellent cross-architecture build and package manager.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2018-03-15 15:30:25

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

Re: Revisiting Arch on i586 and building everything from scratch?

Thanks for the pointers. The archlinux32 bootstrap looks useful.

To those suggesting other distros, the thing is I want to do this as an exercise in how to build a Pacman-based Arch-based distro "from scratch". Also, these old boxes aren't going to be useful for "general purpose" tasks, but they could be useful for network appliances or other ideas I have that would benefit from a "JeOS" philosophy. Arch is a lot "slimmer" than many mainstream distros but even with that, its default install can easily be around 700MB.

Although I'll admit Alpine looks interesting...

The other thing I've looked at doing is actual LFS but using Pacman for the package manager.

Offline

Board footer

Powered by FluxBB