From 2e9769e8b0daf35f6403acffbaa4e9fec2ab2532 Mon Sep 17 00:00:00 2001 From: David Cassany Date: Tue, 8 Nov 2016 12:23:35 +0100 Subject: [PATCH] ActivateImage links correction Loading the iso image into a read-only ramdisk caused some issues due to the activatImage method cp commands. With this commit the symlinks are consistent during the preinit phase and also before running the cp command it is tested we are not in a read-only filesystem. This commit is a port form openSUSE/kiwi#613 PR --- kiwi/boot/functions.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kiwi/boot/functions.sh b/kiwi/boot/functions.sh index ae9d3cf8..917d3bb6 100644 --- a/kiwi/boot/functions.sh +++ b/kiwi/boot/functions.sh @@ -6290,6 +6290,7 @@ function activateImage { local cdDir=/livecd if [ -d $cdDir ];then mkdir -p $prefix/$cdDir && mount --move /$cdDir $prefix/$cdDir + rm -r $cdDir && ln -s $prefix/$cdDir $cdDir if [ -d /cow ];then mkdir -p $prefix/cow && mount --move /cow $prefix/cow fi @@ -6340,15 +6341,19 @@ function activateImage { if [ ! -e $prefix/$killall5 ]; then touch $prefix/killall5.from-initrd fi - if ! cp -f -a $killall5 $prefix/$killall5;then - systemException "Failed to copy: killall5" "reboot" + if touch $(dirname $prefix/$killall5); then + if ! cp -f -a $killall5 $prefix/$killall5; then + systemException "Failed to copy: killall5" "reboot" + fi fi local pidof=$(lookup pidof) if [ ! -e $prefix/$pidof ];then touch $prefix/pidof.from-initrd fi - if ! cp -f -a $pidof $prefix/$pidof;then - systemException "Failed to copy: pidof" "reboot" + if touch $(dirname $prefix/$pidof); then + if ! cp -f -a $pidof $prefix/$pidof;then + systemException "Failed to copy: pidof" "reboot" + fi fi } #======================================