From 7982442e32330866ea0394ab453327f1af713649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 16 May 2018 16:37:29 +0200 Subject: [PATCH 1/2] Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a dangling symlink. --- debian/changelog | 7 +++++++ live-build/auto/build | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 817e0429..96ab4363 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.526) UNRELEASED; urgency=medium + + * Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a + dangling symlink. + + -- Ɓukasz 'sil2100' Zemczak Wed, 16 May 2018 16:20:31 +0200 + livecd-rootfs (2.525) bionic; urgency=medium * Don't fail to build CPC images if /lib/modules already exists in the diff --git a/live-build/auto/build b/live-build/auto/build index 01dcc182..d341a62b 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -796,13 +796,13 @@ done NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then # only one kernel flavour - if [ -e "binary/$INITFS/vmlinuz" ]; then + if [ -e "binary/$INITFS/vmlinuz" -a ! -h "binary/$INITFS/vmlinuz" ]; then ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" chmod 644 "$PREFIX.kernel" else ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" fi - if [ -e "binary/$INITFS/initrd.lz" ]; then + if [ -e "binary/$INITFS/initrd.lz" -a ! -h "binary/$INITFS/initrd.lz" ]; then ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" chmod 644 "$PREFIX.initrd" else From a274206e1af72097dcbb318125cf9b757edd5555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 31 Oct 2018 11:17:01 +0100 Subject: [PATCH 2/2] Don't overcomplicate bash conditionals. --- live-build/auto/build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/live-build/auto/build b/live-build/auto/build index 2e9a4259..ba06b072 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -849,13 +849,13 @@ done NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then # only one kernel flavour - if [ -e "binary/$INITFS/vmlinuz" -a ! -h "binary/$INITFS/vmlinuz" ]; then + if [ -f "binary/$INITFS/vmlinuz" ]; then ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" chmod 644 "$PREFIX.kernel" else ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" fi - if [ -e "binary/$INITFS/initrd.lz" -a ! -h "binary/$INITFS/initrd.lz" ]; then + if [ -f "binary/$INITFS/initrd.lz" ]; then ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" chmod 644 "$PREFIX.initrd" else