diff --git a/steps/improve/clean_ram.sh b/steps/improve/clean_ram.sh deleted file mode 100755 index 0f3f420..0000000 --- a/steps/improve/clean_ram.sh +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: 2023 fosslinux -# -# SPDX-License-Identifier: GPL-3.0-or-later - -# Save because linux deletes all distfiles to save space -cp "${DISTFILES}"/musl-1.2.4.tar.gz /tmp -cp "${DISTFILES}"/curl-7.88.1.tar.bz2 /tmp - -# Clear up some RAM space -grep --no-filename '^build' "${SOURCES}"/run*.sh | grep -v musl-1.2.4 | sed "s/build //" | sed "s/ .*$//" | while read -r p ; do - rm -rf "${SOURCES:?}/${p:?}" -done - -mv /tmp/musl-1.2.4.tar.gz "${DISTFILES}" -mv /tmp/curl-7.88.1.tar.bz2 "${DISTFILES}" diff --git a/steps/improve/clean_sources.sh b/steps/improve/clean_sources.sh new file mode 100755 index 0000000..c8a8f7a --- /dev/null +++ b/steps/improve/clean_sources.sh @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Delete sources of packages before linux kernel + +get_source_filename() { + local url="${1}" + local fname="${3}" + # Default to basename of url if not given + echo "${fname:-$(basename "${url}")}" +} + +# List all packages from linux kernel onwards +# Ideally, we would use arrays here, but they are not supported by +# the bash version we have at this point. +pkgs="$(awk '/^build:/ { print $2 }' "${SRCDIR}/manifest" | awk '/^linux-[0-9]/,EOF { print $0 }')" + +# Gather source names for all packages in pkgs, which we want to keep +keep_sources="" +for pkg in ${pkgs}; do + while read line; do + keep_sources="${keep_sources} $(get_source_filename ${line})" + done < "${SRCDIR}/${pkg}/sources" +done + +for source in "${DISTFILES}/"*; do + source_name="$(basename "${source}")" + for keep_source in ${keep_sources}; do + if [ "${keep_source}" = "${source_name}" ]; then + # Countinue the outer loop to skip deletion + continue 2 + fi + done + + # Delete this source + rm "${source}" +done + +unset get_source_filename +unset pkgs pkg line +unset keep_sources keep_source +unset source source_name diff --git a/steps/improve/update_checksums.sh b/steps/improve/update_checksums.sh new file mode 100755 index 0000000..0c4f61b --- /dev/null +++ b/steps/improve/update_checksums.sh @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz +# +# SPDX-License-Identifier: GPL-3.0-or-later + +pushd /external/repo +sha256sum -- * | tee "${SRCDIR}/SHA256SUMS.pkgs" +popd diff --git a/steps/linux-4.9.10/pass1.sh b/steps/linux-4.9.10/pass1.sh index c6d10d6..0b9a1fe 100644 --- a/steps/linux-4.9.10/pass1.sh +++ b/steps/linux-4.9.10/pass1.sh @@ -6,14 +6,6 @@ # XXX: Fix package after builder-hex0 src_unpack() { - # Remove all previous source tarballs - mkdir /tmp/keep - for keep in deblob-4.9 ${pkg}.tar.gz musl-1.2.4.tar.gz curl-7.88.1.tar.bz2; do - mv "${DISTFILES}/${keep}" /tmp/keep - done - rm -r "${DISTFILES}/"* - mv /tmp/keep/* "${DISTFILES}" - mkdir "${pkg}" mv "${DISTFILES}/deblob-4.9" "${pkg}/" default || true # Predictable link errors - not a problem diff --git a/steps/manifest b/steps/manifest index b5aed41..b84e273 100644 --- a/steps/manifest +++ b/steps/manifest @@ -114,6 +114,7 @@ build: bc-1.07.1 define: BUILD_LINUX = ( CHROOT == False || BUILD_KERNELS == True ) build: kexec-linux-1.0.0 ( BUILD_LINUX == True ) build: kexec-tools-2.0.22 ( BUILD_LINUX == True ) +improve: clean_sources build: linux-4.9.10 ( BUILD_LINUX == True ) jump: break ( INTERNAL_CI == pass1 ) jump: linux ( CHROOT == False ) @@ -180,3 +181,4 @@ build: gcc-10.4.0 build: binutils-2.41 build: gcc-13.1.0 improve: null_time ( FORCE_TIMESTAMPS == True ) +improve: update_checksums ( UPDATE_CHECKSUMS == True )