Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deleting sources that will be needed in future builds and fix updating checksums with --update-checksums #360

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions steps/improve/clean_ram.sh

This file was deleted.

43 changes: 43 additions & 0 deletions steps/improve/clean_sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz <[email protected]>
#
# 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
7 changes: 7 additions & 0 deletions steps/improve/update_checksums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2023 Eduardo Sánchez Muñoz <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later

pushd /external/repo
sha256sum -- * | tee "${SRCDIR}/SHA256SUMS.pkgs"
popd
8 changes: 0 additions & 8 deletions steps/linux-4.9.10/pass1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions steps/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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 )