fosslinux / live-bootstrap

Use of a Linux initramfs to fully automate the bootstrapping process
512 stars 36 forks source link

Enable additional tools in coreutils-5.0 phase 1 #290

Closed emilytrau closed 1 year ago

emilytrau commented 1 year ago

These utilities can be enabled with only a small amount of additional patches. In particular sort, expr, uniq,and hostname are used by some ./configure.sh scripts.

emilytrau commented 1 year ago

The primary motivation for this is to be able to execute ./configure.sh scripts at the tcc-mes + bash-2.05b stage before musl is available. While I'm still in the testing phase and don't have a definitive list, binutil- 2.20.1's ./configure.sh appears to have a dependency on dirname, expr, sort, uniq and hostname. Not in this list is factor and pr which were added simply because they didn't throw any compiler errors and didn't take any extra effort. The last two I would be happy to leave out for ~120kb of space saving.

Also worth noting is I discovered the FullSourceBootstrapFromGit project independently implements a similar patch with the same motivations.

$ ls -lh tmp/sysa/usr/bin/{dirname,expr,sort,uniq,hostname,factor,pr}
-rwxr-xr-x 1 emilytrau emilytrau  59K May  3 14:08 tmp/sysa/usr/bin/dirname
-rwxr-xr-x 1 emilytrau emilytrau 115K May  3 14:08 tmp/sysa/usr/bin/expr
-rwxr-xr-x 1 emilytrau emilytrau  53K May  3 14:06 tmp/sysa/usr/bin/factor
-rwxr-xr-x 1 emilytrau emilytrau  48K May  3 14:06 tmp/sysa/usr/bin/hostname
-rwxr-xr-x 1 emilytrau emilytrau  71K May  3 14:06 tmp/sysa/usr/bin/pr
-rwxr-xr-x 1 emilytrau emilytrau 113K May  3 14:08 tmp/sysa/usr/bin/sort
-rwxr-xr-x 1 emilytrau emilytrau  74K May  3 14:08 tmp/sysa/usr/bin/uniq
fosslinux commented 1 year ago

We are a bit more strict about dependency order in live-bootstrap since we require all autotools used in a project before that project's configure is used (such as binutils), so I doubt this would actually provide any short-circuits. (Feel free to correct me though!)

@stikonas Are not these binaries overwritten by stage2 anyway? And there's no package for kaem-era programs, so doesn't this change not add any extra space? I may be not thinking straight though

emilytrau commented 1 year ago

Thanks for clarifying! That makes sense

stikonas commented 1 year ago

On 3 May 2023 08:41:28 BST, fosslinux @.***> wrote:

@stikonas Are not these binaries overwritten by stage2 anyway? And there's no package for kaem-era programs, so doesn't this change not add any extra space? I may be not thinking straight though

Oh yes, I completely forgot that.

emilytrau commented 1 year ago

On second thought, given that it wouldn't add extra space to sysa, thoughts on reconsidering this PR? Reason being it would be convenient for me as I wouldn't need to maintain a small patch on the makefile for nixpkgs.