From c0fedeba6183059f45d0d17c0836c3e7ad64d7b8 Mon Sep 17 00:00:00 2001 From: Paul Dersey Date: Thu, 25 Feb 2021 14:52:05 -0500 Subject: [PATCH 1/2] bash-3.2.57: Build new package to replace bash 2.05b Resulting build now works interactively --- README.rst | 5 +++-- SHA256SUMS.sources | 1 + parts.rst | 9 +++++++++ rootfs.sh | 3 +++ sysa/bash-3.2.57/bash-3.2.57.sh | 24 ++++++++++++++++++++++++ sysa/bash-3.2.57/checksums | 1 + sysa/run.sh | 2 ++ 7 files changed, 43 insertions(+), 2 deletions(-) create mode 100755 sysa/bash-3.2.57/bash-3.2.57.sh create mode 100644 sysa/bash-3.2.57/checksums diff --git a/README.rst b/README.rst index 8eb327c..fcbfbdc 100644 --- a/README.rst +++ b/README.rst @@ -28,8 +28,9 @@ Get me started! some other device and boot from bare metal. 5. Wait. -6. If you can, observe the many binaries in ``/after/bin``! (Soon, you will - also have an interactive bash shell to play around in). +6. If you can, observe the many binaries in ``/after/bin``! When the + bootstrap is completed ``bash`` is launched providing a shell to + explore the system. Background ---------- diff --git a/SHA256SUMS.sources b/SHA256SUMS.sources index b26a70a..79bbfda 100644 --- a/SHA256SUMS.sources +++ b/SHA256SUMS.sources @@ -3,6 +3,7 @@ f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e autoconf-2.13. 534e99b61b81e79327b6d08f1a3edb0755ac246e1249009b0e1bf5887b60d7a9 autoconf-2.52.tar.gz 503cdc2b0992a4309545d17f462cb15f99bb57b7161dfc4082b2e7188f2bcc0f automake-1.4-p6.tar.gz ba03d412998cc54bd0b0f2d6c32100967d3137098affdc2d32e6e7c11b163fe4 bash-2.05b.tar.gz +3fa9daf85ebf35068f090ce51283ddeeb3c75eb5bc70b1a4a7cb05868bfe06a4 bash-3.2.57.tar.gz e20bdd49a0fb317959b410c1fe81269a620ec21207045d8a37cadea621be4b59 binutils-2.14.tar.bz2 7007fc89c216fbfaff5525359b02a7e5b612694df5168c74673f67055f015095 bison-3.4.1.tar.gz ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 bzip2-1.0.8.tar.gz diff --git a/parts.rst b/parts.rst index b07d4b3..9c61e01 100644 --- a/parts.rst +++ b/parts.rst @@ -419,3 +419,12 @@ tcc 0.9.27 (musl v3) ==================== We rebuild tcc against new musl and without a patch to ignore duplicate symbols. + +bash 3.2.57 +=========== + +Up to this point, our build of ``bash`` could run scripts but could not be used +interactively. This newer version of ``bash`` compiles without any patches, +provides new features, and is built with GNU readline support so it can be used +as an interactive shell. autoconf 2.52 is used to regenerate the configure +script and bison is used to recreate some included generated files. diff --git a/rootfs.sh b/rootfs.sh index 7a8200b..dc679e1 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -219,6 +219,9 @@ get_file https://ftp.gnu.org/gnu/autoconf/autoconf-2.12.tar.gz # binutils 2.14 get_file https://ftp.gnu.org/gnu/binutils/binutils-2.14.tar.bz2 +# bash 3.2.57 +get_file https://ftp.gnu.org/gnu/bash/bash-3.2.57.tar.gz + # General cleanup find tmp -name .git -exec rm -rf \; diff --git a/sysa/bash-3.2.57/bash-3.2.57.sh b/sysa/bash-3.2.57/bash-3.2.57.sh new file mode 100755 index 0000000..01baae9 --- /dev/null +++ b/sysa/bash-3.2.57/bash-3.2.57.sh @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2021 Paul Dersey +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + # Remove bison generated files + rm y.tab.c y.tab.h + + # Rebuild configure script + # Ignore harmless error from autoconf for now + rm configure + autoconf-2.52 || true +} + +src_configure() { + CC=tcc CPPFLAGS="-D HAVE_ALLOCA_H" \ + ./configure --prefix=/after \ + --without-bash-malloc \ + --build=i386-unknown-linux +} + +src_install() { + install bash ${bindir} +} diff --git a/sysa/bash-3.2.57/checksums b/sysa/bash-3.2.57/checksums new file mode 100644 index 0000000..ec71e1d --- /dev/null +++ b/sysa/bash-3.2.57/checksums @@ -0,0 +1 @@ +0d6cbaa5f93fa4c2186ef40dd834b47841b3bf70f6183cfdb6ada38fdb835c5a /after/bin/bash diff --git a/sysa/run.sh b/sysa/run.sh index 43976d3..f7830cf 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -91,4 +91,6 @@ populate_device_nodes # Rebuild tcc-musl using new musl build tcc-0.9.27 tcc-musl-pass3.sh checksums/tcc-musl-pass3 +build bash-3.2.57 + echo "Bootstrapping completed." From cd0019e239feea6150fefe4eb72321830c52aceb Mon Sep 17 00:00:00 2001 From: Paul Dersey Date: Thu, 4 Mar 2021 22:20:45 -0500 Subject: [PATCH 2/2] After building bash, call exec bash for new run2.sh script --- rootfs.sh | 2 +- sysa/run.sh | 2 +- sysa/run2.sh | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 sysa/run2.sh diff --git a/rootfs.sh b/rootfs.sh index dc679e1..ca23e94 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -79,7 +79,7 @@ mkdir -p tmp/tmp cp after.kaem tmp/ cp after.kaem.run tmp/after/kaem.run cp mescc-tools-seed/checksums tmp/after/mescc-tools-seed-checksums -cp helpers.sh run.sh pre-sha.sha256sums tmp/after/ +cp helpers.sh run.sh run2.sh pre-sha.sha256sums tmp/after/ # mescc-tools-extra cp -r mescc-tools-extra tmp/after/ diff --git a/sysa/run.sh b/sysa/run.sh index f7830cf..b74aca5 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -93,4 +93,4 @@ build tcc-0.9.27 tcc-musl-pass3.sh checksums/tcc-musl-pass3 build bash-3.2.57 -echo "Bootstrapping completed." +exec bash run2.sh diff --git a/sysa/run2.sh b/sysa/run2.sh new file mode 100755 index 0000000..5d13cab --- /dev/null +++ b/sysa/run2.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: 2021 Andrius Štikonas +# SPDX-FileCopyrightText: 2021 fosslinux +# SPDX-FileCopyrightText: 2021 Paul Dersey +# +# SPDX-License-Identifier: GPL-3.0-or-later + +set -e +. helpers.sh + +echo "Bootstrapping completed."