[Toybox] Linux From Scratch build.
Rob Landley
rob at landley.net
Wed Aug 30 13:09:03 PDT 2023
On 4/16/23 18:54, Rob Landley wrote:
> On 3/24/23 12:11, Rob Landley wrote:
>> Here's a script that automates the first part of the Linux From Scratch 11.3
>> build (chapters 5 and 6, setting up the chroot) from
>> https://linuxfromscratch.org/lfs/downloads/11.3/LFS-BOOK-11.3-NOCHUNKS.html
>> using the source packages available in one big tarball at
>> http://ftp.osuosl.org/pub/lfs/lfs-packages/lfs-packages-11.3.tar
>>
>> Way back when https://landley.net/aboriginal/about.html drove my busybox
>> development because I substituted in one busybox command at a time into the
>> $PATH used by the build until it was providing everything. Each time I could
>> compare the result (including each build's config.log file) to identify
>> everywhere it diverged from the previous build and fix it so the result was the
>> same.
>>
>> Last time I converted the LFS build from glibc to uClibc first, and this time
>> I'm doing musl, because glibc is just DEEPLY insane (and requires perl as a
>> build prerequisite).
>>
>> This doesn't replace the test suite, but will probably add a lot of entries to it.
>>
>> One thing I'm currently frowning at is that earlier LFS builds (back when all
>> this was chapter 5) put the entire temporary system in /tools to isolate it from
>> the host (so you could rm -rf /tools when you were done and know nothing built
>> on the host remained on the target0, but the new chapter 6 (still before the
>> chroot) is writing its output to the rest of the chroot already? (Why are they
>> doing _less_ isolation now?)
>
> So I got asked off list about this, and thought I'd elaborate a bit more:
>
> The plan is to start by automating the existing LFS x86 host build, so I have a
> reproducible output where I know what success looks like.
Not closed done yet, but I haven't quite figured out where to check this in yet,
so in case of hard drive crash here's more current scripts...
It's up to the point where the (truly horrific) glibc build wants to use a
tarball that DOESN'T EXTRACT INTO A SUBDIRECTORY (tzdata*.tar* barfs a dozen
files into the current directory), and I want to update the ch7.0 script
(chroot-into-lfs with host context copied and bind mounted and so on) to set up
the mkroot/record-commands logging wrapper inside the chroot, in a way that
picks up new binaries after each package install)...
I want to swap in toybox for the binaries it provides, and eventually have the
toybox directory at the start of the $PATH so it keeps using the toybox binaries
even after building/installing replacements. (And replace glibc with musl in
this build because ew.) But first I need an automated working baseline I can
regression test against.
Working on it...
Rob
P.S. I've blogged more details but need to edit and post the entries...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ch5.sh
Type: application/x-shellscript
Size: 7496 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230830/50fa037c/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ch7.0.sh
Type: application/x-shellscript
Size: 677 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230830/50fa037c/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ch7.sh
Type: application/x-shellscript
Size: 3568 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230830/50fa037c/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ch8.sh
Type: application/x-shellscript
Size: 1423 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230830/50fa037c/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plumbing.sh
Type: application/x-shellscript
Size: 1165 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20230830/50fa037c/attachment-0009.bin>
More information about the Toybox
mailing list