aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2021-03-27 00:39:06 +0100
committerThomas Deutschmann <whissi@gentoo.org>2021-03-27 00:39:06 +0100
commit61049d2954dcf04bd2a2f38ac398fc406e45695f (patch)
tree99c86147c65a75b92fc09d647bc02bde720fc308
parentgen_initramfs.sh: append_zfs(): Copy /etc/zfs/vdev_id.conf (diff)
downloadgenkernel-61049d2954dcf04bd2a2f38ac398fc406e45695f.tar.gz
genkernel-61049d2954dcf04bd2a2f38ac398fc406e45695f.tar.bz2
genkernel-61049d2954dcf04bd2a2f38ac398fc406e45695f.zip
gen_compile.sh: populate_binpkg(): Throw away binpkg when glibc has changed
It was reported that dropbear in genkernel initramfs crashed when client tried to connect. The problem is, that while we are compiling statically, we still depend on used glibc version. I.e. dropbear binpkg was created against glibc version A, but when genkernel initramfs will be created, we will copy system libraries from whatever glibc version host is currently using which doesn't necessarily need to match used glibc version when binpkg was created which could result in reported problem. This commit will make genkernel treat binpkg as stale when glibc was changed since binpkg was created to force a rebuild. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_compile.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/gen_compile.sh b/gen_compile.sh
index d755150..e2b86cc 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -510,6 +510,23 @@ populate_binpkg() {
unset patch patchdir
fi
+ if [[ -f "${BINPKG}" ]]
+ then
+ if isTrue "$(is_glibc)"
+ then
+ local libdir=$(get_chost_libdir)
+ local glibc_test_file="${libdir}/libnss_files.so"
+
+ if [[ "${BINPKG}" -ot "${glibc_test_file}" ]]
+ then
+ print_info 3 "${CHECK_LEVEL_PREFIX}Glibc (${glibc_test_file}) is newer than us; Removing stale ${P} binpkg ..."
+ rm "${BINPKG}" || gen_die "Failed to remove stale binpkg '${BINPKG}'!"
+ fi
+
+ print_info 3 "${CHECK_LEVEL_PREFIX}Existing ${P} binpkg is newer than glibc (${glibc_test_file}); Skipping ..."
+ fi
+ fi
+
if [[ ! -f "${BINPKG}" ]]
then
print_info 3 "${CHECK_LEVEL_PREFIX}Binpkg '${BINPKG}' does NOT exist; Need to build ${P} ..."