commit: 53803ed46ff2f90158a545d9005e796627f0319c
parent 594fd62e7e4a3471d4f353c045ab9adb927213b4
Author: fosslinux <fosslinux@aussies.space>
Date: Tue, 10 May 2022 20:23:11 +1000
Merge pull request #157 from stikonas/transition_packages
Reinstall system from packages during sysa->sysc and sysb->sysc transitions
Diffstat:
46 files changed, 188 insertions(+), 134 deletions(-)
diff --git a/.cirrus.yml b/.cirrus.yml
@@ -24,7 +24,7 @@ shell_lint_task:
- apt-get -y install shellcheck
- apt-get -y clean
check_script:
- - shellcheck sysa/run.sh sysb/run.sh sysc/run.sh sysc/run2.sh sysa/helpers.sh
+ - shellcheck sysa/run.sh sysb/init sysb/run.sh sysc/init sysc/run.sh sysc/run2.sh sysa/helpers.sh
reuse_lint_task:
container:
diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs
@@ -160,7 +160,7 @@ b418ef47a65ba1f52f0b79a96ce2ebf1bb1f4f2a78e3985fa512e6c41477f100 perl5.005-03_0
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 perl-5.10.1_0.links
0e216f189404be18ef7463665e9288258058b322f0636e9b9c19b5262af7980a perl-5.10.1_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 perl-5.32.1_0.links
-9ed0a0c9ff88af07ea2cb2eea6367365da42a346a81b537f6e4a3dc80076953d perl-5.32.1_0.tar.bz2
+de89e006bed3db40681e3d3f7a485526299d3bebbf4a2ed825f62a7fa94b5947 perl-5.32.1_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 perl-5.6.2_0.links
b5fce312b381d0135d44b1bd30089e89e17ce35e6cf5e326eac87baf6c554dd4 perl-5.6.2_0.tar.bz2
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 pkg-config-0.29.2_0.links
diff --git a/sysa/autoconf-2.52/stage1.sh b/sysa/autoconf-2.52/stage1.sh
@@ -15,7 +15,7 @@ src_compile() {
}
src_install() {
- install -D autoconf ${DESTDIR}${PREFIX}/bin/autoconf-2.52
- mkdir -p ${DESTDIR}${PREFIX}/share/autoconf-2.52
- cp -r *.m4* ${DESTDIR}${PREFIX}/share/autoconf-2.52/
+ install -D autoconf "${DESTDIR}${PREFIX}/bin/autoconf-2.52"
+ mkdir -p "${DESTDIR}${PREFIX}/share/autoconf-2.52"
+ cp -r -- *.m4* "${DESTDIR}${PREFIX}/share/autoconf-2.52/"
}
diff --git a/sysa/autoconf-2.52/stage2.sh b/sysa/autoconf-2.52/stage2.sh
@@ -4,14 +4,14 @@
src_prepare() {
rm doc/standards.info doc/autoconf.info
- rm Makefile.in */Makefile.in
+ rm -- Makefile.in */Makefile.in
rm configure
autoconf-2.52
automake-1.4
# Install autoconf data files into versioned directory
for file in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
@@ -25,8 +25,8 @@ src_compile() {
src_install() {
# Remove manually installed autoconf
- rm ${PREFIX}/bin/autoconf-2.52
- rm -rf ${PREFIX}/share/autoconf-2.52
+ rm "${PREFIX}/bin/autoconf-2.52"
+ rm -rf "${PREFIX}/share/autoconf-2.52"
make install MAKEINFO=true DESTDIR="${DESTDIR}"
}
diff --git a/sysa/autoconf-2.53/stage1.sh b/sysa/autoconf-2.53/stage1.sh
@@ -5,7 +5,7 @@
src_prepare() {
default
- rm Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
+ rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
aclocal-1.6
@@ -19,7 +19,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.53/stage2.sh b/sysa/autoconf-2.53/stage2.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
+ rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
aclocal-1.6
@@ -13,7 +13,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.54/stage1.sh b/sysa/autoconf-2.54/stage1.sh
@@ -4,7 +4,7 @@
src_prepare() {
rm bin/autoconf.in
- rm Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
+ rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
aclocal-1.7
sed -i 's/2.54/2.53/' aclocal.m4
@@ -17,7 +17,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.54/stage2.sh b/sysa/autoconf-2.54/stage2.sh
@@ -4,14 +4,14 @@
src_prepare() {
rm bin/autoconf.in
- rm Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
+ rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
autoreconf-2.54
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.55/autoconf-2.55.sh b/sysa/autoconf-2.55/autoconf-2.55.sh
@@ -4,14 +4,14 @@
src_prepare() {
rm bin/autoconf.in
- rm Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
+ rm -- Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 configure
rm doc/standards.info doc/autoconf.info
autoreconf-2.54
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.57/autoconf-2.57.sh b/sysa/autoconf-2.57/autoconf-2.57.sh
@@ -10,7 +10,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.59/autoconf-2.59.sh b/sysa/autoconf-2.59/autoconf-2.59.sh
@@ -10,7 +10,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.61/stage1.sh b/sysa/autoconf-2.61/stage1.sh
@@ -9,7 +9,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.61/stage2.sh b/sysa/autoconf-2.61/stage2.sh
@@ -8,7 +8,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/autoconf-2.64/autoconf-2.64.sh b/sysa/autoconf-2.64/autoconf-2.64.sh
@@ -8,7 +8,7 @@ src_prepare() {
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysa/automake-1.4-p6/automake-1.4-p6.sh b/sysa/automake-1.4-p6/automake-1.4-p6.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in aclocal.m4 automake.info*
aclocal-1.6
autoconf-2.52
# When building with newer automake we get the following error
diff --git a/sysa/automake-1.6.3/stage1.sh b/sysa/automake-1.6.3/stage1.sh
@@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
cp aclocal.in aclocal
cp m4/amversion.in m4/amversion.m4
}
diff --git a/sysa/automake-1.6.3/stage2.sh b/sysa/automake-1.6.3/stage2.sh
@@ -6,7 +6,7 @@
src_prepare() {
sed -i '/Makefile/d' configure.in
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
aclocal-1.6
autoconf-2.52
}
diff --git a/sysa/automake-1.6.3/stage3.sh b/sysa/automake-1.6.3/stage3.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
aclocal-1.6
autoconf-2.52
automake-1.6
diff --git a/sysa/automake-1.7.8/automake-1.7.8.sh b/sysa/automake-1.7.8/automake-1.7.8.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
autoreconf-2.55
}
diff --git a/sysa/automake-1.7/stage1.sh b/sysa/automake-1.7/stage1.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
sed -i -e 's/2.54/2.53/' -e '/AC_PROG_EGREP/d' -e '/AC_PROG_FGREP/d' configure.in
aclocal-1.6
autoconf-2.53
diff --git a/sysa/automake-1.7/stage2.sh b/sysa/automake-1.7/stage2.sh
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
- rm configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
+ rm -- configure Makefile.in */Makefile.in */*/Makefile.in aclocal.m4 automake.info*
autoreconf-2.54
}
diff --git a/sysa/binutils-2.14/binutils-2.14.sh b/sysa/binutils-2.14/binutils-2.14.sh
@@ -72,7 +72,7 @@ src_prepare() {
done
# Rebuild bison files
- touch */*.y
+ touch -- */*.y
rm ld/ldgram.c ld/ldgram.h
rm gas/itbl-parse.c gas/itbl-parse.h
rm gas/m68k-parse.c
@@ -83,13 +83,13 @@ src_prepare() {
rm binutils/rcparse.c binutils/rcparse.h
# Rebuild flex generated files
- touch */*.l
+ touch -- */*.l
rm ld/ldlex.c
rm gas/itbl-lex.c
rm binutils/syslex.c binutils/rclex.c binutils/deflex.c binutils/arlex.c
# Remove prebuilt texinfo files
- rm */*.info* */*/*.info*
+ rm -- */*.info* */*/*.info*
}
src_configure() {
diff --git a/sysa/bzip2-1.0.8/bzip2-1.0.8.sh b/sysa/bzip2-1.0.8/bzip2-1.0.8.sh
@@ -14,8 +14,8 @@ src_compile() {
src_install() {
# Manually install bzip2 (cannot replace binary while running)
- install -D bzip2 ${PREFIX}/bin/bzip2
- mkdir -p ${DESTDIR}${PREFIX}/bin
- ln -sf ${PREFIX}/bin/bzip2 ${DESTDIR}${PREFIX}/bin/bunzip2
- ln -sf ${PREFIX}/bin/bzip2 ${DESTDIR}${PREFIX}/bin/bzcat
+ install -D bzip2 "${PREFIX}/bin/bzip2"
+ mkdir -p "${DESTDIR}${PREFIX}/bin"
+ ln -sf "${PREFIX}/bin/bzip2" "${DESTDIR}${PREFIX}/bin/bunzip2"
+ ln -sf "${PREFIX}/bin/bzip2" "${DESTDIR}${PREFIX}/bin/bzcat"
}
diff --git a/sysa/flex-2.6.4/flex-2.6.4.sh b/sysa/flex-2.6.4/flex-2.6.4.sh
@@ -22,6 +22,6 @@ src_install() {
cd ..
# Remove yacc, we won't need it any longer
- rm ${PREFIX}/bin/yacc
+ rm "${PREFIX}/bin/yacc"
rm /yaccpar
}
diff --git a/sysa/gcc-4.0.4/pass2.sh b/sysa/gcc-4.0.4/pass2.sh
@@ -94,5 +94,5 @@ src_compile() {
src_install() {
mkdir -p "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.0.4/install-tools/include"
make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}"
- cp gcc/gsyslimits.h ${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h
+ cp gcc/gsyslimits.h "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.0.4/include/syslimits.h"
}
diff --git a/sysa/helpers.sh b/sysa/helpers.sh
@@ -310,28 +310,33 @@ src_apply() {
if command -v xbps-install >/dev/null 2>&1; then
xbps-install -y -R /usr/src/repo "${pkg%%-[0-9]*}"
else
- # Overwriting files is mega busted, so do it manually
- # shellcheck disable=SC2162
- if [ -e /tmp/filelist.txt ]; then
- while IFS= read -d $'\0' file; do
- rm -f "/${file}" >/dev/null 2>&1 || true
- done < /tmp/filelist.txt
- fi
- bzip2 -dc "/usr/src/repo/${pkg}_${revision}.tar.bz2" | \
- tar -C / -xpf -
- # shellcheck disable=SC2162
- # ^ read -r unsupported in old bash
- while read line; do
- # shellcheck disable=SC2001
- # ^ cannot use variable expansion here
- fname="$(echo "${line}" | sed 's/.* //')"
- rm -f "${fname}"
- # shellcheck disable=SC2226,SC2086
- # ^ ${line} expands into two arguments
- ln -s ${line}
- touch -t 197001010000.00 "${fname}"
- done < "/usr/src/repo/${pkg}_${revision}.links"
+ src_apply_tar "${pkg}" "${revision}"
+ fi
+}
+
+src_apply_tar() {
+ local pkg=$1 revision=$2
+ # Overwriting files is mega busted, so do it manually
+ # shellcheck disable=SC2162
+ if [ -e /tmp/filelist.txt ]; then
+ while IFS= read -d $'\0' file; do
+ rm -f "/${file}" >/dev/null 2>&1 || true
+ done < /tmp/filelist.txt
fi
+ bzip2 -dc "/usr/src/repo/${pkg}_${revision}.tar.bz2" | \
+ tar -C / -xpf -
+ # shellcheck disable=SC2162
+ # ^ read -r unsupported in old bash
+ while read line; do
+ # shellcheck disable=SC2001
+ # ^ cannot use variable expansion here
+ fname="$(echo "${line}" | sed 's/.* //')"
+ rm -f "${fname}"
+ # shellcheck disable=SC2226,SC2086
+ # ^ ${line} expands into two arguments
+ ln -s ${line}
+ touch -t 197001010000.00 "${fname}"
+ done < "/usr/src/repo/${pkg}_${revision}.links"
}
# Check if bash function exists
@@ -376,3 +381,22 @@ populate_device_nodes() {
test -c "${1}/dev/console" || mknod -m 666 "${1}/dev/console" c 5 1
fi
}
+
+sys_transfer() {
+ local dest=$1
+
+ mkdir -p "${dest}/${PREFIX}/bin" "${dest}/${PREFIX}/src"
+
+ # Bash, Tar and Bzip2 are required to install packages
+ 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 -r "${PREFIX}/src/" "${dest}${PREFIX}/"
+
+ shift
+ # Copy additional binaries
+ set -- "${@/#/${PREFIX}/bin/}"
+ cp "$@" "${dest}${PREFIX}/bin/"
+}
diff --git a/sysa/kbd-1.15/kbd-1.15.sh b/sysa/kbd-1.15/kbd-1.15.sh
@@ -16,7 +16,7 @@ src_prepare() {
}
src_configure() {
- ./configure --prefix=${PREFIX}
+ ./configure --prefix="${PREFIX}"
}
src_compile() {
@@ -26,5 +26,5 @@ src_compile() {
}
src_install() {
- make MAKEINFO=true DESTDIR=${DESTDIR} install
+ make MAKEINFO=true DESTDIR="${DESTDIR}" install
}
diff --git a/sysa/kexec-tools-2.0.22/kexec-tools-2.0.22.sh b/sysa/kexec-tools-2.0.22/kexec-tools-2.0.22.sh
@@ -1,4 +1,5 @@
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
+# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -9,6 +10,6 @@ src_prepare() {
}
src_configure() {
- ./configure --prefix=${PREFIX} \
+ ./configure --prefix="${PREFIX}" \
--sbindir="${PREFIX}/bin"
}
diff --git a/sysa/linux-4.9.10/linux-4.9.10.sh b/sysa/linux-4.9.10/linux-4.9.10.sh
@@ -8,7 +8,7 @@ src_unpack() {
mv "${DISTFILES}/deblob-4.9" "${pkg}/"
# Remove all previous source tarballs
mv "${DISTFILES}/${pkg}.tar.gz" .
- rm -r "${DISTFILES}/"*
+ rm -r "${DISTFILES:?}/"*
mv "${pkg}.tar.gz" "${DISTFILES}"
default || true # Predictable link errors - not a problem
rm -r "${DISTFILES}" # Clear storage space
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
@@ -56,7 +56,7 @@ src_install() {
VERSION=5
PATCHLEVEL=10
SUBLEVEL=42
- VERSION_CODE="$((${VERSION} * 65536 + ${PATCHLEVEL} * 256 + ${SUBLEVEL}))"
+ VERSION_CODE="$((VERSION * 65536 + PATCHLEVEL * 256 + SUBLEVEL))"
echo '#define LINUX_VERSION_CODE '"${VERSION_CODE}" \
> "${DESTDIR}${PREFIX}/include/linux/version.h"
echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))' \
diff --git a/sysa/musl-1.2.2/musl-1.2.2.sh b/sysa/musl-1.2.2/musl-1.2.2.sh
@@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-SRCS="musl-1.2.2.tar.gz"
-
src_configure() {
CC=gcc ./configure \
--host=i386-unknown-linux-musl \
diff --git a/sysa/run.sh b/sysa/run.sh
@@ -253,7 +253,6 @@ if [ "${CHROOT}" = False ]; then
fi
# In chroot mode transition directly into System C.
-SYSC="/sysc"
-cp -R "${PREFIX}" "${SYSC}"
-cp "${SOURCES}/helpers.sh" "${SOURCES}/SHA256SUMS.pkgs" "${SOURCES}/bootstrap.cfg" "${SYSC}/usr/src/"
+SYSC=/sysc
+sys_transfer "${SYSC}" gzip patch
exec chroot "${SYSC}" /init
diff --git a/sysa/tcc-0.9.27/tcc-musl-pass1.sh b/sysa/tcc-0.9.27/tcc-musl-pass1.sh
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
+# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -14,7 +14,7 @@ src_compile() {
export incdir=${PREFIX}/include/musl
export bindir=${PREFIX}/bin
- mkdir -p ${libdir}/tcc
+ mkdir -p "${libdir}/tcc"
# We first have to recompile using tcc-0.9.26 as tcc-0.9.27 is not self-hosting,
# but when linked with musl it is.
@@ -24,12 +24,12 @@ src_compile() {
-static \
-o tcc-musl \
-D TCC_TARGET_I386=1 \
- -D CONFIG_TCCDIR=\"${libdir}/tcc\" \
- -D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
+ -D CONFIG_TCCDIR=\""${libdir}/tcc"\" \
+ -D CONFIG_TCC_CRTPREFIX=\""${libdir}"\" \
-D CONFIG_TCC_ELFINTERP=\"/musl/loader\" \
- -D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
- -D CONFIG_TCC_SYSINCLUDEPATHS=\"${incdir}\" \
- -D TCC_LIBGCC=\"${libdir}/libc.a\" \
+ -D CONFIG_TCC_LIBPATHS=\""${libdir}:${libdir}/tcc"\" \
+ -D CONFIG_TCC_SYSINCLUDEPATHS=\""${incdir}"\" \
+ -D TCC_LIBGCC=\""${libdir}/libc.a"\" \
-D CONFIG_TCC_STATIC=1 \
-D CONFIG_USE_LIBGCC=1 \
-D TCC_VERSION=\"0.9.27\" \
@@ -38,14 +38,14 @@ src_compile() {
# libtcc1.a
${TCC} -c -D HAVE_CONFIG_H=1 lib/libtcc1.c
- ${TCC} -ar cr ${libdir}/tcc/libtcc1.a libtcc1.o
+ ${TCC} -ar cr "${libdir}/tcc/libtcc1.a" libtcc1.o
done
}
src_install() {
# Remove old tcc binaries
- rm ${bindir}/tcc
- rm ${bindir}/boot*-tcc ${bindir}/tcc-0.9.26 ${bindir}/mes-tcc
- install -D tcc-musl ${DESTDIR}${bindir}/tcc-musl
- ln -s tcc-musl ${DESTDIR}${bindir}/tcc
+ rm "${bindir}/tcc"
+ rm "${bindir}"/boot*-tcc "${bindir}/tcc-0.9.26" "${bindir}/mes-tcc"
+ install -D tcc-musl "${DESTDIR}${bindir}/tcc-musl"
+ ln -s tcc-musl "${DESTDIR}${bindir}/tcc"
}
diff --git a/sysa/tcc-0.9.27/tcc-musl-pass2.sh b/sysa/tcc-0.9.27/tcc-musl-pass2.sh
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
+# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -14,19 +14,19 @@ src_compile() {
export incdir=${PREFIX}/include/musl
export bindir=${PREFIX}/bin
- mkdir -p ${libdir}/tcc
+ mkdir -p "${libdir}/tcc"
tcc-musl \
-v \
-static \
-o tcc-musl \
-D TCC_TARGET_I386=1 \
- -D CONFIG_TCCDIR=\"${libdir}/tcc\" \
- -D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
+ -D CONFIG_TCCDIR=\""${libdir}/tcc"\" \
+ -D CONFIG_TCC_CRTPREFIX=\""${libdir}"\" \
-D CONFIG_TCC_ELFINTERP=\"/musl/loader\" \
- -D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
- -D CONFIG_TCC_SYSINCLUDEPATHS=\"${incdir}\" \
- -D TCC_LIBGCC=\"${libdir}/libc.a\" \
+ -D CONFIG_TCC_LIBPATHS=\""${libdir}:${libdir}/tcc"\" \
+ -D CONFIG_TCC_SYSINCLUDEPATHS=\""${incdir}"\" \
+ -D TCC_LIBGCC=\""${libdir}/libc.a"\" \
-D CONFIG_TCC_STATIC=1 \
-D CONFIG_USE_LIBGCC=1 \
-D TCC_VERSION=\"0.9.27\" \
@@ -39,6 +39,6 @@ src_compile() {
}
src_install() {
- install -D tcc-musl ${DESTDIR}${bindir}/tcc-musl
- install -D -m 644 libtcc1.a ${DESTDIR}${libdir}/libtcc1.a
+ install -D tcc-musl "${DESTDIR}${bindir}/tcc-musl"
+ install -D -m 644 libtcc1.a "${DESTDIR}${libdir}/libtcc1.a"
}
diff --git a/sysa/tcc-0.9.27/tcc-musl-pass3.sh b/sysa/tcc-0.9.27/tcc-musl-pass3.sh
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
+# SPDX-FileCopyrightText: 2021-2022 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@@ -14,24 +14,24 @@ src_compile() {
export incdir=${PREFIX}/include
export bindir=${PREFIX}/bin
- mkdir -p ${libdir}/tcc
+ mkdir -p "${libdir}/tcc"
tcc-musl \
-v \
-static \
-o tcc-musl \
-D TCC_TARGET_I386=1 \
- -D CONFIG_TCCDIR=\"${libdir}/tcc\" \
- -D CONFIG_TCC_CRTPREFIX=\"${libdir}\" \
+ -D CONFIG_TCCDIR=\""${libdir}/tcc"\" \
+ -D CONFIG_TCC_CRTPREFIX=\""${libdir}"\" \
-D CONFIG_TCC_ELFINTERP=\"/musl/loader\" \
- -D CONFIG_TCC_LIBPATHS=\"${libdir}:${libdir}/tcc\" \
- -D CONFIG_TCC_SYSINCLUDEPATHS=\"${incdir}\" \
- -D TCC_LIBGCC=\"${libdir}/libc.a\" \
+ -D CONFIG_TCC_LIBPATHS=\""${libdir}:${libdir}/tcc"\" \
+ -D CONFIG_TCC_SYSINCLUDEPATHS=\""${incdir}"\" \
+ -D TCC_LIBGCC=\""${libdir}/libc.a"\" \
-D CONFIG_TCC_STATIC=1 \
-D CONFIG_USE_LIBGCC=1 \
-D TCC_VERSION=\"0.9.27\" \
-D ONE_SOURCE=1 \
- -I ${incdir} \
+ -I "${incdir}" \
tcc.c
# libtcc1.a
@@ -40,6 +40,6 @@ src_compile() {
}
src_install() {
- install -D tcc-musl ${DESTDIR}${bindir}/tcc-musl
- install -D -m 644 libtcc1.a ${DESTDIR}${libdir}/libtcc1.a
+ install -D tcc-musl "${DESTDIR}${bindir}/tcc-musl"
+ install -D -m 644 libtcc1.a "${DESTDIR}${libdir}/libtcc1.a"
}
diff --git a/sysa/util-linux-2.19.1/util-linux-2.19.1.sh b/sysa/util-linux-2.19.1/util-linux-2.19.1.sh
@@ -10,7 +10,7 @@ src_prepare() {
}
src_configure() {
- ./configure --prefix=${PREFIX} \
+ ./configure --prefix="${PREFIX}" \
--bindir="${PREFIX}/bin" \
--sbindir="${PREFIX}/bin" \
--libdir="${PREFIX}/lib/musl" \
diff --git a/sysb/run.sh b/sysb/run.sh
@@ -55,6 +55,10 @@ if [ -z "${DISK}" ] || ! [ -e "/dev/${DISK}" ]; then
ask_disk
fi
+PREFIX=/usr
+SOURCES="${PREFIX}/src"
+SYSC=/sysc
+
echo "export DISK=${DISK}" >> /usr/src/bootstrap.cfg
# Otherwise, add stuff from sysa to sysb
@@ -64,13 +68,7 @@ mount -t ext4 "/dev/${DISK}" /sysc
# Copy over appropriate data
echo "Copying data into sysc"
-cp -r /dev /sysc/
-mkdir -p /sysc/usr/src
-# Don't include /usr/src
-find /usr -mindepth 1 -maxdepth 1 -type d -not -name src -exec cp -r {} /sysc/{} \;
-# Except for a few files
-cp /usr/src/helpers.sh /usr/src/SHA256SUMS.pkgs /usr/src/bootstrap.cfg /sysc/usr/src/
-cp -r /usr/src/repo /sysc/usr/src/repo
+sys_transfer "${SYSC}" gzip patch
sync
# switch_root into sysc 1. for simplicity 2. to avoid kexecing again
diff --git a/sysc/autoconf-2.69/autoconf-2.69.sh b/sysc/autoconf-2.69/autoconf-2.69.sh
@@ -3,15 +3,13 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-SRCS="autoconf-2.69.tar.xz"
-
src_prepare() {
rm doc/standards.info man/*.1
autoreconf-2.64 -f
# Install autoconf data files into versioned directory
for file in */*/Makefile.in */Makefile.in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' "$file"
done
}
diff --git a/sysc/autoconf-2.71/autoconf-2.71.sh b/sysc/autoconf-2.71/autoconf-2.71.sh
@@ -2,16 +2,12 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-SRCS="autoconf-2.71.tar.xz"
-
src_prepare() {
rm doc/standards.info
autoreconf-2.69 -fi
# Install autoconf data files into versioned directory
- for file in Makefile.in; do
- sed -i '/^pkgdatadir/s:$:-@VERSION@:' $file
- done
+ sed -i '/^pkgdatadir/s:$:-@VERSION@:' Makefile.in
}
src_configure() {
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
@@ -2,8 +2,6 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
-SRCS="autoconf-archive-2021.02.19.tar.xz"
-
src_prepare() {
autoreconf-2.69 -fi
}
diff --git a/sysc/bash-5.1/bash-5.1.sh b/sysc/bash-5.1/bash-5.1.sh
@@ -11,7 +11,7 @@ src_prepare() {
# Rebuild configure script
rm configure
- autoconf-2.61
+ autoconf-2.64
# avoid non-deterministic build:
printf '%s\n%s\n' \
diff --git a/sysc/coreutils-8.32/coreutils-8.32.sh b/sysc/coreutils-8.32/coreutils-8.32.sh
@@ -18,8 +18,8 @@ regenerate_files() {
# dependency.
cp man/dummy-man man/help2man
- VERSION=$(basename ${BASH_SOURCE[0]} .sh | sed 's/coreutils-//')
- echo $VERSION > .tarball-version
+ VERSION=$(basename "${BASH_SOURCE[0]}" .sh | sed 's/coreutils-//')
+ echo "$VERSION" > .tarball-version
# We don't have autopoint from gettext yet.
AUTOPOINT=true autoreconf-2.69 -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
@@ -42,20 +42,20 @@ src_prepare() {
# Regenerate configure scripts
# Find all folders with configure script and rebuild them. At the moment we exclude boehm-gc folder due to
# an error but we don't use that directory anyway (it's only needed for Objective C)
- for dir in $(ls */configure | sed 's#/configure##' | tr "\n" " " | sed -e 's/ $/\n/' -e 's/^boehm-gc //'); do
- cd $dir
+ for dir in $(find . -mindepth 2 -maxdepth 2 -name configure.ac | sed 's#/configure.ac##' | tr "\n" " " | sed -e 's/ $/\n/' -e 's/^boehm-gc //'); do
+ pushd "$dir"
rm configure
autoconf-2.64 || autoconf-2.64
- cd ..
+ popd
done
# Regenerate Makefile.in
# Find all folders with Makefile.am and rebuild them. At the moment we exclude boehm-gc folder.
- for dir in $(ls */Makefile.am | sed 's#/Makefile.am##' | tr "\n" " " | sed -e 's/ $/\n/' -e 's/^boehm-gc //'); do
- cd $dir
+ for dir in $(find . -mindepth 2 -maxdepth 2 -name Makefile.am | sed 's#/Makefile.am##' | tr "\n" " " | sed -e 's/ $/\n/' -e 's/^boehm-gc //'); do
+ pushd "$dir"
rm Makefile.in
AUTOCONF=autoconf-2.64 AUTOM4TE=autom4te-2.64 automake-1.11
- cd ..
+ popd
done
for dir in libdecnumber libcpp libiberty gcc; do
@@ -68,7 +68,7 @@ src_prepare() {
# Rebuild libtool files
rm config.guess config.sub ltmain.sh
libtoolize
- cp "${PREFIX}/"/share/automake-1.15/config.sub .
+ cp "${PREFIX}/share/automake-1.15/config.sub" .
# Workaround for bison being too new
rm intl/plural.c
@@ -126,7 +126,7 @@ src_compile() {
pushd order-a
ar x ../.libs/libstdc++.a
rm ../.libs/libstdc++.a
- ar cru ../.libs/libstdc++.a *.o
+ ar cru ../.libs/libstdc++.a ./*.o
popd
popd
}
@@ -135,7 +135,7 @@ src_install() {
make -C build/gcc install STMP_FIXINC= DESTDIR="${DESTDIR}" MAKEINFO=true
make -C build/libgcc install DESTDIR="${DESTDIR}" host_subdir=build
make -C build/libstdc++-v3 install DESTDIR="${DESTDIR}"
- cp gcc/gsyslimits.h ${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.7.4/include/syslimits.h
+ cp gcc/gsyslimits.h "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.7.4/include/syslimits.h"
# Very strange mis-versoning error
mkdir -p "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.7.4/include/"
mv "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.0.4/include/"* "${DESTDIR}${PREFIX}/lib/musl/gcc/i386-unknown-linux-musl/4.7.4/include/"
diff --git a/sysc/guile-3.0.7/guile-3.0.7.sh b/sysc/guile-3.0.7/guile-3.0.7.sh
@@ -67,7 +67,7 @@ src_compile() {
pushd libguile/.libs/order
ar x ../libguile-3.0.a
rm ../libguile-3.0.a
- ar cr ../libguile-3.0.a *.o
+ ar cr ../libguile-3.0.a ./*.o
popd
# Recompile guile with fixed libguile
diff --git a/sysc/init b/sysc/init
@@ -6,9 +6,51 @@
set -e
+# shellcheck source=sysa/helpers.sh
+. helpers.sh
+
+echo
+echo "Installing packages into sysc"
+
+install_tar() {
+ echo "${1}: installing package"
+ src_apply_tar "$@"
+}
+
+# Install packages.
+# First two packages must be coreutils and sed
+
+install_tar coreutils-5.0 0
+install_tar sed-4.0.9 0
+
+install_tar autoconf-2.64 0
+install_tar automake-1.10.3 0
+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 diffutils-2.7 0
+install_tar findutils-4.2.33 0
+install_tar flex-2.6.4 0
+install_tar gawk-3.0.4 0
+install_tar gcc-4.0.4 1
+install_tar grep-2.4 0
+install_tar help2man-1.36.4 0
+install_tar libtool-2.2.4 0
+install_tar linux-headers-5.10.41 0
+install_tar m4-1.4.7 0
+install_tar make-3.82 0
+install_tar musl-1.2.2 0
+install_tar perl-5.6.2 0
+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
# Begin sysc bootstrapping process
diff --git a/sysc/run.sh b/sysc/run.sh
@@ -20,7 +20,7 @@ export DISTFILES=/distfiles
create_fhs() {
# Add the rest of the FHS that we will use and is not created pre-boot
rm -rf /sbin /usr/sbin
- ln -s bin /usr/sbin
+ ln -s bin /usr/sbin # Hack to fix xbps (alternatively need to install which)
for d in bin lib sbin; do
ln -s "usr/${d}" "/${d}"
done