Merge pull request #178 from fosslinux/network

Network
This commit is contained in:
Andrius Štikonas 2022-06-18 10:51:26 +01:00 committed by GitHub
commit 0717485993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
66 changed files with 904 additions and 137 deletions

10
LICENSES/curl.txt Normal file
View File

@ -0,0 +1,10 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2015, Daniel Stenberg, <daniel@haxx.se>.
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.

View File

@ -95,9 +95,13 @@ 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:
target_file.write(response.raw.read())

View File

@ -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):

View File

@ -11,7 +11,7 @@ you can run bootstap inside chroot.
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Bastian Bittorf <bb@npl.de>
# SPDX-FileCopyrightText: 2021 Melg Eight <public.melg8@gmail.com>
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
import argparse
import os
@ -33,8 +33,12 @@ 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")
# pylint: disable=too-many-statements
def main():
"""
A few command line arguments to customize bootstrap.
@ -57,6 +61,9 @@ 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.",
action="store_true")
parser.add_argument("--no-create-config",
help="Do not automatically create config file",
action="store_true")
@ -116,11 +123,11 @@ 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,
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)
@ -138,7 +145,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 +157,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)
@ -170,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:
@ -187,7 +192,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 +215,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 +226,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 +234,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',

41
sysa.py
View File

@ -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, 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
@ -32,9 +32,10 @@ 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
self.external_sources = external_sources
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 +52,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(create_initramfs)
if repo_path:
repo_dir = os.path.join(self.tmp_dir, 'usr', 'src', 'repo-preseeded')
@ -66,17 +66,21 @@ 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):
def sysc(self, create_initramfs):
"""Copy in sysc files for sysc."""
shutil.copytree(self.sysc_tmp, os.path.join(self.tmp_dir, 'sysc'),
shutil.ignore_patterns('tmp'))
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=ignore)
def stage0_posix(self):
"""Copy in all of the stage0-posix"""
@ -95,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"],
@ -260,6 +263,22 @@ 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"])
# 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")

View File

@ -32,11 +32,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
@ -61,7 +66,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
@ -76,7 +81,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

View File

@ -20,10 +20,17 @@ 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
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
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
@ -46,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
@ -57,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

32
sysa/curl-7.83.0/curl-7.83.0.sh Executable file
View File

@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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}" \
--build=i386-unknown-linux-gnu \
--without-ssl \
--disable-hsts
}
src_install() {
default
install -m 755 scripts/mk-ca-bundle.pl "${DESTDIR}/usr/bin/mk-ca-bundle"
}

View File

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 1998-2021 Daniel Stenberg <daniel@haxx.se>
#
# SPDX-License-Identifier: curl
my $pi = 3.1415;
foreach my $i (1 .. 200) {
printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000;
}

View File

@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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
@@ -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;

View File

@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
rm src/dhcpcd-embedded.c.in
}
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"
}

View File

@ -0,0 +1,134 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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
@@ -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
@@ -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;

View File

@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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
}

View File

@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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 @@
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}"

View File

@ -0,0 +1,82 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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 @@
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

View File

@ -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() {
@ -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,36 @@ build() {
unset -f src_unpack src_prepare src_configure src_compile src_install
}
# Default get function that downloads source tarballs.
default_src_get() {
# 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
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.
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
@ -377,22 +404,23 @@ 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
}
sys_transfer() {
local dest=$1
local sys_sources=$2
mkdir -p "${dest}/${PREFIX}/bin" "${dest}/${PREFIX}/src"
@ -400,11 +428,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/"

View File

@ -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

View File

@ -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,19 +17,17 @@ 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"
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 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
rm -rf /sysb # Cleanup
gen_initramfs_list.sh -o "${PREFIX}/boot/initramfs-sysb.cpio.gz" /sysb_image
rm -rf /sysb /sysb_image # Cleanup
}
go_sysb() {
@ -222,10 +218,16 @@ build gcc-4.0.4 pass2.sh
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
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:?}"
@ -246,6 +248,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

View File

@ -1,13 +1,38 @@
#!/usr/bin/bash
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
export PATH=/usr/bin
export PREFIX=/usr
export SOURCES=/usr/src
# shellcheck source=sysa/helpers.sh
. /usr/src/helpers.sh
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

View File

@ -28,16 +28,21 @@ 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() {
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,18 @@ if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then
echo "DISK=${DISK}" >> /usr/src/bootstrap.cfg
fi
# 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
SOURCES="${PREFIX}/src"
SYSC=/sysc
@ -68,7 +85,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

51
sysc.py
View File

@ -6,13 +6,13 @@
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
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,11 +20,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,22 +55,26 @@ 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')
rootfs_dir = os.path.join(self.tmp_dir, 'mnt')
os.mkdir(rootfs_dir)
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
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
self.get_packages()
copytree(self.sys_dir, rootfs_dir, ignore=shutil.ignore_patterns("tmp"))
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
@ -80,7 +84,7 @@ class SysC(SysGeneral):
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")
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")
@ -100,7 +104,7 @@ class SysC(SysGeneral):
"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")
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")
@ -133,22 +137,26 @@ class SysC(SysGeneral):
# 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")
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",
"https://salsa.debian.org/perl-team/interpreter/perl/-/archive/5f2dc80/perl-5f2dc80.tar.bz2"])
"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://www.openssl.org/source/openssl-1.1.1l.tar.gz")
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")
# 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")
# 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")
@ -193,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"])

View File

@ -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
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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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 -a 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"
}

View File

@ -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

29
sysc/curl-7.83.0/curl-7.83.0.sh Executable file
View File

@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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"
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}" \
--with-openssl \
--with-ca-bundle=/etc/ssl/certs.pem \
--build=i386-unknown-linux-musl
}

View File

@ -0,0 +1,8 @@
# SPDX-FileCopyrightText: 1998-2021 Daniel Stenberg <daniel@haxx.se>
#
# SPDX-License-Identifier: curl
my $pi = 3.1415;
foreach my $i (1 .. 200) {
printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000;
}

View File

@ -0,0 +1,62 @@
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# 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
@@ -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;

View File

@ -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*

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,14 +1,12 @@
#!/usr/bin/bash
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
# shellcheck source=sysa/helpers.sh
. 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
@ -54,15 +57,11 @@ 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
if [ -d "${DISTFILES}" ]; then
cd "${DISTFILES}"
sha256sum -c "${SOURCES}/SHA256SUMS.sources"
fi
# Begin sysc bootstrapping process
cd "${SOURCES}"

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: Artistic-1.0
@ -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!

View File

@ -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

View File

@ -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
}

View File

@ -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
}

View File

@ -23,12 +23,36 @@ 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 ""
populate_device_nodes
create_fhs
# 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
exec env -i PATH="${PATH}" PREFIX="${PREFIX}" SOURCES="${SOURCES}" DESTDIR="${DESTDIR}" DISTFILES="${DISTFILES}" SRCDIR="${SRCDIR}" bash run2.sh

View File

@ -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
@ -59,6 +59,10 @@ 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
build xbps-0.59.1
@ -104,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}

View File

@ -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

View File

@ -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

View File

@ -2,6 +2,9 @@
#
# 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() {
PKG_CONFIG_PATH="${PREFIX}/lib/musl/pkgconfig" \
./configure --prefix="${PREFIX}" \

View File

@ -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

View File

@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
urls="https://zlib.net/zlib-1.2.12.tar.xz"
src_configure() {
./configure --prefix="${PREFIX}" --libdir="${PREFIX}/lib/musl" --static
}