From dcd43599a7e6a976671f9721fa167b41723c8c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Thu, 23 Mar 2023 18:35:38 +0100 Subject: [PATCH] Build both stages of curl in sysc The source tarball is provided as part of sysa distfiles and copied to sysc, which resolves the issue of finding a reliable plain HTTP mirror for curl. Splitted from https://github.com/fosslinux/live-bootstrap/pull/253. --- parts.rst | 12 ++-- sysa/SHA256SUMS.pkgs | 2 +- sysa/curl-7.88.1/files/sinus.pl | 8 --- sysa/curl-7.88.1/patches/help.patch | 62 ------------------- sysa/run2.sh | 5 +- .../curl-7.88.1/pass1.sh | 7 +-- sysc/curl-7.88.1/{curl-7.88.1.sh => pass2.sh} | 4 +- .../patches/timeless-mk-ca-bundle.patch | 0 sysc/curl-7.88.1/sources | 2 +- sysc/init | 1 - sysc/run.sh | 14 +++-- sysc/run2.sh | 2 +- 12 files changed, 23 insertions(+), 96 deletions(-) delete mode 100644 sysa/curl-7.88.1/files/sinus.pl delete mode 100644 sysa/curl-7.88.1/patches/help.patch rename sysa/curl-7.88.1/curl-7.88.1.sh => sysc/curl-7.88.1/pass1.sh (69%) rename sysc/curl-7.88.1/{curl-7.88.1.sh => pass2.sh} (88%) rename {sysa => sysc}/curl-7.88.1/patches/timeless-mk-ca-bundle.patch (100%) diff --git a/parts.rst b/parts.rst index 38f5d90..0b99170 100644 --- a/parts.rst +++ b/parts.rst @@ -625,12 +625,6 @@ make 3.82 GNU ``make`` is now rebuilt properly using the build system and GCC, which means that it does not randomly segfault while building the Linux kernel. -curl 7.88.1 -=========== - -``curl`` is used to download files using various protocols including HTTP and HTTPS. -However, this first build does not support encrypted HTTPS yet. - ed 1.4 ====== @@ -694,6 +688,12 @@ sysb is purely a transition to sysc, allowing binaries from sysa to get onto a disk (as sysa does not necessarily have hard disk support in the kernel). It populates device nodes, mounts sysc, copies over data, and executes sysc. +curl 7.88.1 +=========== + +``curl`` is used to download files using various protocols including HTTP and HTTPS. +However, this first build does not support encrypted HTTPS yet. + bash 5.2.15 =========== diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs index b6f3a15..1889f38 100644 --- a/sysa/SHA256SUMS.pkgs +++ b/sysa/SHA256SUMS.pkgs @@ -36,7 +36,7 @@ c511d571d24675a141258e0e198c5ed1bcfd4889ddd736ff8e25c0d97b44e2cf ca-certificate 27d0d3e84794f080f01c7c22547a308d1d781d8ce85d5b3f682c379f17bbeb47 coreutils-6.10_0.tar.bz2 e41aba2caa7514704731d3b7a49f63ff8ffb2d22a64f14afdbaadbd0b24073f0 coreutils-8.32_0.tar.bz2 8df7fe3124243028cc9fd9a00fe8ab55c2143a9b7551426447867d2e1de436b6 curl-7.88.1_0.tar.bz2 -8f8442bc11c2c70028da083a42f5bf819bb57a452c8f41e988d980e6b561dca2 curl-7.88.1_1.tar.bz2 +d7d0a5fc9117f9b3ebd287851a48716c96a3c11991365edb8890f0e203d3b810 curl-7.88.1_1.tar.bz2 0b832d3efef962c10b61559052373267e9c85bbff37572b736a6996823e2d5b2 dhcpcd-9.4.1_0.tar.bz2 f1a17f3d1c65140a6d3043ecb710e5fffe9c019cb3d2eaa982be03706876e534 diffutils-2.7_0.tar.bz2 bda6afcd3a390a34a57443269a4857ccc470129f7a557981778c145fd841cbd1 dist-3.5-236_0.tar.bz2 diff --git a/sysa/curl-7.88.1/files/sinus.pl b/sysa/curl-7.88.1/files/sinus.pl deleted file mode 100644 index 12efee5..0000000 --- a/sysa/curl-7.88.1/files/sinus.pl +++ /dev/null @@ -1,8 +0,0 @@ -# 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.88.1/patches/help.patch b/sysa/curl-7.88.1/patches/help.patch deleted file mode 100644 index a6dd434..0000000 --- a/sysa/curl-7.88.1/patches/help.patch +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-FileCopyrightText: 2022 fosslinux -# -# SPDX-License-Identifier: curl - -Regenerating help is not trivial. Help is unnecessary. -Disable help. - -diff -ru src/Makefile.inc src/Makefile.inc ---- src/Makefile.inc -+++ src/Makefile.inc -@@ -70,11 +70,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 -ru src/tool_operate.c src/tool_operate.c ---- src/tool_operate.c -+++ src/tool_operate.c -@@ -80,7 +80,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" -@@ -2703,19 +2702,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/run2.sh b/sysa/run2.sh index c17116c..d964d20 100755 --- a/sysa/run2.sh +++ b/sysa/run2.sh @@ -69,12 +69,13 @@ build kbd-1.15 build make-3.82 -build curl-7.88.1 - build ed-1.4 build bc-1.07.1 +mkdir -p /sysc/distfiles +cp "${DISTFILES}"/curl-7.88.1.tar.bz2 /sysc/distfiles + # Clear up some RAM space grep --no-filename '^build' "${SOURCES}"/run*.sh | sed "s/build //" | sed "s/ .*$//" | while read -r p ; do rm -rf "${SOURCES:?}/${p:?}" diff --git a/sysa/curl-7.88.1/curl-7.88.1.sh b/sysc/curl-7.88.1/pass1.sh similarity index 69% rename from sysa/curl-7.88.1/curl-7.88.1.sh rename to sysc/curl-7.88.1/pass1.sh index 99dea4d..7bd282e 100755 --- a/sysa/curl-7.88.1/curl-7.88.1.sh +++ b/sysc/curl-7.88.1/pass1.sh @@ -11,16 +11,11 @@ src_prepare() { rm src/tool_help.c src/tool_help.h src/tool_listhelp.c src/tool_hugehelp.c - # configure.ac uses the AM_COND_IF macro, which is not supported - # by automake 1.10. The place where it is used is only relevant - # for windows builds, so we can simply patch it away. - sed -i "659,662d" configure.ac - # Rebuild libtool files rm config.guess config.sub ltmain.sh libtoolize - AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 AUTOM4TE=autom4te-2.64 AUTOCONF=autoconf-2.64 autoreconf-2.64 -fi + AUTOMAKE=automake-1.15 ACLOCAL=aclocal-1.15 autoreconf-2.69 -fi } src_configure() { diff --git a/sysc/curl-7.88.1/curl-7.88.1.sh b/sysc/curl-7.88.1/pass2.sh similarity index 88% rename from sysc/curl-7.88.1/curl-7.88.1.sh rename to sysc/curl-7.88.1/pass2.sh index e59eca5..809a4f0 100755 --- a/sysc/curl-7.88.1/curl-7.88.1.sh +++ b/sysc/curl-7.88.1/pass2.sh @@ -22,8 +22,8 @@ src_configure() { LDFLAGS="-static" ./configure \ --prefix="${PREFIX}" \ --libdir="${LIBDIR}" \ + --build=i386-unknown-linux-musl \ --enable-ipv6 \ --with-openssl \ - --with-ca-bundle=/etc/ssl/certs.pem \ - --build=i386-unknown-linux-musl + --with-ca-bundle=/etc/ssl/certs.pem } diff --git a/sysa/curl-7.88.1/patches/timeless-mk-ca-bundle.patch b/sysc/curl-7.88.1/patches/timeless-mk-ca-bundle.patch similarity index 100% rename from sysa/curl-7.88.1/patches/timeless-mk-ca-bundle.patch rename to sysc/curl-7.88.1/patches/timeless-mk-ca-bundle.patch diff --git a/sysc/curl-7.88.1/sources b/sysc/curl-7.88.1/sources index 86bfb58..7858eb9 100644 --- a/sysc/curl-7.88.1/sources +++ b/sysc/curl-7.88.1/sources @@ -1 +1 @@ -http://curl.se/download/curl-7.88.1.tar.xz 1dae31b2a7c1fe269de99c0c31bb488346aab3459b5ffca909d6938249ae415f +https://curl.se/download/curl-7.88.1.tar.bz2 8224b45cce12abde039c12dc0711b7ea85b104b9ad534d6e4c5b4e188a61c907 diff --git a/sysc/init b/sysc/init index 13ca925..cffdd6d 100755 --- a/sysc/init +++ b/sysc/init @@ -43,7 +43,6 @@ install_tar binutils-2.30 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.88.1 0 install_tar dhcpcd-9.4.1 0 install_tar diffutils-2.7 0 install_tar findutils-4.2.33 0 diff --git a/sysc/run.sh b/sysc/run.sh index c207f19..549284d 100755 --- a/sysc/run.sh +++ b/sysc/run.sh @@ -36,6 +36,14 @@ create_fhs populate_device_nodes +if [ -e "${SOURCES}/distfiles" ]; then + mv "${SOURCES}/distfiles" / +else + mkdir -p "${DISTFILES}" +fi + +build curl-7.88.1 pass1.sh + # Obtain network connection if [ "${CHROOT}" = "False" ]; then dhcpcd --waitip=4 @@ -52,12 +60,6 @@ if [ "${CHROOT}" = "False" ]; then done fi -if [ -e "${SOURCES}/distfiles" ]; then - mv "${SOURCES}/distfiles" / -else - mkdir -p "${DISTFILES}" -fi - build bash-5.2.15 exec env -i PATH="${PATH}" HOME="${HOME}" SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH}" bash run2.sh diff --git a/sysc/run2.sh b/sysc/run2.sh index 1820997..988b992 100755 --- a/sysc/run2.sh +++ b/sysc/run2.sh @@ -58,7 +58,7 @@ build openssl-1.1.1l build ca-certificates-3.88.1 -build curl-7.88.1 +build curl-7.88.1 pass2.sh build zlib-1.2.13