From 060f44e5a52022124fb84c30591f0492cf51fbed Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sun, 8 May 2022 07:59:59 +1000 Subject: [PATCH 1/9] Add curl 7.83.0 --- sysa.py | 3 ++ sysa/SHA256SUMS.sources | 1 + sysa/curl-7.83.0/curl-7.83.0.sh | 31 ++++++++++++++++ sysa/curl-7.83.0/files/sinus.pl | 4 +++ sysa/curl-7.83.0/patches/help.patch | 55 +++++++++++++++++++++++++++++ sysa/run.sh | 2 ++ sysc/curl-7.83.0/curl-7.83.0.sh | 29 +++++++++++++++ 7 files changed, 125 insertions(+) create mode 100755 sysa/curl-7.83.0/curl-7.83.0.sh create mode 100644 sysa/curl-7.83.0/files/sinus.pl create mode 100644 sysa/curl-7.83.0/patches/help.patch create mode 100755 sysc/curl-7.83.0/curl-7.83.0.sh diff --git a/sysa.py b/sysa.py index d354d01..8859b4a 100755 --- a/sysa.py +++ b/sysa.py @@ -270,6 +270,9 @@ class SysA(SysGeneral): # make 3.82 self.get_file("https://mirrors.kernel.org/gnu/make/make-3.82.tar.gz") + # curl 7.83.0 + self.get_file("https://curl.se/download/curl-7.83.0.tar.bz2") + # linux kernel 2.6.16.62 self.get_file(["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.10.tar.gz", "https://linux-libre.fsfla.org/pub/linux-libre/releases/old/gen6/4.9.10-gnu/deblob-4.9"]) diff --git a/sysa/SHA256SUMS.sources b/sysa/SHA256SUMS.sources index d34d6e4..2ab79bb 100644 --- a/sysa/SHA256SUMS.sources +++ b/sysa/SHA256SUMS.sources @@ -21,6 +21,7 @@ e20bdd49a0fb317959b410c1fe81269a620ec21207045d8a37cadea621be4b59 binutils-2.14. 7007fc89c216fbfaff5525359b02a7e5b612694df5168c74673f67055f015095 bison-3.4.1.tar.gz ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 bzip2-1.0.8.tar.gz c25b36b8af6e0ad2a875daf4d6196bd0df28a62be7dd252e5f99a4d5d7288d95 coreutils-5.0.tar.bz2 +247c7ec7521c4258e65634e529270d214fe32969971cccb72845e7aa46831f96 curl-7.83.0.tar.bz2 1d013547889f20576460249c4210632d5314531c8477378a2e046b13a8ebeb7e coreutils-6.10.tar.gz af4214b851928a53ef470ed8729122b9db910a6c0769d5d46a5de0b3e96f74f3 deblob-4.9 d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7.tar.gz diff --git a/sysa/curl-7.83.0/curl-7.83.0.sh b/sysa/curl-7.83.0/curl-7.83.0.sh new file mode 100755 index 0000000..4df9b11 --- /dev/null +++ b/sysa/curl-7.83.0/curl-7.83.0.sh @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + # Regnerate src/tool_cb_prg.c + sed -i "53,74d" src/tool_cb_prg.c + sed -i "53 s/^/$(perl sinus.pl | sed "s/, $//")\n/" src/tool_cb_prg.c + + rm src/tool_help.c src/tool_help.h src/tool_listhelp.c src/tool_hugehelp.c + + # Rebuild libtool files + rm config.guess config.sub ltmain.sh + libtoolize + + autoreconf -fi +} + +src_configure() { + LDFLAGS="-static" ./configure \ + --prefix="${PREFIX}" \ + --without-ssl \ + --disable-hsts +} + +src_install() { + default + install -m 755 scripts/mk-ca-bundle.pl "${DESTDIR}/usr/bin/mk-ca-bundle" +} diff --git a/sysa/curl-7.83.0/files/sinus.pl b/sysa/curl-7.83.0/files/sinus.pl new file mode 100644 index 0000000..d497811 --- /dev/null +++ b/sysa/curl-7.83.0/files/sinus.pl @@ -0,0 +1,4 @@ +my $pi = 3.1415; +foreach my $i (1 .. 200) { + printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; +} diff --git a/sysa/curl-7.83.0/patches/help.patch b/sysa/curl-7.83.0/patches/help.patch new file mode 100644 index 0000000..d06ca19 --- /dev/null +++ b/sysa/curl-7.83.0/patches/help.patch @@ -0,0 +1,55 @@ +diff --color -ru src/Makefile.inc src/Makefile.inc +--- src/Makefile.inc 2022-05-09 16:48:37.195346967 +1000 ++++ src/Makefile.inc 2022-05-09 16:49:46.503187644 +1000 +@@ -69,11 +69,9 @@ + tool_formparse.c \ + tool_getparam.c \ + tool_getpass.c \ +- tool_help.c \ + tool_helpers.c \ + tool_hugehelp.c \ + tool_libinfo.c \ +- tool_listhelp.c \ + tool_main.c \ + tool_msgs.c \ + tool_operate.c \ +@@ -111,7 +109,6 @@ + tool_formparse.h \ + tool_getparam.h \ + tool_getpass.h \ +- tool_help.h \ + tool_helpers.h \ + tool_hugehelp.h \ + tool_libinfo.h \ +diff --color -ru src/tool_operate.c src/tool_operate.c +--- src/tool_operate.c 2022-05-09 16:48:37.196347022 +1000 ++++ src/tool_operate.c 2022-05-09 16:54:00.696271863 +1000 +@@ -78,7 +78,6 @@ + #include "tool_writeout.h" + #include "tool_xattr.h" + #include "tool_vms.h" +-#include "tool_help.h" + #include "tool_hugehelp.h" + #include "tool_progress.h" + #include "dynbuf.h" +@@ -2607,19 +2606,7 @@ + if(res) { + result = CURLE_OK; + +- /* Check if we were asked for the help */ +- if(res == PARAM_HELP_REQUESTED) +- tool_help(global->help_category); +- /* Check if we were asked for the manual */ +- else if(res == PARAM_MANUAL_REQUESTED) +- hugehelp(); +- /* Check if we were asked for the version information */ +- else if(res == PARAM_VERSION_INFO_REQUESTED) +- tool_version_info(); +- /* Check if we were asked to list the SSL engines */ +- else if(res == PARAM_ENGINES_REQUESTED) +- tool_list_engines(); +- else if(res == PARAM_LIBCURL_UNSUPPORTED_PROTOCOL) ++ if(res == PARAM_LIBCURL_UNSUPPORTED_PROTOCOL) + result = CURLE_UNSUPPORTED_PROTOCOL; + else if(res == PARAM_READ_ERROR) + result = CURLE_READ_ERROR; diff --git a/sysa/run.sh b/sysa/run.sh index 192ec61..3a18b72 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -232,6 +232,8 @@ build kbd-1.15 build make-3.82 +build curl-7.83.0 + # Clear up some RAM space grep '^pkg=' /after.kaem | sed 's/pkg="//' | sed 's/"$//' | while read -r p ; do rm -rf "${SOURCES:?}/${p:?}" diff --git a/sysc/curl-7.83.0/curl-7.83.0.sh b/sysc/curl-7.83.0/curl-7.83.0.sh new file mode 100755 index 0000000..aaa4a84 --- /dev/null +++ b/sysc/curl-7.83.0/curl-7.83.0.sh @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +urls="http://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1" + +src_prepare() { + default + + # Regnerate src/tool_cb_prg.c + sed -i "53,74d" src/tool_cb_prg.c + sed -i "53 s/^/$(perl sinus.pl | sed "s/, $//")\n/" src/tool_cb_prg.c + + rm src/tool_help.c src/tool_help.h src/tool_listhelp.c src/tool_hugehelp.c + + # Rebuild libtool files + rm config.guess config.sub ltmain.sh + libtoolize + + autoreconf -fi +} + +src_configure() { + LDFLAGS="-static" ./configure \ + --prefix="${PREFIX}" \ + --build=i386-unknown-linux-gnu \ + --with-openssl \ + --with-ca-bundle=/etc/ssl/certs.pem +} From 01129d20c247ed62188523db6f2800b40a4d3e47 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Thu, 12 May 2022 18:20:21 +1000 Subject: [PATCH 2/9] Add curl-7.83.0 sysc rebuild Adds ssl support. --- sysc/curl-7.83.0/curl-7.83.0.sh | 1 - sysc/curl-7.83.0/files/sinus.pl | 4 +++ sysc/curl-7.83.0/patches/help.patch | 55 +++++++++++++++++++++++++++++ sysc/run2.sh | 2 ++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 sysc/curl-7.83.0/files/sinus.pl create mode 100644 sysc/curl-7.83.0/patches/help.patch diff --git a/sysc/curl-7.83.0/curl-7.83.0.sh b/sysc/curl-7.83.0/curl-7.83.0.sh index aaa4a84..fa36936 100755 --- a/sysc/curl-7.83.0/curl-7.83.0.sh +++ b/sysc/curl-7.83.0/curl-7.83.0.sh @@ -23,7 +23,6 @@ src_prepare() { src_configure() { LDFLAGS="-static" ./configure \ --prefix="${PREFIX}" \ - --build=i386-unknown-linux-gnu \ --with-openssl \ --with-ca-bundle=/etc/ssl/certs.pem } diff --git a/sysc/curl-7.83.0/files/sinus.pl b/sysc/curl-7.83.0/files/sinus.pl new file mode 100644 index 0000000..d497811 --- /dev/null +++ b/sysc/curl-7.83.0/files/sinus.pl @@ -0,0 +1,4 @@ +my $pi = 3.1415; +foreach my $i (1 .. 200) { + printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; +} diff --git a/sysc/curl-7.83.0/patches/help.patch b/sysc/curl-7.83.0/patches/help.patch new file mode 100644 index 0000000..d06ca19 --- /dev/null +++ b/sysc/curl-7.83.0/patches/help.patch @@ -0,0 +1,55 @@ +diff --color -ru src/Makefile.inc src/Makefile.inc +--- src/Makefile.inc 2022-05-09 16:48:37.195346967 +1000 ++++ src/Makefile.inc 2022-05-09 16:49:46.503187644 +1000 +@@ -69,11 +69,9 @@ + tool_formparse.c \ + tool_getparam.c \ + tool_getpass.c \ +- tool_help.c \ + tool_helpers.c \ + tool_hugehelp.c \ + tool_libinfo.c \ +- tool_listhelp.c \ + tool_main.c \ + tool_msgs.c \ + tool_operate.c \ +@@ -111,7 +109,6 @@ + tool_formparse.h \ + tool_getparam.h \ + tool_getpass.h \ +- tool_help.h \ + tool_helpers.h \ + tool_hugehelp.h \ + tool_libinfo.h \ +diff --color -ru src/tool_operate.c src/tool_operate.c +--- src/tool_operate.c 2022-05-09 16:48:37.196347022 +1000 ++++ src/tool_operate.c 2022-05-09 16:54:00.696271863 +1000 +@@ -78,7 +78,6 @@ + #include "tool_writeout.h" + #include "tool_xattr.h" + #include "tool_vms.h" +-#include "tool_help.h" + #include "tool_hugehelp.h" + #include "tool_progress.h" + #include "dynbuf.h" +@@ -2607,19 +2606,7 @@ + if(res) { + result = CURLE_OK; + +- /* Check if we were asked for the help */ +- if(res == PARAM_HELP_REQUESTED) +- tool_help(global->help_category); +- /* Check if we were asked for the manual */ +- else if(res == PARAM_MANUAL_REQUESTED) +- hugehelp(); +- /* Check if we were asked for the version information */ +- else if(res == PARAM_VERSION_INFO_REQUESTED) +- tool_version_info(); +- /* Check if we were asked to list the SSL engines */ +- else if(res == PARAM_ENGINES_REQUESTED) +- tool_list_engines(); +- else if(res == PARAM_LIBCURL_UNSUPPORTED_PROTOCOL) ++ if(res == PARAM_LIBCURL_UNSUPPORTED_PROTOCOL) + result = CURLE_UNSUPPORTED_PROTOCOL; + else if(res == PARAM_READ_ERROR) + result = CURLE_READ_ERROR; diff --git a/sysc/run2.sh b/sysc/run2.sh index 7ac479f..de58e40 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -59,6 +59,8 @@ build libarchive-3.5.2 build openssl-1.1.1l +build curl-7.83.0 + build zlib-1.2.12 build xbps-0.59.1 From 39541e30f51fbf2356b2d3d4c0070896200e38bd Mon Sep 17 00:00:00 2001 From: fosslinux Date: Thu, 12 May 2022 18:21:24 +1000 Subject: [PATCH 3/9] Add ca-certificates-3.78 Contains all required certificates for curl/openssl. --- sysc/ca-certificates-3.78/ca-certificates-3.78.sh | 15 +++++++++++++++ sysc/run2.sh | 2 ++ 2 files changed, 17 insertions(+) create mode 100755 sysc/ca-certificates-3.78/ca-certificates-3.78.sh diff --git a/sysc/ca-certificates-3.78/ca-certificates-3.78.sh b/sysc/ca-certificates-3.78/ca-certificates-3.78.sh new file mode 100755 index 0000000..20dd571 --- /dev/null +++ b/sysc/ca-certificates-3.78/ca-certificates-3.78.sh @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +urls="http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz" + +src_compile() { + cp nss/lib/ckfw/builtins/certdata.txt . + mk-ca-bundle -n -s ALL -m +} + +src_install() { + install -D -m 644 ca-bundle.crt "${DESTDIR}/etc/ssl/certs/ca-certificates.crt" + ln -s /etc/ssl/certs/ca-certificates.crt "${DESTDIR}/etc/ssl/certs.pem" +} diff --git a/sysc/run2.sh b/sysc/run2.sh index de58e40..3708c3f 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -59,6 +59,8 @@ build libarchive-3.5.2 build openssl-1.1.1l +build ca-certificates-3.78 '' '' nss-3.78 + build curl-7.83.0 build zlib-1.2.12 From 8008de8e734a0868a09249f94eb06fa1bf581bb1 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Thu, 12 May 2022 19:50:28 +1000 Subject: [PATCH 4/9] Add file downloading logic Add urls to sysc, and modify some tarballs to http (non s) before ssl --- sysa/curl-7.83.0/curl-7.83.0.sh | 1 + sysa/helpers.sh | 29 +++- sysc.py | 125 ------------------ sysc/autoconf-2.69/autoconf-2.69.sh | 2 + sysc/autoconf-2.71/autoconf-2.71.sh | 2 + .../autoconf-archive-2021.02.19.sh | 2 + sysc/automake-1.11.2/automake-1.11.2.sh | 2 + sysc/automake-1.15.1/automake-1.15.1.sh | 2 + sysc/automake-1.16.3/automake-1.16.3.sh | 2 + sysc/bash-5.1/bash-5.1.sh | 2 + sysc/bison-2.3/bison-2.3.sh | 3 +- sysc/bison-3.4.2/bison-3.4.2.sh | 3 +- sysc/coreutils-8.32/coreutils-8.32.sh | 3 +- sysc/dist-3.5-236/dist-3.5-236.sh | 2 + sysc/flex-2.5.33/flex-2.5.33.sh | 2 + sysc/gc-8.0.4/gc-8.0.4.sh | 2 + sysc/gcc-4.7.4/gcc-4.7.4.sh | 2 + sysc/gettext-0.21/gettext-0.21.sh | 3 +- sysc/gmp-6.2.1/gmp-6.2.1.sh | 2 + sysc/gperf-3.1/gperf-3.1.sh | 2 + sysc/guile-3.0.7/guile-3.0.7.sh | 4 +- sysc/libarchive-3.5.2/libarchive-3.5.2.sh | 2 + .../libatomic_ops-7.6.10.sh | 2 + sysc/libffi-3.3/libffi-3.3.sh | 2 + .../libunistring-0.9.10.sh | 3 +- sysc/make-4.2.1/make-4.2.1.sh | 2 + sysc/mpc-1.2.1/mpc-1.2.1.sh | 2 + sysc/mpfr-4.1.0/mpfr-4.1.0.sh | 2 + sysc/openssl-1.1.1l/openssl-1.1.1l.sh | 2 + sysc/patch-2.7.6/patch-2.7.6.sh | 3 +- sysc/perl-5.10.1/perl-5.10.1.sh | 2 +- .../perl-5.32.1/patches/reproducibility.patch | 8 +- .../patches/reproducibility2.patch | 8 +- sysc/perl-5.32.1/perl-5.32.1.sh | 7 +- sysc/pkg-config-0.29.2/pkg-config-0.29.2.sh | 2 + sysc/run.sh | 4 + sysc/run2.sh | 2 +- sysc/tar-1.34/tar-1.34.sh | 3 +- sysc/texinfo-6.7/texinfo-6.7.sh | 3 +- sysc/xbps-0.59.1/xbps-0.59.1.sh | 2 + sysc/xz-5.0.5/xz-5.0.5.sh | 2 + sysc/zlib-1.2.12/zlib-1.2.12.sh | 2 + 42 files changed, 110 insertions(+), 152 deletions(-) diff --git a/sysa/curl-7.83.0/curl-7.83.0.sh b/sysa/curl-7.83.0/curl-7.83.0.sh index 4df9b11..88b46f6 100755 --- a/sysa/curl-7.83.0/curl-7.83.0.sh +++ b/sysa/curl-7.83.0/curl-7.83.0.sh @@ -21,6 +21,7 @@ src_prepare() { src_configure() { LDFLAGS="-static" ./configure \ --prefix="${PREFIX}" \ + --build=i386-unknown-linux-gnu \ --without-ssl \ --disable-hsts } diff --git a/sysa/helpers.sh b/sysa/helpers.sh index 16f190a..37aaae9 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -147,6 +147,10 @@ build() { . "${build_script}" fi + echo "${pkg}: getting sources." + build_stage=src_get + call $build_stage + echo "${pkg}: unpacking source." build_stage=src_unpack call $build_stage @@ -192,13 +196,28 @@ build() { unset -f src_unpack src_prepare src_configure src_compile src_install } +# Default get function that downloads source tarballs. +default_src_get() { + if ! [ -z "${urls}" ] && command -v curl >/dev/null 2>&1; then + for i in ${urls}; do + curl -L "${i}" --output "${DISTFILES}/$(basename "${i}")" + done + fi +} + # Default unpacking function that unpacks all source tarballs. default_src_unpack() { - distfiles=${EXTRA_DISTFILES} - # shellcheck disable=SC2153 - for f in "${DISTFILES}/${pkg}."*; do - distfiles="$(basename "$f") ${distfiles}" - done + distfiles="${EXTRA_DISTFILES}" + if [ -z "${urls}" ]; then + # shellcheck disable=SC2153 + for f in "${DISTFILES}/${pkg}."*; do + distfiles="$(basename "$f") ${distfiles}" + done + else + for i in ${urls}; do + distfiles="$(basename "${i}") ${distfiles}" + done + fi # Check for new tar # shellcheck disable=SC2153 diff --git a/sysc.py b/sysc.py index a915c53..1cf566b 100755 --- a/sysc.py +++ b/sysc.py @@ -65,133 +65,8 @@ class SysC(SysGeneral): else: rootfs_dir = self.tmp_dir - self.get_packages() - copytree(self.sys_dir, rootfs_dir, ignore=shutil.ignore_patterns("tmp")) # Unmount tmp/mnt if it was mounted if create_disk_image: umount(rootfs_dir) - - # pylint: disable=line-too-long,too-many-statements - def get_packages(self): - """Prepare remaining sources""" - # bash 5.1 - self.get_file("https://mirrors.kernel.org/gnu/bash/bash-5.1.tar.gz") - - # xz 5.0.5 - self.get_file("https://tukaani.org/xz/xz-5.0.5.tar.bz2") - - # automake 1.11.2 - self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2") - - # autoconf 2.69 - self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.xz") - - # automake 1.15.1 - self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.xz") - - # tar 1.34 - self.get_file(["https://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz"]) - - # coreutils 8.32 - self.get_file(["https://git.savannah.gnu.org/cgit/coreutils.git/snapshot/coreutils-8.32.tar.gz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-d279bc.tar.gz"]) - - # pkg-config 0.29.2 - self.get_file("https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz") - - # make 4.2.1 - self.get_file("https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz") - - # gmp 6.2.1 - self.get_file("https://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz") - - # autoconf archive 2021.02.19 - self.get_file("https://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz") - - # mpfr 4.1.0 - self.get_file("https://mirrors.kernel.org/gnu/mpfr/mpfr-4.1.0.tar.xz") - - # mpc 1.2.1 - self.get_file("https://mirrors.kernel.org/gnu/mpc/mpc-1.2.1.tar.gz") - - # flex 2.5.33 - self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz") - - # bison 2.3 - self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"]) - - # bison 3.4.2 - self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-3.4.2.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-672663a.tar.gz"]) - - # perl 5.10.5 - self.get_file("https://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2") - - # dist 3.5-236 - # Debian's version is used because upstream is not to be found (dead?) - self.get_file("https://salsa.debian.org/perl-team/interpreter/dist/-/archive/d1de81f/dist-d1de81f.tar.gz", - output="dist-3.5-236.tar.gz") - - # perl 5.32.1 - self.get_file(["https://www.cpan.org/src/5.0/perl-5.32.1.tar.xz", - "https://salsa.debian.org/perl-team/interpreter/perl/-/archive/5f2dc80/perl-5f2dc80.tar.bz2"]) - - # libarchive-3.5.2 - self.get_file("https://libarchive.org/downloads/libarchive-3.5.2.tar.xz") - - # openssl-1.1.1l - self.get_file("https://www.openssl.org/source/openssl-1.1.1l.tar.gz") - - # xbps 0.59.1 - self.get_file("https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz", - output="xbps-0.59.1.tar.gz") - - # autoconf 2.71 - self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz") - - # automake 1.16.3 - self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz") - - # patch 2.7.6 - self.get_file(["https://mirrors.kernel.org/gnu/patch/patch-2.7.6.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-e017871.tar.gz"]) - - # gettext 0.21 - self.get_file(["https://mirrors.kernel.org/gnu/gettext/gettext-0.21.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-7daa86f.tar.gz"]) - - # texinfo 6.7 - self.get_file(["https://mirrors.kernel.org/gnu/texinfo/texinfo-6.7.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b81ec69.tar.gz"]) - - # zlib 1.2.12 - self.get_file("https://www.zlib.net/zlib-1.2.12.tar.xz") - - # gcc 4.7.4 - self.get_file("https://mirrors.kernel.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2") - - # gperf 3.1 - self.get_file("https://mirrors.kernel.org/gnu/gperf/gperf-3.1.tar.gz") - - # libunistring 0.9.10 - self.get_file(["https://mirrors.kernel.org/gnu/libunistring/libunistring-0.9.10.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-52a06cb3.tar.gz"]) - - # libffi 3.3 - self.get_file("https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz") - - # libatomic_ops 7.6.10 - self.get_file("https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz") - - # boehm-gc 8.0.4 - self.get_file("https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz") - - # guile 3.0.7 - self.get_file(["https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz", - "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz", - "https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"], - output=["guile-3.0.7.tar.xz", "gnulib-901694b9.tar.gz", "guile-psyntax-bootstrapping.tar.gz"]) diff --git a/sysc/autoconf-2.69/autoconf-2.69.sh b/sysc/autoconf-2.69/autoconf-2.69.sh index 18ced3d..997017e 100755 --- a/sysc/autoconf-2.69/autoconf-2.69.sh +++ b/sysc/autoconf-2.69/autoconf-2.69.sh @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.xz" + src_prepare() { rm doc/standards.info man/*.1 autoreconf-2.64 -f diff --git a/sysc/autoconf-2.71/autoconf-2.71.sh b/sysc/autoconf-2.71/autoconf-2.71.sh index f43ac73..951ca24 100755 --- a/sysc/autoconf-2.71/autoconf-2.71.sh +++ b/sysc/autoconf-2.71/autoconf-2.71.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz" + src_prepare() { rm doc/standards.info autoreconf-2.69 -fi diff --git a/sysc/autoconf-archive-2021.02.19/autoconf-archive-2021.02.19.sh b/sysc/autoconf-archive-2021.02.19/autoconf-archive-2021.02.19.sh index 8be7e5d..965506b 100755 --- a/sysc/autoconf-archive-2021.02.19/autoconf-archive-2021.02.19.sh +++ b/sysc/autoconf-archive-2021.02.19/autoconf-archive-2021.02.19.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz" + src_prepare() { autoreconf-2.69 -fi } diff --git a/sysc/automake-1.11.2/automake-1.11.2.sh b/sysc/automake-1.11.2/automake-1.11.2.sh index 790535c..a3796f6 100755 --- a/sysc/automake-1.11.2/automake-1.11.2.sh +++ b/sysc/automake-1.11.2/automake-1.11.2.sh @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2" + src_prepare() { default diff --git a/sysc/automake-1.15.1/automake-1.15.1.sh b/sysc/automake-1.15.1/automake-1.15.1.sh index 7e2204b..d12587f 100755 --- a/sysc/automake-1.15.1/automake-1.15.1.sh +++ b/sysc/automake-1.15.1/automake-1.15.1.sh @@ -3,6 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.xz" + src_prepare() { default diff --git a/sysc/automake-1.16.3/automake-1.16.3.sh b/sysc/automake-1.16.3/automake-1.16.3.sh index eede7a7..2629602 100755 --- a/sysc/automake-1.16.3/automake-1.16.3.sh +++ b/sysc/automake-1.16.3/automake-1.16.3.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz" + src_prepare() { ./bootstrap diff --git a/sysc/bash-5.1/bash-5.1.sh b/sysc/bash-5.1/bash-5.1.sh index 7c3b3af..33f42ba 100755 --- a/sysc/bash-5.1/bash-5.1.sh +++ b/sysc/bash-5.1/bash-5.1.sh @@ -5,6 +5,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/bash/bash-5.1.tar.gz" + src_prepare() { # Remove bison generated files rm y.tab.c y.tab.h diff --git a/sysc/bison-2.3/bison-2.3.sh b/sysc/bison-2.3/bison-2.3.sh index 882fd22..c1d6a88 100755 --- a/sysc/bison-2.3/bison-2.3.sh +++ b/sysc/bison-2.3/bison-2.3.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-b28236b.tar.gz" +urls="http://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2 + http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz" src_prepare() { default diff --git a/sysc/bison-3.4.2/bison-3.4.2.sh b/sysc/bison-3.4.2/bison-3.4.2.sh index 3a2addf..900a69f 100755 --- a/sysc/bison-3.4.2/bison-3.4.2.sh +++ b/sysc/bison-3.4.2/bison-3.4.2.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-672663a.tar.gz" +urls="http://mirrors.kernel.org/gnu/bison/bison-3.4.2.tar.xz + http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-672663a.tar.gz" src_prepare() { default diff --git a/sysc/coreutils-8.32/coreutils-8.32.sh b/sysc/coreutils-8.32/coreutils-8.32.sh index 8565a54..dcd22d5 100755 --- a/sysc/coreutils-8.32/coreutils-8.32.sh +++ b/sysc/coreutils-8.32/coreutils-8.32.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-d279bc.tar.gz" +urls="http://git.savannah.gnu.org/cgit/coreutils.git/snapshot/coreutils-8.32.tar.gz + http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-d279bc.tar.gz" regenerate_files() { build-aux/gen-lists-of-programs.sh --autoconf > m4/cu-progs.m4 diff --git a/sysc/dist-3.5-236/dist-3.5-236.sh b/sysc/dist-3.5-236/dist-3.5-236.sh index 04076e1..7b5d180 100755 --- a/sysc/dist-3.5-236/dist-3.5-236.sh +++ b/sysc/dist-3.5-236/dist-3.5-236.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://deb.debian.org/debian/pool/main/d/dist/dist_3.5-236.orig.tar.gz" + # We manually compile here because ./Configure uses metaconfig itself # *sigh* diff --git a/sysc/flex-2.5.33/flex-2.5.33.sh b/sysc/flex-2.5.33/flex-2.5.33.sh index 6ac4707..caa8041 100755 --- a/sysc/flex-2.5.33/flex-2.5.33.sh +++ b/sysc/flex-2.5.33/flex-2.5.33.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz" + src_prepare() { default diff --git a/sysc/gc-8.0.4/gc-8.0.4.sh b/sysc/gc-8.0.4/gc-8.0.4.sh index 1118d94..2ae13e1 100755 --- a/sysc/gc-8.0.4/gc-8.0.4.sh +++ b/sysc/gc-8.0.4/gc-8.0.4.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz" + src_prepare() { autoreconf-2.71 -fi } diff --git a/sysc/gcc-4.7.4/gcc-4.7.4.sh b/sysc/gcc-4.7.4/gcc-4.7.4.sh index a9ce040..a81fd1b 100755 --- a/sysc/gcc-4.7.4/gcc-4.7.4.sh +++ b/sysc/gcc-4.7.4/gcc-4.7.4.sh @@ -4,6 +4,8 @@ # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://mirrors.kernel.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2" + src_prepare() { default diff --git a/sysc/gettext-0.21/gettext-0.21.sh b/sysc/gettext-0.21/gettext-0.21.sh index 244fc5b..4ac8c2c 100755 --- a/sysc/gettext-0.21/gettext-0.21.sh +++ b/sysc/gettext-0.21/gettext-0.21.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-7daa86f.tar.gz" +urls="https://mirrors.kernel.org/gnu/gettext/gettext-0.21.tar.xz + https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-7daa86f.tar.gz" src_prepare() { find . -name '*.info*' -delete diff --git a/sysc/gmp-6.2.1/gmp-6.2.1.sh b/sysc/gmp-6.2.1/gmp-6.2.1.sh index ab989ff..e213da0 100755 --- a/sysc/gmp-6.2.1/gmp-6.2.1.sh +++ b/sysc/gmp-6.2.1/gmp-6.2.1.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz" + src_prepare() { default diff --git a/sysc/gperf-3.1/gperf-3.1.sh b/sysc/gperf-3.1/gperf-3.1.sh index 24144b5..970cf8e 100755 --- a/sysc/gperf-3.1/gperf-3.1.sh +++ b/sysc/gperf-3.1/gperf-3.1.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://mirrors.kernel.org/gnu/gperf/gperf-3.1.tar.gz" + src_prepare() { find . -name '*.info*' -delete diff --git a/sysc/guile-3.0.7/guile-3.0.7.sh b/sysc/guile-3.0.7/guile-3.0.7.sh index 07c55f0..9edcae6 100755 --- a/sysc/guile-3.0.7/guile-3.0.7.sh +++ b/sysc/guile-3.0.7/guile-3.0.7.sh @@ -4,7 +4,9 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-901694b9.tar.gz guile-psyntax-bootstrapping.tar.gz" +urls="https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz + https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz + https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz" src_prepare() { default diff --git a/sysc/libarchive-3.5.2/libarchive-3.5.2.sh b/sysc/libarchive-3.5.2/libarchive-3.5.2.sh index 5564361..6045e39 100755 --- a/sysc/libarchive-3.5.2/libarchive-3.5.2.sh +++ b/sysc/libarchive-3.5.2/libarchive-3.5.2.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://libarchive.org/downloads/libarchive-3.5.2.tar.xz" + src_prepare() { default diff --git a/sysc/libatomic_ops-7.6.10/libatomic_ops-7.6.10.sh b/sysc/libatomic_ops-7.6.10/libatomic_ops-7.6.10.sh index 1387d8c..d494dbf 100755 --- a/sysc/libatomic_ops-7.6.10/libatomic_ops-7.6.10.sh +++ b/sysc/libatomic_ops-7.6.10/libatomic_ops-7.6.10.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz" + src_prepare() { autoreconf-2.71 -fi } diff --git a/sysc/libffi-3.3/libffi-3.3.sh b/sysc/libffi-3.3/libffi-3.3.sh index f8e0a4d..32e72dd 100755 --- a/sysc/libffi-3.3/libffi-3.3.sh +++ b/sysc/libffi-3.3/libffi-3.3.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz" + src_prepare() { find . -name '*.info*' -delete diff --git a/sysc/libunistring-0.9.10/libunistring-0.9.10.sh b/sysc/libunistring-0.9.10/libunistring-0.9.10.sh index 414fafa..ffa0495 100755 --- a/sysc/libunistring-0.9.10/libunistring-0.9.10.sh +++ b/sysc/libunistring-0.9.10/libunistring-0.9.10.sh @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-52a06cb3.tar.gz" +urls="https://mirrors.kernel.org/gnu/libunistring/libunistring-0.9.10.tar.xz + https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-52a06cb3.tar.gz" src_prepare() { find . -name '*.info*' -delete diff --git a/sysc/make-4.2.1/make-4.2.1.sh b/sysc/make-4.2.1/make-4.2.1.sh index 47a878e..d685447 100755 --- a/sysc/make-4.2.1/make-4.2.1.sh +++ b/sysc/make-4.2.1/make-4.2.1.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz" + src_prepare() { default diff --git a/sysc/mpc-1.2.1/mpc-1.2.1.sh b/sysc/mpc-1.2.1/mpc-1.2.1.sh index 2bc9e11..bca3e8e 100755 --- a/sysc/mpc-1.2.1/mpc-1.2.1.sh +++ b/sysc/mpc-1.2.1/mpc-1.2.1.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/mpc/mpc-1.2.1.tar.gz" + src_prepare() { default diff --git a/sysc/mpfr-4.1.0/mpfr-4.1.0.sh b/sysc/mpfr-4.1.0/mpfr-4.1.0.sh index 3b35f6a..1db8d4b 100755 --- a/sysc/mpfr-4.1.0/mpfr-4.1.0.sh +++ b/sysc/mpfr-4.1.0/mpfr-4.1.0.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://mirrors.kernel.org/gnu/mpfr/mpfr-4.1.0.tar.xz" + src_prepare() { default diff --git a/sysc/openssl-1.1.1l/openssl-1.1.1l.sh b/sysc/openssl-1.1.1l/openssl-1.1.1l.sh index 4db2199..7a175c6 100755 --- a/sysc/openssl-1.1.1l/openssl-1.1.1l.sh +++ b/sysc/openssl-1.1.1l/openssl-1.1.1l.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://artfiles.org/openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz" + src_prepare() { default diff --git a/sysc/patch-2.7.6/patch-2.7.6.sh b/sysc/patch-2.7.6/patch-2.7.6.sh index a378282..baca831 100755 --- a/sysc/patch-2.7.6/patch-2.7.6.sh +++ b/sysc/patch-2.7.6/patch-2.7.6.sh @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-e017871.tar.gz" +urls="https://mirrors.kernel.org/gnu/patch/patch-2.7.6.tar.xz + https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-e017871.tar.gz" src_prepare() { ../../import-gnulib.sh diff --git a/sysc/perl-5.10.1/perl-5.10.1.sh b/sysc/perl-5.10.1/perl-5.10.1.sh index add43e1..95b2119 100755 --- a/sysc/perl-5.10.1/perl-5.10.1.sh +++ b/sysc/perl-5.10.1/perl-5.10.1.sh @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="perl-5.10.1.tar.bz2" +urls="http://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2" src_prepare() { default_src_prepare diff --git a/sysc/perl-5.32.1/patches/reproducibility.patch b/sysc/perl-5.32.1/patches/reproducibility.patch index 88dfa58..1875f10 100644 --- a/sysc/perl-5.32.1/patches/reproducibility.patch +++ b/sysc/perl-5.32.1/patches/reproducibility.patch @@ -7,8 +7,8 @@ generate with correct values for live-bootstrap. NOTE: this patch CANNOT be applied to a non-live-bootstrap environment. ---- ../perl-5f2dc80/regen-configure/U/threads/archname.U 2022-02-27 21:30:03.155396204 +1100 -+++ ../perl-5f2dc80/regen-configure/U/threads/archname.U 2022-02-27 21:30:49.392396204 +1100 +--- ../metaconfig-5.32.1~rc1/U/threads/archname.U 2022-02-27 21:30:03.155396204 +1100 ++++ ../metaconfig-5.32.1~rc1/U/threads/archname.U 2022-02-27 21:30:49.392396204 +1100 @@ -79,7 +79,7 @@ ?X: Very GCCian. *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;; @@ -18,8 +18,8 @@ NOTE: this patch CANNOT be applied to a non-live-bootstrap environment. case "$archname" in '') dflt="$tarch";; *) dflt="$archname";; ---- ../perl-5f2dc80/regen-configure/U/modified/Oldconfig.U 2022-02-27 21:31:26.911396204 +1100 -+++ ../perl-5f2dc80/regen-configure/U/modified/Oldconfig.U 2022-02-27 21:32:31.846396204 +1100 +--- ../metaconfig-5.32.1~rc1/U/modified/Oldconfig.U 2022-02-27 21:31:26.911396204 +1100 ++++ ../metaconfig-5.32.1~rc1/U/modified/Oldconfig.U 2022-02-27 21:32:31.846396204 +1100 @@ -117,16 +117,13 @@ ?X: on some machines to avoid the error message when uname is not found; e.g. ?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh! diff --git a/sysc/perl-5.32.1/patches/reproducibility2.patch b/sysc/perl-5.32.1/patches/reproducibility2.patch index b5965cd..9727ce3 100644 --- a/sysc/perl-5.32.1/patches/reproducibility2.patch +++ b/sysc/perl-5.32.1/patches/reproducibility2.patch @@ -7,8 +7,8 @@ generate with correct values for live-bootstrap. NOTE: this patch CANNOT be applied to a non-live-bootstrap environment. ---- ../perl-5f2dc80/regen-configure/dist/U/archname.U 2022-02-26 10:51:45.343097807 +1100 -+++ ../perl-5f2dc80/regen-configure/dist/U/archname.U 2022-02-26 10:51:51.742527859 +1100 +--- ../metaconfig-5.32.1~rc1/dist/U/archname.U 2022-02-26 10:51:45.343097807 +1100 ++++ ../metaconfig-5.32.1~rc1/dist/U/archname.U 2022-02-26 10:51:51.742527859 +1100 @@ -72,5 +72,5 @@ rp='What is your architecture name' . ./myread @@ -16,8 +16,8 @@ NOTE: this patch CANNOT be applied to a non-live-bootstrap environment. -myarchname="$tarch" +myarchname="i386" ---- ../perl-5f2dc80/regen-configure/dist/U/Oldconfig.U 2022-02-27 10:55:04.890396204 +1100 -+++ ../perl-5f2dc80/regen-configure/dist/U/Oldconfig.U 2022-02-27 11:00:31.324396204 +1100 +--- ../metaconfig-5.32.1~rc1/dist/U/Oldconfig.U 2022-02-27 10:55:04.890396204 +1100 ++++ ../metaconfig-5.32.1~rc1/dist/U/Oldconfig.U 2022-02-27 11:00:31.324396204 +1100 @@ -109,16 +109,13 @@ ?LINT:extern hostarch libswanted libs ?LINT:change hostarch libswanted libs diff --git a/sysc/perl-5.32.1/perl-5.32.1.sh b/sysc/perl-5.32.1/perl-5.32.1.sh index 6c997c3..e375441 100755 --- a/sysc/perl-5.32.1/perl-5.32.1.sh +++ b/sysc/perl-5.32.1/perl-5.32.1.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="perl-5f2dc80.tar.bz2" +urls="http://www.cpan.org/src/5.0/perl-5.32.1.tar.xz + http://deb.debian.org/debian/pool/main/p/perl/perl_5.32.1.orig-regen-configure.tar.gz" src_prepare() { default @@ -26,8 +27,8 @@ src_prepare() { # Regenerate configure + config_h.SH rm -f Configure config_h.SH - ln -s ../perl-5f2dc80/regen-configure/.package . - ln -s ../perl-5f2dc80/regen-configure/U . + ln -s ../metaconfig-5.32.1\~rc1/.package . + ln -s ../metaconfig-5.32.1\~rc1/U . metaconfig -m } diff --git a/sysc/pkg-config-0.29.2/pkg-config-0.29.2.sh b/sysc/pkg-config-0.29.2/pkg-config-0.29.2.sh index d74e6c1..51c9473 100755 --- a/sysc/pkg-config-0.29.2/pkg-config-0.29.2.sh +++ b/sysc/pkg-config-0.29.2/pkg-config-0.29.2.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://gentoo.osuosl.org/distfiles/pkg-config-0.29.2.tar.gz" + src_prepare() { autoreconf -fi } diff --git a/sysc/run.sh b/sysc/run.sh index 940c5b0..44ce1d2 100755 --- a/sysc/run.sh +++ b/sysc/run.sh @@ -23,12 +23,16 @@ create_fhs() { test -d /sys || (mkdir /sys && mount -t sysfs sysfs /sys) # Make /tmp a ramdisk (speeds up configure etc significantly) test -d /tmp || (mkdir /tmp && mount -t tmpfs tmpfs /tmp) + # Add /etc/resolv.conf + echo 'nameserver 1.1.1.1' > /etc/resolv.conf } populate_device_nodes "" create_fhs +mkdir -p "${DISTFILES}" + build bash-5.1 exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" SRCDIR="${SRCDIR}" bash run2.sh diff --git a/sysc/run2.sh b/sysc/run2.sh index 3708c3f..33bc52c 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -51,7 +51,7 @@ build bison-3.4.2 build perl-5.10.1 -build dist-3.5-236 '' '' dist-d1de81f +build dist-3.5-236 build perl-5.32.1 diff --git a/sysc/tar-1.34/tar-1.34.sh b/sysc/tar-1.34/tar-1.34.sh index b6c6e38..171ab03 100755 --- a/sysc/tar-1.34/tar-1.34.sh +++ b/sysc/tar-1.34/tar-1.34.sh @@ -3,7 +3,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-30820c.tar.gz" +urls="http://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz + http://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz" src_prepare() { default diff --git a/sysc/texinfo-6.7/texinfo-6.7.sh b/sysc/texinfo-6.7/texinfo-6.7.sh index b7debe4..0ac6b0b 100755 --- a/sysc/texinfo-6.7/texinfo-6.7.sh +++ b/sysc/texinfo-6.7/texinfo-6.7.sh @@ -2,7 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -EXTRA_DISTFILES="gnulib-b81ec69.tar.gz" +urls="https://mirrors.kernel.org/gnu/texinfo/texinfo-6.7.tar.xz + https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b81ec69.tar.gz" src_prepare() { find . -name '*.mo' -delete diff --git a/sysc/xbps-0.59.1/xbps-0.59.1.sh b/sysc/xbps-0.59.1/xbps-0.59.1.sh index 9270d7d..8cd12b6 100755 --- a/sysc/xbps-0.59.1/xbps-0.59.1.sh +++ b/sysc/xbps-0.59.1/xbps-0.59.1.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz" + src_configure() { PKG_CONFIG_PATH="${PREFIX}/lib/musl/pkgconfig" \ ./configure --prefix="${PREFIX}" \ diff --git a/sysc/xz-5.0.5/xz-5.0.5.sh b/sysc/xz-5.0.5/xz-5.0.5.sh index d45918a..14d0494 100755 --- a/sysc/xz-5.0.5/xz-5.0.5.sh +++ b/sysc/xz-5.0.5/xz-5.0.5.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="http://ixpeering.dl.sourceforge.net/project/lzmautils/xz-5.0.5.tar.bz2" + src_prepare() { default diff --git a/sysc/zlib-1.2.12/zlib-1.2.12.sh b/sysc/zlib-1.2.12/zlib-1.2.12.sh index ee19abf..f059613 100755 --- a/sysc/zlib-1.2.12/zlib-1.2.12.sh +++ b/sysc/zlib-1.2.12/zlib-1.2.12.sh @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +urls="https://www.zlib.net/zlib-1.2.12.tar.xz" + src_configure() { ./configure --prefix="${PREFIX}" --libdir="${PREFIX}/lib/musl" --static } From 6ea1b8e29515e4bfc5696f2b0e1bb59051b9028b Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sun, 22 May 2022 09:56:18 +1000 Subject: [PATCH 5/9] Add e2fsprogs 1.45.7 Additionally, fix downloading in chunks for some files. --- lib/sysgeneral.py | 3 +- sysa.py | 16 +++- sysa/SHA256SUMS.sources | 9 +++ sysa/e2fsprogs-1.45.7/e2fsprogs-1.45.7.sh | 49 ++++++++++++ sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch | 30 ++++++++ .../patches/remove-intl.patch | 76 +++++++++++++++++++ sysa/run.sh | 2 + 7 files changed, 181 insertions(+), 4 deletions(-) create mode 100755 sysa/e2fsprogs-1.45.7/e2fsprogs-1.45.7.sh create mode 100644 sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch create mode 100644 sysa/e2fsprogs-1.45.7/patches/remove-intl.patch diff --git a/lib/sysgeneral.py b/lib/sysgeneral.py index 6208e2b..002b4f1 100644 --- a/lib/sysgeneral.py +++ b/lib/sysgeneral.py @@ -100,7 +100,8 @@ this script the next time") response = requests.get(url, allow_redirects=True, stream=True) if response.status_code == 200: with open(abs_file_name, 'wb') as target_file: - target_file.write(response.raw.read()) + for chunk in response.iter_content(chunk_size=None): + target_file.write(chunk) else: raise Exception("Download failed.") diff --git a/sysa.py b/sysa.py index 8859b4a..be8f401 100755 --- a/sysa.py +++ b/sysa.py @@ -260,6 +260,19 @@ class SysA(SysGeneral): # util-linux 2.19.1 self.get_file("https://mirrors.kernel.org/pub/linux/utils/util-linux/v2.19/util-linux-2.19.1.tar.gz") + # curl 7.83.0 + self.get_file("https://curl.se/download/curl-7.83.0.tar.bz2") + + # e2fsprogs 1.45.7 + self.get_file(["https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.45.7/e2fsprogs-1.45.7.tar.gz", + "https://www.unicode.org/Public/11.0.0/ucd/CaseFolding.txt", + "https://www.unicode.org/Public/11.0.0/ucd/DerivedAge.txt", + "https://www.unicode.org/Public/11.0.0/ucd/extracted/DerivedCombiningClass.txt", + "https://www.unicode.org/Public/11.0.0/ucd/DerivedCoreProperties.txt", + "https://www.unicode.org/Public/11.0.0/ucd/NormalizationCorrections.txt", + "https://www.unicode.org/Public/11.0.0/ucd/NormalizationTest.txt", + "https://www.unicode.org/Public/11.0.0/ucd/UnicodeData.txt"]) + # kexec-tools 2.0.22 self.get_file("https://github.com/horms/kexec-tools/archive/refs/tags/v2.0.22.tar.gz", output="kexec-tools-2.0.22.tar.gz") @@ -270,9 +283,6 @@ class SysA(SysGeneral): # make 3.82 self.get_file("https://mirrors.kernel.org/gnu/make/make-3.82.tar.gz") - # curl 7.83.0 - self.get_file("https://curl.se/download/curl-7.83.0.tar.bz2") - # linux kernel 2.6.16.62 self.get_file(["https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.9.10.tar.gz", "https://linux-libre.fsfla.org/pub/linux-libre/releases/old/gen6/4.9.10-gnu/deblob-4.9"]) diff --git a/sysa/SHA256SUMS.sources b/sysa/SHA256SUMS.sources index 2ab79bb..30402a9 100644 --- a/sysa/SHA256SUMS.sources +++ b/sysa/SHA256SUMS.sources @@ -1,3 +1,10 @@ +64f117a4749dd4a1b6c54277f63f6cf1e0eb45d290cbedaf777fbe71b8880885 CaseFolding.txt +eb115a5de9a32c9ad447d6ea1cddcadb53d47f6cbc2521f3fe0bebb040c39866 DerivedAge.txt +11c8bd81ecbede4d67c7b5b693a471647d5401956707c639ae053b836cc7f5da DerivedCombiningClass.txt +3406825d64564bf2a37031c36a3e0f99d708aa17595b81f8b539d0f3d1a3923f DerivedCoreProperties.txt +c9ffe32e616fa085246644c2351c525788fac363872491185dab7d5ce69fefa9 NormalizationCorrections.txt +0fdfc17093dd5482f8089cb11dcd936abdba34c4c9c324e5b8a4e5d8f943f6d3 NormalizationTest.txt +4997a3196eb79b4d0d6b8384560f6aeb46a062693f0abd5ba736abbff7976099 UnicodeData.txt 66fde474e124e80c843560041cd68820c9dce56e696f388312ba30361a814a16 autoconf-2.12.tar.gz f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e autoconf-2.13.tar.gz 4681bcbb9c9298c506f6405a7deb62c54fc3b339d3239a8f36a5df83daaec94f autoconf-2.52.tar.bz2 @@ -25,6 +32,8 @@ c25b36b8af6e0ad2a875daf4d6196bd0df28a62be7dd252e5f99a4d5d7288d95 coreutils-5.0. 1d013547889f20576460249c4210632d5314531c8477378a2e046b13a8ebeb7e coreutils-6.10.tar.gz af4214b851928a53ef470ed8729122b9db910a6c0769d5d46a5de0b3e96f74f3 deblob-4.9 d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7.tar.gz +54437ae4211867de7ad55723f68b94c29cb2f08a23f431e0bbbc9f34ee384f47 dist-3.5-236.tar.gz +340e9de42a12d0c26dd7527e9ef055ac85586de5c61f6273ae19f88d04e55804 e2fsprogs-1.45.7.tar.gz 813cd9405aceec5cfecbe96400d01e90ddad7b512d3034487176ce5258ab0f78 findutils-4.2.33.tar.gz bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689 flex-2.5.11.tar.gz e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 flex-2.6.4.tar.gz diff --git a/sysa/e2fsprogs-1.45.7/e2fsprogs-1.45.7.sh b/sysa/e2fsprogs-1.45.7/e2fsprogs-1.45.7.sh new file mode 100755 index 0000000..3d3f9e5 --- /dev/null +++ b/sysa/e2fsprogs-1.45.7/e2fsprogs-1.45.7.sh @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_unpack() { + default + + # Get remaining utf files + cp ${DISTFILES}/*.txt ${pkg}/ +} + +src_prepare() { + default + + # Rebuild libtool files + rm config/config.guess config/config.sub config/ltmain.sh + libtoolize -i + + autoreconf -fi + + # Remove bison parser generated + rm intl/plural.y + + # Setup for regeneratation of lib/ext2fs/utf8data.h + rm lib/ext2fs/utf8data.h + + # Fix compile_et + sed -r -i "s/ > ?outfile//" lib/et/et_c.awk lib/et/et_h.awk lib/ss/ct_c.awk + + # Disable int + sed -i "s/@LIBINTL@//" MCONFIG.in +} + +src_configure() { + ./configure --prefix="${PREFIX}" \ + --sbindir="${PREFIX}/bin" \ + with_udev_rules_dir=no \ + with_systemd_unit_dir=no +} + +src_compile() { + # Regen utf8data + make -C util mkutf8data + util/mkutf8data -o lib/ext2fs/utf8data.h + # Why does mkutf8data generate something not usable by build? + sed -i "s/nfkdi/nfdi/g" lib/ext2fs/utf8data.h + + default +} diff --git a/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch b/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch new file mode 100644 index 0000000..1bc8fe3 --- /dev/null +++ b/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch @@ -0,0 +1,30 @@ +--- lib/et/compile_et.sh.in 2022-05-18 19:26:17.182054784 +1000 ++++ lib/et/compile_et.sh.in 2022-05-18 19:30:16.489294776 +1000 +@@ -44,14 +44,14 @@ + exit 1; + fi + +-$AWK -f "${DIR}/et_h.awk" "outfile=${BASE}.h.$$" "outfn=${BASE}.h" "$ROOT.et" ++$AWK -f "${DIR}/et_h.awk" "$ROOT.et" > ${BASE}.h + if test -f ${BASE}.h && cmp -s ${BASE}.h.$$ ${BASE}.h ; then + rm -f ${BASE}.h.$$ + else + mv -f ${BASE}.h.$$ ${BASE}.h + chmod a-w ${BASE}.h + fi +-$AWK -f "${DIR}/et_c.awk" "outfile=${BASE}.c.$$" "outfn=${BASE}.c" "$ROOT.et" ++$AWK -f "${DIR}/et_c.awk" "$ROOT.et" > ${BASE}.c + if test -f ${BASE}.c && cmp -s ${BASE}.c.$$ ${BASE}.c ; then + rm -f ${BASE}.c.$$ + else +--- lib/ss/mk_cmds.sh.in 2022-05-18 19:33:16.024962919 +1000 ++++ lib/ss/mk_cmds.sh.in 2022-05-18 19:33:39.650576476 +1000 +@@ -43,7 +43,7 @@ + fi + + ${SED} -f "${DIR}/ct_c.sed" "${FILE}" \ +- | ${AWK} -f "${DIR}/ct_c.awk" "rootname=${ROOT}" "outfile=${TMP}" - ++ | ${AWK} -f "${DIR}/ct_c.awk" "rootname=${ROOT}" - > "${TMP}" + + if grep "^#__ERROR_IN_FILE" "${TMP}" > /dev/null; then + rm "${TMP}" diff --git a/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch b/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch new file mode 100644 index 0000000..160107d --- /dev/null +++ b/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch @@ -0,0 +1,76 @@ +--- configure.ac 2022-05-18 15:12:53.633061872 +1000 ++++ configure.ac 2022-05-18 19:09:13.351790066 +1000 +@@ -860,20 +860,7 @@ + dnl + MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library + AC_SUBST_FILE(MAKEFILE_LIBRARY) +-dnl +-dnl Add internationalization support, using gettext. +-dnl +-GETTEXT_PACKAGE=e2fsprogs +-PACKAGE=e2fsprogs +-VERSION="$E2FSPROGS_VERSION" +-VERSION=0.14.1 +-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name for gettext]) +-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version for gettext]) +-AC_SUBST(GETTEXT_PACKAGE) +-AC_SUBST(PACKAGE) +-AC_SUBST(VERSION) + +-AM_GNU_GETTEXT + dnl + dnl End of configuration options + dnl +@@ -1637,15 +1624,6 @@ + [with_udev_rules_dir=yes]) + AS_IF([test "x${with_udev_rules_dir}" != "xno"], + [ +- AS_IF([test "x${with_udev_rules_dir}" = "xyes"], +- [ +- PKG_CHECK_MODULES([udev], [udev], +- [ +- with_udev_rules_dir="$($PKG_CONFIG --variable=udevdir udev)/rules.d" +- ], [ +- with_udev_rules_dir="" +- ]) +- ]) + AC_MSG_CHECKING([for udev rules dir]) + pkg_udev_rules_dir="${with_udev_rules_dir}" + AS_IF([test -n "${pkg_udev_rules_dir}"], +@@ -1708,16 +1686,6 @@ + [with_systemd_unit_dir=yes]) + AS_IF([test "x${with_systemd_unit_dir}" != "xno"], + [ +- AS_IF([test "x${with_systemd_unit_dir}" = "xyes"], +- [ +- PKG_CHECK_MODULES([systemd], [systemd], +- [ +- with_systemd_unit_dir="$($PKG_CONFIG --variable=systemdsystemunitdir systemd)" +- ], [ +- with_systemd_unit_dir="" +- ]) +- m4_pattern_allow([^PKG_(MAJOR|MINOR|BUILD|REVISION)$]) +- ]) + AC_MSG_CHECKING([for systemd system unit dir]) + systemd_system_unit_dir="${with_systemd_unit_dir}" + AS_IF([test -n "${systemd_system_unit_dir}"], +--- Makefile.in 2022-05-18 19:41:37.596959349 +1000 ++++ Makefile.in 2022-05-18 19:41:41.109050161 +1000 +@@ -20,7 +20,7 @@ + @ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs + + LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \ +- $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) intl ++ $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) + + PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \ + $(E2SCRUB_DIR) +@@ -22,7 +22,7 @@ + LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \ + $(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR) + +-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \ ++PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs \ + $(E2SCRUB_DIR) + + SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests diff --git a/sysa/run.sh b/sysa/run.sh index 3a18b72..7efec06 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -228,6 +228,8 @@ build gcc-4.0.4 pass2.sh build util-linux-2.19.1 +build e2fsprogs-1.45.7 + build kbd-1.15 build make-3.82 From 0ce50a6393c1ee08985da2124d76595a9cbbdd1b Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sun, 22 May 2022 10:03:21 +1000 Subject: [PATCH 6/9] Add options for; - disk to be created (blank disk given to live-bootstrap) (default) - disk to already exist but sources downloaded within live-bootstrap - sources to be downloaded outside live-bootstrap (non-blank disk given to live-bootstrap) Also migrate sysb to use sys_transfer in QEMU mode also. Note that this means copy_sysc is now irrelevant. sysc is *always* sourced from sysa. --- lib/utils.py | 9 +-- rootfs.py | 15 ++--- sysa.py | 17 +++--- sysa/helpers.sh | 9 ++- sysa/run.sh | 15 ++--- sysb/init | 26 ++++++++- sysb/run.sh | 20 ++++++- sysc.py | 151 +++++++++++++++++++++++++++++++++++++++++++++--- sysc/init | 8 +-- 9 files changed, 219 insertions(+), 51 deletions(-) diff --git a/lib/utils.py b/lib/utils.py index 72cf508..8b3733d 100755 --- a/lib/utils.py +++ b/lib/utils.py @@ -32,10 +32,11 @@ def create_disk(image, disk_type, fs_type, size): loop_dev = run('sudo', 'losetup', '-f', capture_output=True).stdout.decode().strip() run('sudo', 'losetup', '-P', loop_dev, image) # Create the partition - run('sudo', 'parted', '--script', image, 'mklabel', disk_type, 'mkpart', - 'primary', 'ext4', '0%', '100%') - run('sudo', 'partprobe', loop_dev) - run('sudo', 'mkfs.' + fs_type, loop_dev + "p1") + if disk_type != "none": + run('sudo', 'parted', '--script', image, 'mklabel', disk_type, 'mkpart', + 'primary', 'ext4', '0%', '100%') + run('sudo', 'partprobe', loop_dev) + run('sudo', 'mkfs.' + fs_type, loop_dev + "p1") return loop_dev def mount(source, target, fs_type, options='', **kwargs): diff --git a/rootfs.py b/rootfs.py index c3212f3..2be4506 100755 --- a/rootfs.py +++ b/rootfs.py @@ -33,7 +33,10 @@ def create_configuration_file(args): config.write("FORCE_TIMESTAMPS=" + str(args.force_timestamps) + "\n") config.write("CHROOT=" + str(args.chroot or args.bwrap) + "\n") config.write("UPDATE_CHECKSUMS=" + str(args.update_checksums) + "\n") - config.write("DISK=sda1\n") + if args.external_sources: + config.write("DISK=sda1\n") + else: + config.write("DISK=sda\n") def main(): """ @@ -57,6 +60,8 @@ def main(): parser.add_argument("--update-checksums", help="Update checksum files.", action="store_true") + parser.add_argument("--external-sources", + help="Download sources externally from live-bootstrap.") parser.add_argument("--no-create-config", help="Do not automatically create config file", action="store_true") @@ -116,7 +121,7 @@ def main(): pass system_c = SysC(arch=args.arch, preserve_tmp=args.preserve, - tmpdir=args.tmpdir) + tmpdir=args.tmpdir, external_sources=args.external_sources) system_b = SysB(arch=args.arch, preserve_tmp=args.preserve) system_a = SysA(arch=args.arch, preserve_tmp=args.preserve, tmpdir=args.tmpdir, @@ -138,7 +143,6 @@ print(shutil.which('chroot')) system_c.prepare(mount_tmpfs=True, create_disk_image=False) system_a.prepare(mount_tmpfs=True, - copy_sysc=True, create_initramfs=False, repo_path=args.repo) @@ -151,7 +155,6 @@ print(shutil.which('chroot')) system_c.prepare(mount_tmpfs=False, create_disk_image=False) system_a.prepare(mount_tmpfs=False, - copy_sysc=True, create_initramfs=False, repo_path=args.repo) @@ -187,7 +190,6 @@ print(shutil.which('chroot')) system_c.prepare(mount_tmpfs=True, create_disk_image=True) system_a.prepare(mount_tmpfs=True, - copy_sysc=False, create_initramfs=True, repo_path=args.repo) @@ -211,7 +213,6 @@ print(shutil.which('chroot')) system_c.prepare(mount_tmpfs=True, create_disk_image=True) system_a.prepare(mount_tmpfs=True, - copy_sysc=False, create_initramfs=True, repo_path=args.repo) @@ -223,7 +224,6 @@ print(shutil.which('chroot')) system_c.prepare(mount_tmpfs=True, create_disk_image=True) system_a.prepare(mount_tmpfs=True, - copy_sysc=False, create_initramfs=True, repo_path=args.repo) @@ -232,6 +232,7 @@ print(shutil.which('chroot')) '-m', str(args.qemu_ram) + 'M', '-no-reboot', '-hda', system_c.dev_name, + '-nic', 'user,ipv6=off,model=e1000', '-kernel', args.kernel, '-initrd', system_a.initramfs_path, '-nographic', diff --git a/sysa.py b/sysa.py index be8f401..efa9866 100755 --- a/sysa.py +++ b/sysa.py @@ -18,7 +18,7 @@ class SysA(SysGeneral): Class responsible for preparing sources for System A. """ # pylint: disable=too-many-instance-attributes,too-many-arguments - def __init__(self, arch, preserve_tmp, tmpdir, sysb_dir, sysc_tmp): + def __init__(self, arch, preserve_tmp, tmpdir, sysb_dir, sysc_dir): self.git_dir = os.path.dirname(os.path.join(__file__)) self.arch = arch self.preserve_tmp = preserve_tmp @@ -32,9 +32,9 @@ class SysA(SysGeneral): self.base_dir = self.sysa_dir self.cache_dir = os.path.join(self.sys_dir, 'distfiles') self.sysb_dir = sysb_dir - self.sysc_tmp = sysc_tmp + self.sysc_dir = sysc_dir - def prepare(self, mount_tmpfs, copy_sysc, create_initramfs, repo_path): + def prepare(self, mount_tmpfs, create_initramfs, repo_path): """ Prepare directory structure for System A. We create an empty tmp directory, unpack stage0-posix. @@ -51,8 +51,7 @@ class SysA(SysGeneral): # sysb must be added to sysa as it is another initramfs stage self.sysb() - if copy_sysc: - self.sysc() + self.sysc() if repo_path: repo_dir = os.path.join(self.tmp_dir, 'usr', 'src', 'repo-preseeded') @@ -66,17 +65,17 @@ class SysA(SysGeneral): self.get_packages() shutil.copytree(self.sys_dir, os.path.join(self.tmp_dir, 'sysa'), - shutil.ignore_patterns('tmp')) + ignore=shutil.ignore_patterns('tmp')) def sysb(self): """Copy in sysb files for sysb.""" shutil.copytree(self.sysb_dir, os.path.join(self.tmp_dir, 'sysb'), - shutil.ignore_patterns('tmp')) + ignore=shutil.ignore_patterns('tmp')) def sysc(self): """Copy in sysc files for sysc.""" - shutil.copytree(self.sysc_tmp, os.path.join(self.tmp_dir, 'sysc'), - shutil.ignore_patterns('tmp')) + shutil.copytree(self.sysc_dir, os.path.join(self.tmp_dir, 'sysc'), + ignore=shutil.ignore_patterns('tmp', 'distfiles')) def stage0_posix(self): """Copy in all of the stage0-posix""" diff --git a/sysa/helpers.sh b/sysa/helpers.sh index 37aaae9..88526b9 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -412,6 +412,7 @@ populate_device_nodes() { sys_transfer() { local dest=$1 + local sys_sources=$2 mkdir -p "${dest}/${PREFIX}/bin" "${dest}/${PREFIX}/src" @@ -419,11 +420,13 @@ sys_transfer() { cp "${PREFIX}/bin/bash" "${PREFIX}/bin/tar" "${PREFIX}/bin/bzip2" "${dest}${PREFIX}/bin/" # Transfer misc files - cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${dest}/" + cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${dest}/${PREFIX}/src" - cp -r "${PREFIX}/src/" "${dest}${PREFIX}/" + cp -r "${sys_sources}/*" "${dest}/${PREFIX}/src" + cp -f "${sys_sources}/init" "${dest}/" + cp -r "${PREFIX}/src/repo" "${dest}/${PREFIX}/src" - shift + shift 2 # Copy additional binaries set -- "${@/#/${PREFIX}/bin/}" cp "$@" "${dest}${PREFIX}/bin/" diff --git a/sysa/run.sh b/sysa/run.sh index 7efec06..92fad85 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -22,16 +22,11 @@ export SRCDIR="${srcdir}" create_sysb() { # Copy everything in echo "Creating sysb rootfs" - mkdir -p "/sysb${PREFIX}" - for d in bin include lib libexec share src; do - # Minimise RAM (storage) use - use hard links - cp -rl "${PREFIX}/${d}" "/sysb${PREFIX}/${d}" - done - cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "/sysb/${SRCDIR}" - populate_device_nodes /sysb + sys_transfer /sysb_image /sysb + cp -rl /sysc /sysb/sysc_src echo "Creating sysb initramfs" gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb - rm -rf /sysb # Cleanup + rm -rf /sysb /sysb_image # Cleanup } go_sysb() { @@ -256,6 +251,6 @@ if [ "${CHROOT}" = False ]; then fi # In chroot mode transition directly into System C. -SYSC=/sysc -sys_transfer "${SYSC}" gzip patch +SYSC=/sysc_image +sys_transfer "${SYSC}" /sysc gzip patch exec chroot "${SYSC}" /init diff --git a/sysb/init b/sysb/init index f2aec08..30db4ce 100755 --- a/sysb/init +++ b/sysb/init @@ -7,7 +7,31 @@ set -e +. /usr/src/helpers.sh + +export PATH=/usr/bin +export PREFIX=/usr +export SOURCES=/usr/src + +echo +echo "Installing packages into sysb" + +install_tar() { + echo "${1}: installing package" + src_apply_tar "$@" +} + +# Install needed packages. +install_tar coreutils-5.0 0 +install_tar sed-4.0.9 0 + +install_tar bzip2-1.0.8 0 +install_tar coreutils-6.10 0 +install_tar e2fsprogs-1.45.7 0 +install_tar grep-2.4 0 +install_tar kexec-tools-2.0.22 0 +install_tar util-linux-2.19.1 0 + # Begin sysb bootstrapping process -mv ./run.sh /usr/src cd /usr/src ./run.sh diff --git a/sysb/run.sh b/sysb/run.sh index 841b81c..49428a3 100755 --- a/sysb/run.sh +++ b/sysb/run.sh @@ -34,10 +34,15 @@ create_hdx ask_disk() { echo echo "What disk would you like to use for live-bootstrap?" - echo "(live-bootstrap assumes you have pre-prepared the disk)." - echo "Please provide in format sdxx (as you would find under /dev)." + echo "This disk may have pre-prepared sources on it." + echo "If there is no partition we will make one". + echo "Please provide in format sdxx (as you would find under /dev)," + echo "or sdx if it is a blank disk. An ext4 partition is expected on" + echo "existing disks." echo "You can type 'list' to get a list of disks to help you figure" echo "out which is the right disk." + echo "NO WARRANTY IS PROVIDED FOR BUGGY BEHAVIOUR, INCLUDING THAT" + echo "REGARDING DISKS & DATA." echo read -r DISK @@ -57,6 +62,15 @@ if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then echo "DISK=${DISK}" >> /usr/src/bootstrap.cfg fi +if [ -z "$(fdisk -l "/dev/${DISK}" | grep -E "${DISK}p?[0-9]")" ]; then + echo "Creating partition table and partition" + echo ";" | sfdisk "/dev/${DISK}" + mkfs.ext4 "/dev/${DISK}1" + DISK="${DISK}1" +fi + +echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg + PREFIX=/usr SOURCES="${PREFIX}/src" SYSC=/sysc @@ -68,7 +82,7 @@ mount -t ext4 "/dev/${DISK}" /sysc # Copy over appropriate data echo "Copying data into sysc" -sys_transfer "${SYSC}" gzip patch +sys_transfer "${SYSC}" /sysc_src gzip patch sync # switch_root into sysc 1. for simplicity 2. to avoid kexecing again diff --git a/sysc.py b/sysc.py index 1cf566b..cac67a4 100755 --- a/sysc.py +++ b/sysc.py @@ -21,10 +21,11 @@ class SysC(SysGeneral): dev_name = None # pylint: disable=too-many-instance-attributes - def __init__(self, arch, preserve_tmp, tmpdir): + def __init__(self, arch, preserve_tmp, tmpdir, external_sources): self.git_dir = os.path.dirname(os.path.join(__file__)) self.arch = arch self.preserve_tmp = preserve_tmp + self.external_sources = external_sources self.sys_dir = os.path.join(self.git_dir, 'sysc') self.cache_dir = os.path.join(self.sys_dir, 'distfiles') @@ -55,18 +56,154 @@ class SysC(SysGeneral): if create_disk_image: # Create + mount a disk for QEMU to use disk_path = os.path.join(self.tmp_dir, 'disk.img') - self.dev_name = create_disk(disk_path, "msdos", "ext4", '8G') - rootfs_dir = os.path.join(self.tmp_dir, 'mnt') - os.mkdir(rootfs_dir) - mount(self.dev_name + "p1", rootfs_dir, 'ext4') + if self.external_sources: + self.dev_name = create_disk(disk_path, "msdos", "ext4", '8G') + self.rootfs_dir = os.path.join(self.tmp_dir, 'mnt') + os.mkdir(rootfs_dir) + mount(self.dev_name + "p1", self.rootfs_dir, 'ext4') + else: + self.dev_name = create_disk(disk_path, "none", "ext4", '8G') # Use chown to allow executing user to access it run('sudo', 'chown', getpass.getuser(), self.dev_name) - run('sudo', 'chown', getpass.getuser(), rootfs_dir) + if self.external_sources: + run('sudo', 'chown', getpass.getuser(), rootfs_dir) else: rootfs_dir = self.tmp_dir - copytree(self.sys_dir, rootfs_dir, ignore=shutil.ignore_patterns("tmp")) + if self.external_sources: + self.get_packages() # Unmount tmp/mnt if it was mounted if create_disk_image: umount(rootfs_dir) + + # pylint: disable=line-too-long,too-many-statements + def get_packages(self): + """Prepare remaining sources""" + # bash 5.1 + self.get_file("https://mirrors.kernel.org/gnu/bash/bash-5.1.tar.gz") + + # xz 5.0.5 + self.get_file("https://ixpeering.dl.sourceforge.net/project/lzmautils/xz-5.0.5.tar.bz2") + + # automake 1.11.2 + self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.11.2.tar.bz2") + + # autoconf 2.69 + self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.69.tar.xz") + + # automake 1.15.1 + self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.15.1.tar.xz") + + # tar 1.34 + self.get_file(["https://mirrors.kernel.org/gnu/tar/tar-1.34.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-30820c.tar.gz"]) + + # coreutils 8.32 + self.get_file(["https://git.savannah.gnu.org/cgit/coreutils.git/snapshot/coreutils-8.32.tar.gz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-d279bc.tar.gz"]) + + # pkg-config 0.29.2 + self.get_file("http://gentoo.osuosl.org/distfiles/pkg-config-0.29.2.tar.gz") + + # make 4.2.1 + self.get_file("https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz") + + # gmp 6.2.1 + self.get_file("https://mirrors.kernel.org/gnu/gmp/gmp-6.2.1.tar.xz") + + # autoconf archive 2021.02.19 + self.get_file("https://mirrors.kernel.org/gnu/autoconf-archive/autoconf-archive-2021.02.19.tar.xz") + + # mpfr 4.1.0 + self.get_file("https://mirrors.kernel.org/gnu/mpfr/mpfr-4.1.0.tar.xz") + + # mpc 1.2.1 + self.get_file("https://mirrors.kernel.org/gnu/mpc/mpc-1.2.1.tar.gz") + + # flex 2.5.33 + self.get_file("http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.33.tar.gz") + + # bison 2.3 + self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-2.3.tar.bz2", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b28236b.tar.gz"]) + + # bison 3.4.2 + self.get_file(["https://mirrors.kernel.org/gnu/bison/bison-3.4.2.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-672663a.tar.gz"]) + + # perl 5.10.5 + self.get_file("https://www.cpan.org/src/5.0/perl-5.10.1.tar.bz2") + + # dist 3.5-236 + # Debian's version is used because upstream is not to be found (dead?) + self.get_file("http://deb.debian.org/debian/pool/main/d/dist/dist_3.5-236.orig.tar.gz", + output="dist-3.5-236.tar.gz") + + # perl 5.32.1 + self.get_file(["https://www.cpan.org/src/5.0/perl-5.32.1.tar.xz", + "http://deb.debian.org/debian/pool/main/p/perl/perl_5.32.1.orig-regen-configure.tar.gz"]) + + # libarchive-3.5.2 + self.get_file("https://libarchive.org/downloads/libarchive-3.5.2.tar.xz") + + # openssl-1.1.1l + self.get_file("https://artfiles.org/openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz") + + # curl 7.83.0 + self.get_file("https://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1", + output="curl-7.83.0.tar.xz") + + # ca-certificates-3.78 + self.get_file("https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz", + output="ca-certificates-3.78.tar.gz") + + # xbps 0.59.1 + self.get_file("https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz", + output="xbps-0.59.1.tar.gz") + + # autoconf 2.71 + self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz") + + # automake 1.16.3 + self.get_file("https://mirrors.kernel.org/gnu/automake/automake-1.16.3.tar.xz") + + # patch 2.7.6 + self.get_file(["https://mirrors.kernel.org/gnu/patch/patch-2.7.6.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-e017871.tar.gz"]) + + # gettext 0.21 + self.get_file(["https://mirrors.kernel.org/gnu/gettext/gettext-0.21.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-7daa86f.tar.gz"]) + + # texinfo 6.7 + self.get_file(["https://mirrors.kernel.org/gnu/texinfo/texinfo-6.7.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-b81ec69.tar.gz"]) + + # zlib 1.2.12 + self.get_file("https://www.zlib.net/zlib-1.2.12.tar.xz") + + # gcc 4.7.4 + self.get_file("https://mirrors.kernel.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.bz2") + + # gperf 3.1 + self.get_file("https://mirrors.kernel.org/gnu/gperf/gperf-3.1.tar.gz") + + # libunistring 0.9.10 + self.get_file(["https://mirrors.kernel.org/gnu/libunistring/libunistring-0.9.10.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-52a06cb3.tar.gz"]) + + # libffi 3.3 + self.get_file("https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz") + + # libatomic_ops 7.6.10 + self.get_file("https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz") + + # boehm-gc 8.0.4 + self.get_file("https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz") + + # guile 3.0.7 + self.get_file(["https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz", + "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz", + "https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"], + output=["guile-3.0.7.tar.xz", "gnulib-901694b9.tar.gz", "guile-psyntax-bootstrapping.tar.gz"]) diff --git a/sysc/init b/sysc/init index a0d7b30..8bd5f51 100755 --- a/sysc/init +++ b/sysc/init @@ -7,7 +7,7 @@ set -e # shellcheck source=sysa/helpers.sh -. helpers.sh +. /usr/src/helpers.sh export PATH=/usr/bin:/usr/sbin export PREFIX=/usr @@ -54,12 +54,6 @@ install_tar util-linux-2.19.1 0 # Fix invocation of bash from perl ln -s /usr/bin/bash /usr/bin/sh -# Prepare sysc directory structure -mkdir -p /usr/src -mv run*.sh /usr/src -mv helpers.sh SHA256SUMS.pkgs bootstrap.cfg /usr/src -mv /*-* /usr/src # build scripts - # Check tarballs cd "${DISTFILES}" sha256sum -c /SHA256SUMS.sources From b614b3021df5731672c94f7f5020555882d68a03 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sun, 22 May 2022 22:09:03 +1000 Subject: [PATCH 7/9] Add dhcpcd 9.4.1 --- sysa.py | 3 + sysa/SHA256SUMS.sources | 1 + sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh | 16 +++ .../patches/remove-ctassert.patch | 134 ++++++++++++++++++ .../linux-headers-5.10.41.sh | 2 +- sysa/run.sh | 2 + 6 files changed, 157 insertions(+), 1 deletion(-) create mode 100755 sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh create mode 100644 sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch diff --git a/sysa.py b/sysa.py index efa9866..152e5f1 100755 --- a/sysa.py +++ b/sysa.py @@ -272,6 +272,9 @@ class SysA(SysGeneral): "https://www.unicode.org/Public/11.0.0/ucd/NormalizationTest.txt", "https://www.unicode.org/Public/11.0.0/ucd/UnicodeData.txt"]) + # dhcpcd 9.4.1 + self.get_file("https://roy.marples.name/git/dhcpcd/snapshot/dhcpcd-9.4.1.tar.gz") + # kexec-tools 2.0.22 self.get_file("https://github.com/horms/kexec-tools/archive/refs/tags/v2.0.22.tar.gz", output="kexec-tools-2.0.22.tar.gz") diff --git a/sysa/SHA256SUMS.sources b/sysa/SHA256SUMS.sources index 30402a9..262db0f 100644 --- a/sysa/SHA256SUMS.sources +++ b/sysa/SHA256SUMS.sources @@ -31,6 +31,7 @@ c25b36b8af6e0ad2a875daf4d6196bd0df28a62be7dd252e5f99a4d5d7288d95 coreutils-5.0. 247c7ec7521c4258e65634e529270d214fe32969971cccb72845e7aa46831f96 curl-7.83.0.tar.bz2 1d013547889f20576460249c4210632d5314531c8477378a2e046b13a8ebeb7e coreutils-6.10.tar.gz af4214b851928a53ef470ed8729122b9db910a6c0769d5d46a5de0b3e96f74f3 deblob-4.9 +adc30f140fbd0dc7f61ff9cf99da7eedfd484a26a8dafdcc9a0cd859e2199b5a dhcpcd-9.4.1.tar.gz d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7.tar.gz 54437ae4211867de7ad55723f68b94c29cb2f08a23f431e0bbbc9f34ee384f47 dist-3.5-236.tar.gz 340e9de42a12d0c26dd7527e9ef055ac85586de5c61f6273ae19f88d04e55804 e2fsprogs-1.45.7.tar.gz diff --git a/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh b/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh new file mode 100755 index 0000000..fd5c644 --- /dev/null +++ b/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-3.0-or-later + +src_prepare() { + default + + rm src/dhcpcd-embedded.c.in +} + +src_configure() { + CC=gcc ./configure \ + --prefix="${PREFIX}" \ + --disable-embedded \ + --disable-auth +} diff --git a/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch b/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch new file mode 100644 index 0000000..77f0f83 --- /dev/null +++ b/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch @@ -0,0 +1,134 @@ +diff --color -ru src/arp.c src/arp.c +--- src/arp.c 2022-05-22 13:55:30.103757852 +1000 ++++ src/arp.c 2022-05-22 13:55:43.692407546 +1000 +@@ -63,9 +63,6 @@ + /* ARP debugging can be quite noisy. Enable this for more noise! */ + //#define ARP_DEBUG + +-/* Assert the correct structure size for on wire */ +-__CTASSERT(sizeof(struct arphdr) == 8); +- + static ssize_t + arp_request(const struct arp_state *astate, + const struct in_addr *sip) +diff --color -ru src/auth.c src/auth.c +--- src/auth.c 2022-05-22 13:52:30.219151581 +1000 ++++ src/auth.c 2022-05-22 13:53:24.729760674 +1000 +@@ -343,9 +343,6 @@ + + /* RFC3318, section 5.2 - zero giaddr and hops */ + if (mp == 4) { +- /* Assert the bootp structure is correct size. */ +- __CTASSERT(sizeof(struct bootp) == 300); +- + *(mm + offsetof(struct bootp, hops)) = '\0'; + memset(mm + offsetof(struct bootp, giaddr), 0, 4); + } +diff --color -ru src/dhcp6.c src/dhcp6.c +--- src/dhcp6.c 2022-05-22 13:52:30.219151581 +1000 ++++ src/dhcp6.c 2022-05-22 13:53:33.455178213 +1000 +@@ -1,4 +1,4 @@ +-/* SPDX-License-Identifier: BSD-2-Clause */ ++ /* SPDX-License-Identifier: BSD-2-Clause */ + /* + * dhcpcd - DHCP client daemon + * Copyright (c) 2006-2021 Roy Marples +@@ -84,33 +84,28 @@ + uint8_t xid[3]; + /* followed by options */ + }; +-__CTASSERT(sizeof(struct dhcp6_message) == 4); + + struct dhcp6_option { + uint16_t code; + uint16_t len; + /* followed by data */ + }; +-__CTASSERT(sizeof(struct dhcp6_option) == 4); + + struct dhcp6_ia_na { + uint8_t iaid[4]; + uint32_t t1; + uint32_t t2; + }; +-__CTASSERT(sizeof(struct dhcp6_ia_na) == 12); + + struct dhcp6_ia_ta { + uint8_t iaid[4]; + }; +-__CTASSERT(sizeof(struct dhcp6_ia_ta) == 4); + + struct dhcp6_ia_addr { + struct in6_addr addr; + uint32_t pltime; + uint32_t vltime; + }; +-__CTASSERT(sizeof(struct dhcp6_ia_addr) == 16 + 8); + + /* XXX FIXME: This is the only packed structure and it does not align. + * Maybe manually decode it? */ +@@ -120,7 +115,6 @@ + uint8_t prefix_len; + struct in6_addr prefix; + } __packed; +-__CTASSERT(sizeof(struct dhcp6_pd_addr) == 8 + 1 + 16); + + struct dhcp6_op { + uint16_t type; +diff --color -ru src/dhcp.c src/dhcp.c +--- src/dhcp.c 2022-05-22 13:52:30.219151581 +1000 ++++ src/dhcp.c 2022-05-22 13:53:08.074963614 +1000 +@@ -98,11 +98,6 @@ + #define IP_RECVPKTINFO IP_PKTINFO + #endif + +-/* Assert the correct structure size for on wire */ +-__CTASSERT(sizeof(struct ip) == 20); +-__CTASSERT(sizeof(struct udphdr) == 8); +-__CTASSERT(sizeof(struct bootp) == 300); +- + struct dhcp_op { + uint8_t value; + const char *name; +diff --color -ru src/if-bsd.c src/if-bsd.c +--- src/if-bsd.c 2022-05-22 13:52:30.219151581 +1000 ++++ src/if-bsd.c 2022-05-22 13:53:31.686093557 +1000 +@@ -1589,7 +1589,6 @@ + #endif + } + +-__CTASSERT(offsetof(struct rt_msghdr, rtm_msglen) == 0); + int + if_handlelink(struct dhcpcd_ctx *ctx) + { +diff --color -ru src/ipv6nd.c src/ipv6nd.c +--- src/ipv6nd.c 2022-05-22 13:52:30.219151581 +1000 ++++ src/ipv6nd.c 2022-05-22 13:53:30.092017279 +1000 +@@ -80,7 +80,6 @@ + uint32_t nd_opt_rdnss_lifetime; + /* followed by list of IP prefixes */ + }; +-__CTASSERT(sizeof(struct nd_opt_rdnss) == 8); + #endif + + #ifndef ND_OPT_DNSSL +@@ -92,7 +91,6 @@ + uint32_t nd_opt_dnssl_lifetime; + /* followed by list of DNS servers */ + }; +-__CTASSERT(sizeof(struct nd_opt_rdnss) == 8); + #endif + + /* Impossible options, so we can easily add extras */ +diff --color -ru src/privsep-root.c src/privsep-root.c +--- src/privsep-root.c 2022-05-22 13:52:30.220151629 +1000 ++++ src/privsep-root.c 2022-05-22 13:53:28.152924488 +1000 +@@ -56,8 +56,6 @@ + #include "sa.h" + #include "script.h" + +-__CTASSERT(sizeof(ioctl_request_t) <= sizeof(unsigned long)); +- + struct psr_error + { + ssize_t psr_result; diff --git a/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh b/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh index afa6dde..3a00a65 100755 --- a/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh +++ b/sysa/linux-headers-5.10.41/linux-headers-5.10.41.sh @@ -42,7 +42,7 @@ src_install() { done # Pick-and-choose asm-generic headers - for i in types ioctl termios termbits ioctls; do + for i in types ioctl termios termbits ioctls sockios socket; do cp "${DESTDIR}${PREFIX}/include/asm-generic/${i}.h" "${DESTDIR}${PREFIX}/include/asm/${i}.h" done diff --git a/sysa/run.sh b/sysa/run.sh index 92fad85..2e3e31d 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -225,6 +225,8 @@ build util-linux-2.19.1 build e2fsprogs-1.45.7 +build dhcpcd-9.4.1 '' '' dhcpcd-dhcpcd-9.4.1-1663155 + build kbd-1.15 build make-3.82 From 25f37ba926284b17662845ff88d5b0b724ed46d9 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Mon, 23 May 2022 15:56:18 +1000 Subject: [PATCH 8/9] Various fixes from rebase This took a while so a bunch of stuff got broken in rebase. --- LICENSES/curl.txt | 10 ++++++ lib/sysgeneral.py | 9 +++-- rootfs.py | 10 +++--- sysa.py | 14 +++++--- sysa/SHA256SUMS.pkgs | 9 +++-- sysa/SHA256SUMS.sources | 17 +++++----- sysa/curl-7.83.0/files/sinus.pl | 4 +++ sysa/curl-7.83.0/patches/help.patch | 7 ++++ sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh | 7 ++++ .../patches/remove-ctassert.patch | 12 +++---- sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch | 8 +++++ .../patches/remove-intl.patch | 6 ++++ sysa/helpers.sh | 34 ++++++++++++------- sysa/run.sh | 11 +++--- sysb/init | 9 ++--- sysb/run.sh | 17 ++++++---- sysc.py | 25 ++++++-------- sysc/SHA256SUMS.sources | 10 +++--- .../ca-certificates-3.78.sh | 2 +- sysc/curl-7.83.0/curl-7.83.0.sh | 3 +- sysc/curl-7.83.0/files/sinus.pl | 4 +++ sysc/curl-7.83.0/patches/help.patch | 7 ++++ sysc/init | 17 ++++++---- .../perl-5.32.1/patches/reproducibility.patch | 2 +- sysc/run.sh | 24 +++++++++++-- sysc/run2.sh | 5 ++- sysc/xbps-0.59.1/xbps-0.59.1.sh | 1 + sysc/zlib-1.2.12/zlib-1.2.12.sh | 2 +- 28 files changed, 196 insertions(+), 90 deletions(-) create mode 100644 LICENSES/curl.txt diff --git a/LICENSES/curl.txt b/LICENSES/curl.txt new file mode 100644 index 0000000..dd333ab --- /dev/null +++ b/LICENSES/curl.txt @@ -0,0 +1,10 @@ +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1996 - 2015, Daniel Stenberg, . +All rights reserved. + +Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. diff --git a/lib/sysgeneral.py b/lib/sysgeneral.py index 002b4f1..b1b859f 100644 --- a/lib/sysgeneral.py +++ b/lib/sysgeneral.py @@ -95,13 +95,16 @@ this script the next time") os.mkdir(self.cache_dir) # Actually download the file + headers = { + "Accept-Encoding": "identity" + } if not os.path.isfile(abs_file_name): print(f"Downloading: {file_name}") - response = requests.get(url, allow_redirects=True, stream=True) + response = requests.get(url, allow_redirects=True, stream=True, + headers=headers) if response.status_code == 200: with open(abs_file_name, 'wb') as target_file: - for chunk in response.iter_content(chunk_size=None): - target_file.write(chunk) + target_file.write(response.raw.read()) else: raise Exception("Download failed.") diff --git a/rootfs.py b/rootfs.py index 2be4506..1c8fee7 100755 --- a/rootfs.py +++ b/rootfs.py @@ -11,7 +11,7 @@ you can run bootstap inside chroot. # SPDX-FileCopyrightText: 2021 Andrius Štikonas # SPDX-FileCopyrightText: 2021 Bastian Bittorf # SPDX-FileCopyrightText: 2021 Melg Eight -# SPDX-FileCopyrightText: 2021 fosslinux +# SPDX-FileCopyrightText: 2021-22 fosslinux import argparse import os @@ -38,6 +38,7 @@ def create_configuration_file(args): else: config.write("DISK=sda\n") +# pylint: disable=too-many-statements def main(): """ A few command line arguments to customize bootstrap. @@ -61,7 +62,8 @@ def main(): help="Update checksum files.", action="store_true") parser.add_argument("--external-sources", - help="Download sources externally from live-bootstrap.") + help="Download sources externally from live-bootstrap.", + action="store_true") parser.add_argument("--no-create-config", help="Do not automatically create config file", action="store_true") @@ -124,8 +126,8 @@ def main(): tmpdir=args.tmpdir, external_sources=args.external_sources) system_b = SysB(arch=args.arch, preserve_tmp=args.preserve) system_a = SysA(arch=args.arch, preserve_tmp=args.preserve, - tmpdir=args.tmpdir, - sysb_dir=system_b.sys_dir, sysc_tmp=system_c.tmp_dir) + tmpdir=args.tmpdir, external_sources=args.external_sources, + sysb_dir=system_b.sys_dir, sysc_dir=system_c.sys_dir) bootstrap(args, system_a, system_b, system_c) diff --git a/sysa.py b/sysa.py index 152e5f1..268f64f 100755 --- a/sysa.py +++ b/sysa.py @@ -18,7 +18,7 @@ class SysA(SysGeneral): Class responsible for preparing sources for System A. """ # pylint: disable=too-many-instance-attributes,too-many-arguments - def __init__(self, arch, preserve_tmp, tmpdir, sysb_dir, sysc_dir): + def __init__(self, arch, preserve_tmp, external_sources, tmpdir, sysb_dir, sysc_dir): self.git_dir = os.path.dirname(os.path.join(__file__)) self.arch = arch self.preserve_tmp = preserve_tmp @@ -33,6 +33,7 @@ class SysA(SysGeneral): self.cache_dir = os.path.join(self.sys_dir, 'distfiles') self.sysb_dir = sysb_dir self.sysc_dir = sysc_dir + self.external_sources = external_sources def prepare(self, mount_tmpfs, create_initramfs, repo_path): """ @@ -51,7 +52,7 @@ class SysA(SysGeneral): # sysb must be added to sysa as it is another initramfs stage self.sysb() - self.sysc() + self.sysc(create_initramfs) if repo_path: repo_dir = os.path.join(self.tmp_dir, 'usr', 'src', 'repo-preseeded') @@ -72,10 +73,14 @@ class SysA(SysGeneral): shutil.copytree(self.sysb_dir, os.path.join(self.tmp_dir, 'sysb'), ignore=shutil.ignore_patterns('tmp')) - def sysc(self): + def sysc(self, create_initramfs): """Copy in sysc files for sysc.""" + if create_initramfs: + ignore = shutil.ignore_patterns('tmp', 'distfiles') + else: + ignore = shutil.ignore_patterns('tmp') shutil.copytree(self.sysc_dir, os.path.join(self.tmp_dir, 'sysc'), - ignore=shutil.ignore_patterns('tmp', 'distfiles')) + ignore=ignore) def stage0_posix(self): """Copy in all of the stage0-posix""" @@ -94,7 +99,6 @@ class SysA(SysGeneral): # pylint: disable=line-too-long,too-many-statements def get_packages(self): """Prepare remaining sources""" - # mes-0.24 snapshot self.get_file(["http://git.savannah.gnu.org/cgit/mes.git/snapshot/mes-aa5f1533e1736a89e60d2c34c2a0ab3b01f8d037.tar.gz", "https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.2.tar.gz"], diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs index 510fdff..1c7368f 100644 --- a/sysa/SHA256SUMS.pkgs +++ b/sysa/SHA256SUMS.pkgs @@ -37,11 +37,16 @@ ae452f08ad9f7ab01f2a9bd882170e71ee6200a06f044f4aadb446cc68700016 bison-3.4.1_1. becc8ea1f24c531c35b520ce8bac9e8bf6e30e362fe77bf7833aed9d28af0ae6 bison-3.4.1_2.tar.bz2 a3266333620a13f4a4c8f4f9819dc6f1fcded7f74bcb9fbf46518f3b160cf930 bison-3.4.2_0.tar.bz2 09bef4ec506ccafc42ad925f9c038af9885cd8ebca294cf042e63a7d39e91bb5 bzip2-1.0.8_0.tar.bz2 +c484b98e580d7ef5619dc2da2318d9f1e69360a882f64aa15e0fdde0184c45fb ca-certificates-3.78_0.tar.bz2 2d85ff411c62c2ee9db08e20d33991ef6d28a6067e211e9641a8eaefed6aee04 coreutils-5.0_0.tar.bz2 776ef3e13870fba6fc9cec64eaf40fb658abecc99c65724968013f8f8a177802 coreutils-6.10_0.tar.bz2 b8992f675350658b106c3066cac0ee31440020bc9d6128bfc2fdf1fde60efd74 coreutils-8.32_0.tar.bz2 +28a1e93ed14f7fa4d3c8ca41e9b78e29ba685fbc8b6bf7ba3b6933770d68eedb curl-7.83.0_0.tar.bz2 +99a101a3a1de8e5ed3f590cda6b1a72d68cd2e935b85e8b9b862ab26f66c7ee1 curl-7.83.0_1.tar.bz2 +a6f8f4db6bf449ed8771efefabb88833f1fc5f314d565b7714c9c8b4ba34b20c dhcpcd-9.4.1_0.tar.bz2 ca91a67d5d0c0ee46d064d9bf7c26efcafe712a9f86866991028478df3b34f21 diffutils-2.7_0.tar.bz2 de6d9df33107ae63b8e0f30902fe9d00e42f78f44a60b256bb0b3c82ff75bd45 dist-3.5-236_0.tar.bz2 +9ed3eb8e598317d00c0f9467c956abdc5857542b699095fcc9e80c3e2d0bfc04 e2fsprogs-1.45.7_0.tar.bz2 f55c11b091361536774b436abe86b17f759cd7a66522cd20c7a2190da92db67a findutils-4.2.33_0.tar.bz2 4a9042c6a481aaffe359b796e359550813a10e1c49549b4e7a69769d5214491e flex-2.5.11_0.tar.bz2 33afd1c66c864b486df290e682883556787c61751b8c851deb2737f0b777ffd6 flex-2.5.33_0.tar.bz2 @@ -66,7 +71,7 @@ b70fe8d9479ca4a3ad6fdbafbaf52a172c6a4a47ae8cf080beb9d25b97a7b205 libffi-3.3_0.x 94d0f9d2f8fbc2b00fe4c0f479e5590fa70b7d856f0a643ad006787d963f99ee libtool-2.2.4_0.tar.bz2 9bf0aea34d1413640667645ef06947ec2c24d3fa4e4e10825a7560c6d2e3343b libunistring-0.9.10_0.x86.xbps 1d07aaf7049be45853fd409340cdb52bb3a1b6dfa4dbc8b69358c1ee966cd67f linux-4.9.10_0.tar.bz2 -a878f140c5a5c2e40562800927b2281d33085c2a91479532a5220510a5926edb linux-headers-5.10.41_0.tar.bz2 +61507b58074a3742191b606f9415f79406e5daa693ab4ba4a4543897696628ea linux-headers-5.10.41_0.tar.bz2 5cda10550198e613c426e45c5fffe0f7e8761296e7339e9e9a1f9da995b4865a m4-1.4.7_0.tar.bz2 c4fc071e0911a01efae11b8735c8e69a8963d9a545befffd01486de7589b201a make-3.82_0.tar.bz2 47470be468d66a85e71cbecbbf22038260c6e91408105ba0684c3ee61b39085f make-4.2.1_0.tar.bz2 @@ -81,7 +86,7 @@ df12820e27abfe07c4c27bb2f9abf2e0758b797d5d3036e29d6c57cfb5aa12d6 openssl-1.1.1l 75fffc4bb14f14281bc1853455888d1d818b7027efc1e4014af1a755771a64e8 perl-5.000_0.tar.bz2 3a709c914e7d01f5bfd12d8d859ac7135d9ac57528cb2e325448f91cfb4869b8 perl-5.003_0.tar.bz2 4b79a1694c471663391793939f60c810aec65b03ef80f8dd811cea181f8e7fb2 perl-5.10.1_0.tar.bz2 -da3095776a4781c2c9523176d5522167ec303c582e150057c72a34ce06fb210a perl-5.32.1_0.tar.bz2 +31eda69af533e26b0cae543e02f2024fc2663dc47605f57fa58652117cbc1460 perl-5.32.1_0.tar.bz2 9ceb09af82397f98e99e339cb4fd3abd9f61d222ea7e6a0920e2f3a7c316c70a perl-5.6.2_0.tar.bz2 23ea39db272dcbbeedf2ea6e758052228b0a764be462c0562339b58ae472d83d perl5.004-05_0.tar.bz2 041aed738c039a8c437c6d29530fe44f55bd5fc9ac2bb54f793f6fe3a9df16fd perl5.005-03_0.tar.bz2 diff --git a/sysa/SHA256SUMS.sources b/sysa/SHA256SUMS.sources index 262db0f..06276f7 100644 --- a/sysa/SHA256SUMS.sources +++ b/sysa/SHA256SUMS.sources @@ -1,10 +1,3 @@ -64f117a4749dd4a1b6c54277f63f6cf1e0eb45d290cbedaf777fbe71b8880885 CaseFolding.txt -eb115a5de9a32c9ad447d6ea1cddcadb53d47f6cbc2521f3fe0bebb040c39866 DerivedAge.txt -11c8bd81ecbede4d67c7b5b693a471647d5401956707c639ae053b836cc7f5da DerivedCombiningClass.txt -3406825d64564bf2a37031c36a3e0f99d708aa17595b81f8b539d0f3d1a3923f DerivedCoreProperties.txt -c9ffe32e616fa085246644c2351c525788fac363872491185dab7d5ce69fefa9 NormalizationCorrections.txt -0fdfc17093dd5482f8089cb11dcd936abdba34c4c9c324e5b8a4e5d8f943f6d3 NormalizationTest.txt -4997a3196eb79b4d0d6b8384560f6aeb46a062693f0abd5ba736abbff7976099 UnicodeData.txt 66fde474e124e80c843560041cd68820c9dce56e696f388312ba30361a814a16 autoconf-2.12.tar.gz f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e autoconf-2.13.tar.gz 4681bcbb9c9298c506f6405a7deb62c54fc3b339d3239a8f36a5df83daaec94f autoconf-2.52.tar.bz2 @@ -27,13 +20,16 @@ ba03d412998cc54bd0b0f2d6c32100967d3137098affdc2d32e6e7c11b163fe4 bash-2.05b.tar e20bdd49a0fb317959b410c1fe81269a620ec21207045d8a37cadea621be4b59 binutils-2.14.tar.bz2 7007fc89c216fbfaff5525359b02a7e5b612694df5168c74673f67055f015095 bison-3.4.1.tar.gz ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 bzip2-1.0.8.tar.gz +64f117a4749dd4a1b6c54277f63f6cf1e0eb45d290cbedaf777fbe71b8880885 CaseFolding.txt c25b36b8af6e0ad2a875daf4d6196bd0df28a62be7dd252e5f99a4d5d7288d95 coreutils-5.0.tar.bz2 -247c7ec7521c4258e65634e529270d214fe32969971cccb72845e7aa46831f96 curl-7.83.0.tar.bz2 1d013547889f20576460249c4210632d5314531c8477378a2e046b13a8ebeb7e coreutils-6.10.tar.gz +247c7ec7521c4258e65634e529270d214fe32969971cccb72845e7aa46831f96 curl-7.83.0.tar.bz2 af4214b851928a53ef470ed8729122b9db910a6c0769d5d46a5de0b3e96f74f3 deblob-4.9 +eb115a5de9a32c9ad447d6ea1cddcadb53d47f6cbc2521f3fe0bebb040c39866 DerivedAge.txt +11c8bd81ecbede4d67c7b5b693a471647d5401956707c639ae053b836cc7f5da DerivedCombiningClass.txt +3406825d64564bf2a37031c36a3e0f99d708aa17595b81f8b539d0f3d1a3923f DerivedCoreProperties.txt adc30f140fbd0dc7f61ff9cf99da7eedfd484a26a8dafdcc9a0cd859e2199b5a dhcpcd-9.4.1.tar.gz d5f2489c4056a31528e3ada4adacc23d498532b0af1a980f2f76158162b139d6 diffutils-2.7.tar.gz -54437ae4211867de7ad55723f68b94c29cb2f08a23f431e0bbbc9f34ee384f47 dist-3.5-236.tar.gz 340e9de42a12d0c26dd7527e9ef055ac85586de5c61f6273ae19f88d04e55804 e2fsprogs-1.45.7.tar.gz 813cd9405aceec5cfecbe96400d01e90ddad7b512d3034487176ce5258ab0f78 findutils-4.2.33.tar.gz bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689 flex-2.5.11.tar.gz @@ -57,6 +53,8 @@ c4e63399b12f5858d11c44cea8e92f21cd564f8548e488dadc84046b424c80fc libtool-2.2.4. e56c9463ae649d5863df3526e0af631894e0f01cdbb02a46d0db415518450dc9 mes-0.24.tar.gz 1370c9a812b2cf2a7d92802510cca0058cc37e66a7bedd70051f0a34015022a3 musl-1.1.24.tar.gz 7d5b0b6062521e4627e099e4c9dc8248d32a30285e959b7eecaa780cf8cfd4a4 musl-1.2.3.tar.gz +c9ffe32e616fa085246644c2351c525788fac363872491185dab7d5ce69fefa9 NormalizationCorrections.txt +0fdfc17093dd5482f8089cb11dcd936abdba34c4c9c324e5b8a4e5d8f943f6d3 NormalizationTest.txt f36e4fb7dd524dc3f4b354d3d5313f69e7ce5a6ae93711e8cf6d51eaa8d2b318 nyacc-1.00.2.tar.gz ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a patch-2.5.9.tar.gz 1ae43c8d2983404b9eec61c96e3ffa27e7b07e08215c95c015a4ab0095373ef3 perl-5.000.tar.gz @@ -68,4 +66,5 @@ c365874794187f8444e5d22998cd5888ffa47f36def4b77517a808dec27c0600 sed-4.0.9.tar. c6c37e888b136ccefab903c51149f4b7bd659d69d4aea21245f61053a57aa60a tar-1.12.tar.gz 23cacd448cff2baf6ed76c2d1e2d654ff4e557046e311dfb6be7e1c631014ef8 tcc-0.9.26.tar.gz de23af78fca90ce32dff2dd45b3432b2334740bb9bb7b05bf60fdbfc396ceb9c tcc-0.9.27.tar.bz2 +4997a3196eb79b4d0d6b8384560f6aeb46a062693f0abd5ba736abbff7976099 UnicodeData.txt f694bee56099b8d72c3843d97e27f2306aa9946741e34a27391f6f6f19c7bcd0 util-linux-2.19.1.tar.gz diff --git a/sysa/curl-7.83.0/files/sinus.pl b/sysa/curl-7.83.0/files/sinus.pl index d497811..12efee5 100644 --- a/sysa/curl-7.83.0/files/sinus.pl +++ b/sysa/curl-7.83.0/files/sinus.pl @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 1998-2021 Daniel Stenberg +# +# SPDX-License-Identifier: curl + my $pi = 3.1415; foreach my $i (1 .. 200) { printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; diff --git a/sysa/curl-7.83.0/patches/help.patch b/sysa/curl-7.83.0/patches/help.patch index d06ca19..2fc9c70 100644 --- a/sysa/curl-7.83.0/patches/help.patch +++ b/sysa/curl-7.83.0/patches/help.patch @@ -1,3 +1,10 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: curl + +Regenerating help is not trivial. Help is unnecessary. +Disable help. + diff --color -ru src/Makefile.inc src/Makefile.inc --- src/Makefile.inc 2022-05-09 16:48:37.195346967 +1000 +++ src/Makefile.inc 2022-05-09 16:49:46.503187644 +1000 diff --git a/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh b/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh index fd5c644..d0611d4 100755 --- a/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh +++ b/sysa/dhcpcd-9.4.1/dhcpcd-9.4.1.sh @@ -11,6 +11,13 @@ src_prepare() { src_configure() { CC=gcc ./configure \ --prefix="${PREFIX}" \ + --sbindir="${PREFIX}/bin" \ --disable-embedded \ --disable-auth } + +src_install() { + default + mkdir -p "${DESTDIR}/var/db/dhcpcd" + mkdir -p "${DESTDIR}/var/run/dhcpcd" +} diff --git a/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch b/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch index 77f0f83..dc54cdb 100644 --- a/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch +++ b/sysa/dhcpcd-9.4.1/patches/remove-ctassert.patch @@ -1,3 +1,9 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: BSD-2-Clause + +__CTASSERT macro does not work properly on our older GCC. + diff --color -ru src/arp.c src/arp.c --- src/arp.c 2022-05-22 13:55:30.103757852 +1000 +++ src/arp.c 2022-05-22 13:55:43.692407546 +1000 @@ -27,12 +33,6 @@ diff --color -ru src/auth.c src/auth.c diff --color -ru src/dhcp6.c src/dhcp6.c --- src/dhcp6.c 2022-05-22 13:52:30.219151581 +1000 +++ src/dhcp6.c 2022-05-22 13:53:33.455178213 +1000 -@@ -1,4 +1,4 @@ --/* SPDX-License-Identifier: BSD-2-Clause */ -+ /* SPDX-License-Identifier: BSD-2-Clause */ - /* - * dhcpcd - DHCP client daemon - * Copyright (c) 2006-2021 Roy Marples @@ -84,33 +84,28 @@ uint8_t xid[3]; /* followed by options */ diff --git a/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch b/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch index 1bc8fe3..c5a30bf 100644 --- a/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch +++ b/sysa/e2fsprogs-1.45.7/patches/gawk-fix.patch @@ -1,3 +1,11 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-2.0-or-later + +Our version of gawk does not seem to like printing, at least in the way that +this attempts to use it. Instead, make it print to console and use working +bash redirects. + --- lib/et/compile_et.sh.in 2022-05-18 19:26:17.182054784 +1000 +++ lib/et/compile_et.sh.in 2022-05-18 19:30:16.489294776 +1000 @@ -44,14 +44,14 @@ diff --git a/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch b/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch index 160107d..3768d17 100644 --- a/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch +++ b/sysa/e2fsprogs-1.45.7/patches/remove-intl.patch @@ -1,3 +1,9 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: GPL-2.0-or-later + +Disable gettext, which we do not have at this time, along with pkg-config. + --- configure.ac 2022-05-18 15:12:53.633061872 +1000 +++ configure.ac 2022-05-18 19:09:13.351790066 +1000 @@ -860,20 +860,7 @@ diff --git a/sysa/helpers.sh b/sysa/helpers.sh index 88526b9..08f8000 100755 --- a/sysa/helpers.sh +++ b/sysa/helpers.sh @@ -8,7 +8,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # shellcheck source=/dev/null -. bootstrap.cfg +. "${SOURCES}/bootstrap.cfg" # Get a list of files get_files() { @@ -198,11 +198,19 @@ build() { # Default get function that downloads source tarballs. default_src_get() { - if ! [ -z "${urls}" ] && command -v curl >/dev/null 2>&1; then + # shellcheck disable=SC2153 + cd "${DISTFILES}" + # shellcheck disable=SC2154 + if [ -n "${urls}" ] && command -v curl >/dev/null 2>&1; then + # shellcheck disable=SC2153 for i in ${urls}; do - curl -L "${i}" --output "${DISTFILES}/$(basename "${i}")" + if ! [ -e "$(basename "${i}")" ]; then + curl -L "${i}" --output "$(basename "${i}")" + grep "$(basename "${i}")" "${SOURCES}/SHA256SUMS.sources" | sha256sum -c + fi done fi + cd - } # Default unpacking function that unpacks all source tarballs. @@ -396,17 +404,17 @@ canonicalise_all_files_timestamp() { populate_device_nodes() { # http://www.linuxfromscratch.org/lfs/view/6.1/chapter06/devices.html - mkdir -p "${1}/dev" - test -c "${1}/dev/null" || (rm -f "${1}/dev/null" && - mknod -m 666 "${1}/dev/null" c 1 3) - test -c "${1}/dev/zero" || mknod -m 666 "${1}/dev/zero" c 1 5 - test -c "${1}/dev/random" || mknod -m 444 "${1}/dev/random" c 1 8 - test -c "${1}/dev/urandom" || mknod -m 444 "${1}/dev/urandom" c 1 9 + mkdir -p "/dev" + test -c "/dev/null" || (rm -f "/dev/null" && + mknod -m 666 "/dev/null" c 1 3) + test -c "/dev/zero" || mknod -m 666 "/dev/zero" c 1 5 + test -c "/dev/random" || mknod -m 444 "/dev/random" c 1 8 + test -c "/dev/urandom" || mknod -m 444 "/dev/urandom" c 1 9 if [ "${CHROOT}" = False ]; then - test -c "${1}/dev/ptmx" || mknod -m 666 "${1}/dev/ptmx" c 5 2 - test -c "${1}/dev/tty" || mknod -m 666 "${1}/dev/tty" c 5 0 - test -c "${1}/dev/console" || mknod -m 666 "${1}/dev/console" c 5 1 + test -c "/dev/ptmx" || mknod -m 666 "/dev/ptmx" c 5 2 + test -c "/dev/tty" || mknod -m 666 "/dev/tty" c 5 0 + test -c "/dev/console" || mknod -m 666 "/dev/console" c 5 1 fi } @@ -422,7 +430,7 @@ sys_transfer() { # Transfer misc files cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${dest}/${PREFIX}/src" - cp -r "${sys_sources}/*" "${dest}/${PREFIX}/src" + cp -r "${sys_sources}/"* "${dest}/${PREFIX}/src" cp -f "${sys_sources}/init" "${dest}/" cp -r "${PREFIX}/src/repo" "${dest}/${PREFIX}/src" diff --git a/sysa/run.sh b/sysa/run.sh index 2e3e31d..8363c69 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -7,8 +7,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later set -e -# shellcheck source=sysa/helpers.sh -. helpers.sh # shellcheck disable=SC2154 export PREFIX="${prefix}" @@ -19,13 +17,16 @@ export DESTDIR=/tmp/destdir # shellcheck disable=SC2154 export SRCDIR="${srcdir}" +# shellcheck source=sysa/helpers.sh +. helpers.sh + create_sysb() { # Copy everything in echo "Creating sysb rootfs" - sys_transfer /sysb_image /sysb - cp -rl /sysc /sysb/sysc_src + sys_transfer /sysb_image /sysb gzip patch + cp -rl /sysc /sysb_image/sysc_src echo "Creating sysb initramfs" - gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb + gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb_image rm -rf /sysb /sysb_image # Cleanup } diff --git a/sysb/init b/sysb/init index 30db4ce..fe5152e 100755 --- a/sysb/init +++ b/sysb/init @@ -1,19 +1,20 @@ #!/usr/bin/bash -# SPDX-FileCopyrightText: 2021 fosslinux +# SPDX-FileCopyrightText: 2021-22 fosslinux # SPDX-FileCopyrightText: 2022 Andrius Štikonas # # SPDX-License-Identifier: GPL-3.0-or-later set -e -. /usr/src/helpers.sh - export PATH=/usr/bin export PREFIX=/usr export SOURCES=/usr/src -echo +# shellcheck source=sysa/helpers.sh +. /usr/src/helpers.sh + +echo echo "Installing packages into sysb" install_tar() { diff --git a/sysb/run.sh b/sysb/run.sh index 49428a3..db69550 100755 --- a/sysb/run.sh +++ b/sysb/run.sh @@ -28,7 +28,7 @@ create_hdx() { # All the various structures that don't exist but needed to mount mkdir -p /etc /dev -populate_device_nodes "" +populate_device_nodes create_hdx ask_disk() { @@ -62,13 +62,16 @@ if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then echo "DISK=${DISK}" >> /usr/src/bootstrap.cfg fi -if [ -z "$(fdisk -l "/dev/${DISK}" | grep -E "${DISK}p?[0-9]")" ]; then - echo "Creating partition table and partition" - echo ";" | sfdisk "/dev/${DISK}" - mkfs.ext4 "/dev/${DISK}1" - DISK="${DISK}1" +# Is it a full disk, and not a partition +# shellcheck disable=SC2012 +if [ $(($(ls -l "/dev/${DISK}" | sed "s/.*, *//" | sed "s/ .*//") % 8)) -eq 0 ]; then + if ! fdisk -l "/dev/${DISK}" | grep -qE "${DISK}p?[0-9]" ; then + echo "Creating partition table and partition" + echo ";" | sfdisk "/dev/${DISK}" + mkfs.ext4 "/dev/${DISK}1" + DISK="${DISK}1" + fi fi - echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg PREFIX=/usr diff --git a/sysc.py b/sysc.py index cac67a4..75b1580 100755 --- a/sysc.py +++ b/sysc.py @@ -6,13 +6,13 @@ # SPDX-FileCopyrightText: 2021 Andrius Štikonas import os -import shutil import getpass from lib.utils import mount, umount, create_disk, run, copytree from lib.sysgeneral import SysGeneral # pylint: disable=consider-using-with +# pylint: disable=too-many-instance-attributes class SysC(SysGeneral): """ Class responsible for preparing sources for System C. @@ -20,7 +20,6 @@ class SysC(SysGeneral): dev_name = None - # pylint: disable=too-many-instance-attributes def __init__(self, arch, preserve_tmp, tmpdir, external_sources): self.git_dir = os.path.dirname(os.path.join(__file__)) self.arch = arch @@ -58,9 +57,9 @@ class SysC(SysGeneral): disk_path = os.path.join(self.tmp_dir, 'disk.img') if self.external_sources: self.dev_name = create_disk(disk_path, "msdos", "ext4", '8G') - self.rootfs_dir = os.path.join(self.tmp_dir, 'mnt') + rootfs_dir = os.path.join(self.tmp_dir, 'mnt') os.mkdir(rootfs_dir) - mount(self.dev_name + "p1", self.rootfs_dir, 'ext4') + mount(self.dev_name + "p1", rootfs_dir, 'ext4') else: self.dev_name = create_disk(disk_path, "none", "ext4", '8G') # Use chown to allow executing user to access it @@ -72,9 +71,10 @@ class SysC(SysGeneral): if self.external_sources: self.get_packages() + copytree(self.cache_dir, os.path.join(rootfs_dir, "distfiles")) # Unmount tmp/mnt if it was mounted - if create_disk_image: + if create_disk_image and self.external_sources: umount(rootfs_dir) # pylint: disable=line-too-long,too-many-statements @@ -137,8 +137,7 @@ class SysC(SysGeneral): # dist 3.5-236 # Debian's version is used because upstream is not to be found (dead?) - self.get_file("http://deb.debian.org/debian/pool/main/d/dist/dist_3.5-236.orig.tar.gz", - output="dist-3.5-236.tar.gz") + self.get_file("http://deb.debian.org/debian/pool/main/d/dist/dist_3.5-236.orig.tar.gz") # perl 5.32.1 self.get_file(["https://www.cpan.org/src/5.0/perl-5.32.1.tar.xz", @@ -151,16 +150,13 @@ class SysC(SysGeneral): self.get_file("https://artfiles.org/openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz") # curl 7.83.0 - self.get_file("https://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1", - output="curl-7.83.0.tar.xz") + self.get_file("https://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1") # ca-certificates-3.78 - self.get_file("https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz", - output="ca-certificates-3.78.tar.gz") + self.get_file("https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz") # xbps 0.59.1 - self.get_file("https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz", - output="xbps-0.59.1.tar.gz") + self.get_file("https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz") # autoconf 2.71 self.get_file("https://mirrors.kernel.org/gnu/autoconf/autoconf-2.71.tar.xz") @@ -205,5 +201,4 @@ class SysC(SysGeneral): # guile 3.0.7 self.get_file(["https://mirrors.kernel.org/gnu/guile/guile-3.0.7.tar.xz", "https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-901694b9.tar.gz", - "https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"], - output=["guile-3.0.7.tar.xz", "gnulib-901694b9.tar.gz", "guile-psyntax-bootstrapping.tar.gz"]) + "https://github.com/schierlm/guile-psyntax-bootstrapping/archive/refs/tags/guile-3.0.7.tar.gz"]) diff --git a/sysc/SHA256SUMS.sources b/sysc/SHA256SUMS.sources index 15a036b..0edbbf9 100644 --- a/sysc/SHA256SUMS.sources +++ b/sysc/SHA256SUMS.sources @@ -8,7 +8,8 @@ cc012bc860406dcf42f64431bcd3d2fa7560c02915a601aba9cd597a39329baa bash-5.1.tar.g b10d7e9e354be72aee4e4911cf19dd27b5c527d4e7200857365b5fcdeea0dffb bison-2.3.tar.bz2 27d05534699735dc69e86add5b808d6cb35900ad3fd63fa82e3eb644336abfa0 bison-3.4.2.tar.xz 6f7cfc0ac6717afb6ba1f41b0da43a713ba0dd97dec1227e32effc12d79f08c1 coreutils-8.32.tar.gz -54437ae4211867de7ad55723f68b94c29cb2f08a23f431e0bbbc9f34ee384f47 dist-3.5-236.tar.gz +bbff0e6b5047e773f3c3b084d80546cc1be4e354c09e419c2d0ef6116253511a curl-7.83.0.tar.xz?viasf=1 +05fa4f6ea9f05adf8f577699cb3f5b88b20dfce86b0d0cebbfb072fe5933d38f dist_3.5-236.orig.tar.gz c40385e142989c91989413f3c5a31282b2ffdca16b69cd3ecfde537b8a474921 flex-2.5.33.tar.gz 436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d gc-8.0.4.tar.gz 92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 gcc-4.7.4.tar.bz2 @@ -24,8 +25,8 @@ f9aad85de1f41d57c9368d304020ffbf354a5e56db1297f022c3d12181134e56 gnulib-901694b 12cfa21abf618a274017d6b18e95fc6582519d7c08e2403e5c5772ccdd5b85f4 gnulib-d279bc.tar.gz a285dc300c3d9c25cc06e38827ef40f6073ec3b9b0fcb5bba433f943be92d8d4 gnulib-e017871.tar.gz 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2 gperf-3.1.tar.gz +14cda9c416506dfadf60c14fc623ff01ef99b87564a78d0a29c5d17143c97609 guile-3.0.7.tar.gz f57d86c70620271bfceb7a9be0c81744a033f08adc7ceba832c9917ab3e691b7 guile-3.0.7.tar.xz -14cda9c416506dfadf60c14fc623ff01ef99b87564a78d0a29c5d17143c97609 guile-psyntax-bootstrapping.tar.gz f0b19ff39c3c9a5898a219497ababbadab99d8178acc980155c7e1271089b5a0 libarchive-3.5.2.tar.xz 587edf60817f56daf1e1ab38a4b3c729b8e846ff67b4f62a6157183708f099af libatomic_ops-7.6.10.tar.gz 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056 libffi-3.3.tar.gz @@ -33,14 +34,15 @@ eb8fb2c3e4b6e2d336608377050892b54c3c983b646c561836550863003c05d7 libunistring-0 e40b8f018c1da64edd1cc9a6fce5fa63b2e707e404e20cad91fbae337c98a5b7 make-4.2.1.tar.gz 17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459 mpc-1.2.1.tar.gz 0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f mpfr-4.1.0.tar.xz +f455f341e787c1167328e80a84f77b9a557d595066dda6486a1874d72da68800 nss-3.78.tar.gz 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 openssl-1.1.1l.tar.gz ac610bda97abe0d9f6b7c963255a11dcb196c25e337c61f94e4778d632f1d8fd patch-2.7.6.tar.xz 9385f2c8c2ca8b1dc4a7c31903f1f8dc8f2ba867dc2a9e5c93012ed6b564e826 perl-5.10.1.tar.bz2 57cc47c735c8300a8ce2fa0643507b44c4ae59012bfdad0121313db639e02309 perl-5.32.1.tar.xz -3ec396d97debb6c1a112c1c6ff58b03a55866b75cd4fe06b74295ac9c5fc5ff2 perl-5f2dc80.tar.bz2 +1d179b41283f12ad83f9758430f6ddc49bdf20db5c396aeae7e51ebb4e4afd29 perl_5.32.1.orig-regen-configure.tar.gz 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591 pkg-config-0.29.2.tar.gz 63bebd26879c5e1eea4352f0d03c991f966aeb3ddeb3c7445c902568d5411d28 tar-1.34.tar.xz 988403c1542d15ad044600b909997ba3079b10e03224c61188117f3676b02caa texinfo-6.7.tar.xz -0cbd8d5f23a62047c75974bca21da9f004a94efffd7f37c68562a8dbc869fb2a xbps-0.59.1.tar.gz +0cbd8d5f23a62047c75974bca21da9f004a94efffd7f37c68562a8dbc869fb2a 0.59.1.tar.gz 166c48d2842519bc4f96333bff9e265f8cdda44d38e40594ef3f9bbb52890490 xz-5.0.5.tar.bz2 7db46b8d7726232a621befaab4a1c870f00a90805511c0e0090441dac57def18 zlib-1.2.12.tar.xz diff --git a/sysc/ca-certificates-3.78/ca-certificates-3.78.sh b/sysc/ca-certificates-3.78/ca-certificates-3.78.sh index 20dd571..a93c9ee 100755 --- a/sysc/ca-certificates-3.78/ca-certificates-3.78.sh +++ b/sysc/ca-certificates-3.78/ca-certificates-3.78.sh @@ -5,7 +5,7 @@ urls="http://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz" src_compile() { - cp nss/lib/ckfw/builtins/certdata.txt . + cp -a nss/lib/ckfw/builtins/certdata.txt . mk-ca-bundle -n -s ALL -m } diff --git a/sysc/curl-7.83.0/curl-7.83.0.sh b/sysc/curl-7.83.0/curl-7.83.0.sh index fa36936..40a2621 100755 --- a/sysc/curl-7.83.0/curl-7.83.0.sh +++ b/sysc/curl-7.83.0/curl-7.83.0.sh @@ -24,5 +24,6 @@ src_configure() { LDFLAGS="-static" ./configure \ --prefix="${PREFIX}" \ --with-openssl \ - --with-ca-bundle=/etc/ssl/certs.pem + --with-ca-bundle=/etc/ssl/certs.pem \ + --build=i386-unknown-linux-musl } diff --git a/sysc/curl-7.83.0/files/sinus.pl b/sysc/curl-7.83.0/files/sinus.pl index d497811..12efee5 100644 --- a/sysc/curl-7.83.0/files/sinus.pl +++ b/sysc/curl-7.83.0/files/sinus.pl @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 1998-2021 Daniel Stenberg +# +# SPDX-License-Identifier: curl + my $pi = 3.1415; foreach my $i (1 .. 200) { printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; diff --git a/sysc/curl-7.83.0/patches/help.patch b/sysc/curl-7.83.0/patches/help.patch index d06ca19..2fc9c70 100644 --- a/sysc/curl-7.83.0/patches/help.patch +++ b/sysc/curl-7.83.0/patches/help.patch @@ -1,3 +1,10 @@ +# SPDX-FileCopyrightText: 2022 fosslinux +# +# SPDX-License-Identifier: curl + +Regenerating help is not trivial. Help is unnecessary. +Disable help. + diff --color -ru src/Makefile.inc src/Makefile.inc --- src/Makefile.inc 2022-05-09 16:48:37.195346967 +1000 +++ src/Makefile.inc 2022-05-09 16:49:46.503187644 +1000 diff --git a/sysc/init b/sysc/init index 8bd5f51..7d863fa 100755 --- a/sysc/init +++ b/sysc/init @@ -1,14 +1,12 @@ #!/usr/bin/bash -# SPDX-FileCopyrightText: 2021 fosslinux +# SPDX-FileCopyrightText: 2022 Andrius Štikonas +# SPDX-FileCopyrightText: 2021-22 fosslinux # # SPDX-License-Identifier: GPL-3.0-or-later set -e -# shellcheck source=sysa/helpers.sh -. /usr/src/helpers.sh - export PATH=/usr/bin:/usr/sbin export PREFIX=/usr export SOURCES=/usr/src @@ -16,6 +14,9 @@ export DESTDIR=/tmp/destdir export DISTFILES=/distfiles export SRCDIR="${SOURCES}" +# shellcheck source=sysa/helpers.sh +. "${SOURCES}/helpers.sh" + echo echo "Installing packages into sysc" @@ -36,6 +37,8 @@ install_tar binutils-2.14 0 install_tar bzip2-1.0.8 0 install_tar bison-3.4.1 2 install_tar coreutils-6.10 0 +install_tar curl-7.83.0 0 +install_tar dhcpcd-9.4.1 0 install_tar diffutils-2.7 0 install_tar findutils-4.2.33 0 install_tar flex-2.6.4 0 @@ -55,8 +58,10 @@ install_tar util-linux-2.19.1 0 ln -s /usr/bin/bash /usr/bin/sh # Check tarballs -cd "${DISTFILES}" -sha256sum -c /SHA256SUMS.sources +if [ -d "${DISTFILES}" ]; then + cd "${DISTFILES}" + sha256sum -c "${SOURCES}/SHA256SUMS.sources" +fi # Begin sysc bootstrapping process cd "${SOURCES}" diff --git a/sysc/perl-5.32.1/patches/reproducibility.patch b/sysc/perl-5.32.1/patches/reproducibility.patch index 1875f10..9771b13 100644 --- a/sysc/perl-5.32.1/patches/reproducibility.patch +++ b/sysc/perl-5.32.1/patches/reproducibility.patch @@ -1,4 +1,4 @@ -SPDX-FileCopyrightText: 2021 fosslinux +SPDX-FileCopyrightText: 2021-22 fosslinux SPDX-License-Identifier: Artistic-1.0 diff --git a/sysc/run.sh b/sysc/run.sh index 44ce1d2..40da408 100755 --- a/sysc/run.sh +++ b/sysc/run.sh @@ -27,11 +27,31 @@ create_fhs() { echo 'nameserver 1.1.1.1' > /etc/resolv.conf } -populate_device_nodes "" +populate_device_nodes create_fhs -mkdir -p "${DISTFILES}" +# Obtain network connection +if [ "${CHROOT}" = "False" ]; then + dhcpcd --waitip=4 + # Ensure network accessible + timeout=120 + while ! curl example.com >/dev/null 2>&1; do + sleep 1 + # shellcheck disable=SC2219 + let timeout-- + if [ "${timeout}" -le 0 ]; then + echo "Timeout reached for internet to become accessible" + false + fi + done +fi + +if [ -e "${SOURCES}/distfiles" ]; then + mv "${SOURCES}/distfiles" / +else + mkdir -p "${DISTFILES}" +fi build bash-5.1 diff --git a/sysc/run2.sh b/sysc/run2.sh index 33bc52c..79c8a4c 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -108,4 +108,7 @@ echo "Bootstrapping completed." cd "/" -exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" bash after.sh +if [ -e after.sh ]; then + FILE=after.sh +fi +exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" bash ${FILE} diff --git a/sysc/xbps-0.59.1/xbps-0.59.1.sh b/sysc/xbps-0.59.1/xbps-0.59.1.sh index 8cd12b6..41651b3 100755 --- a/sysc/xbps-0.59.1/xbps-0.59.1.sh +++ b/sysc/xbps-0.59.1/xbps-0.59.1.sh @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later +# TODO: add mechanism to change output filename to something nicer urls="https://github.com/void-linux/xbps/archive/refs/tags/0.59.1.tar.gz" src_configure() { diff --git a/sysc/zlib-1.2.12/zlib-1.2.12.sh b/sysc/zlib-1.2.12/zlib-1.2.12.sh index f059613..5a45e34 100755 --- a/sysc/zlib-1.2.12/zlib-1.2.12.sh +++ b/sysc/zlib-1.2.12/zlib-1.2.12.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -urls="https://www.zlib.net/zlib-1.2.12.tar.xz" +urls="https://zlib.net/zlib-1.2.12.tar.xz" src_configure() { ./configure --prefix="${PREFIX}" --libdir="${PREFIX}/lib/musl" --static From 5ad055d2d34b8bed388274d24f987bbc5bcf73e4 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Mon, 13 Jun 2022 16:17:05 +1000 Subject: [PATCH 9/9] Fix bubblewrap mode --- rootfs.py | 16 ++++++++-------- sysc.py | 2 +- sysc/SHA256SUMS.sources | 2 +- sysc/curl-7.83.0/curl-7.83.0.sh | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rootfs.py b/rootfs.py index 1c8fee7..c8f799b 100755 --- a/rootfs.py +++ b/rootfs.py @@ -175,14 +175,14 @@ print(shutil.which('chroot')) '--dev-bind', '/dev/zero', '/dev/zero', '--dev-bind', '/dev/random', '/dev/random', '--dev-bind', '/dev/urandom', '/dev/urandom', - '--dir', '/sysc/dev', - '--dev-bind', '/dev/null', '/sysc/dev/null', - '--dev-bind', '/dev/zero', '/sysc/dev/zero', - '--dev-bind', '/dev/random', '/sysc/dev/random', - '--dev-bind', '/dev/urandom', '/sysc/dev/urandom', - '--proc', '/sysc/proc', - '--bind', '/sys', '/sysc/sys', - '--tmpfs', '/sysc/tmp', + '--dir', '/sysc_image/dev', + '--dev-bind', '/dev/null', '/sysc_image/dev/null', + '--dev-bind', '/dev/zero', '/sysc_image/dev/zero', + '--dev-bind', '/dev/random', '/sysc_image/dev/random', + '--dev-bind', '/dev/urandom', '/sysc_image/dev/urandom', + '--proc', '/sysc_image/proc', + '--bind', '/sys', '/sysc_image/sys', + '--tmpfs', '/sysc_image/tmp', init) elif args.minikernel: diff --git a/sysc.py b/sysc.py index 75b1580..7be61e4 100755 --- a/sysc.py +++ b/sysc.py @@ -150,7 +150,7 @@ class SysC(SysGeneral): self.get_file("https://artfiles.org/openssl.org/source/old/1.1.1/openssl-1.1.1l.tar.gz") # curl 7.83.0 - self.get_file("https://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1") + self.get_file("https://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz") # ca-certificates-3.78 self.get_file("https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_78_RTM/src/nss-3.78.tar.gz") diff --git a/sysc/SHA256SUMS.sources b/sysc/SHA256SUMS.sources index 0edbbf9..7d406cb 100644 --- a/sysc/SHA256SUMS.sources +++ b/sysc/SHA256SUMS.sources @@ -8,7 +8,7 @@ cc012bc860406dcf42f64431bcd3d2fa7560c02915a601aba9cd597a39329baa bash-5.1.tar.g b10d7e9e354be72aee4e4911cf19dd27b5c527d4e7200857365b5fcdeea0dffb bison-2.3.tar.bz2 27d05534699735dc69e86add5b808d6cb35900ad3fd63fa82e3eb644336abfa0 bison-3.4.2.tar.xz 6f7cfc0ac6717afb6ba1f41b0da43a713ba0dd97dec1227e32effc12d79f08c1 coreutils-8.32.tar.gz -bbff0e6b5047e773f3c3b084d80546cc1be4e354c09e419c2d0ef6116253511a curl-7.83.0.tar.xz?viasf=1 +bbff0e6b5047e773f3c3b084d80546cc1be4e354c09e419c2d0ef6116253511a curl-7.83.0.tar.xz 05fa4f6ea9f05adf8f577699cb3f5b88b20dfce86b0d0cebbfb072fe5933d38f dist_3.5-236.orig.tar.gz c40385e142989c91989413f3c5a31282b2ffdca16b69cd3ecfde537b8a474921 flex-2.5.33.tar.gz 436a0ddc67b1ac0b0405b61a9675bca9e075c8156f4debd1d06f3a56c7cd289d gc-8.0.4.tar.gz diff --git a/sysc/curl-7.83.0/curl-7.83.0.sh b/sysc/curl-7.83.0/curl-7.83.0.sh index 40a2621..290b26f 100755 --- a/sysc/curl-7.83.0/curl-7.83.0.sh +++ b/sysc/curl-7.83.0/curl-7.83.0.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: GPL-3.0-or-later -urls="http://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz?viasf=1" +urls="http://master.dl.sourceforge.net/project/curl.mirror/curl-7_83_0/curl-7.83.0.tar.xz" src_prepare() { default