[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#709017: /e/n/i getting overwritten after late_command of preseed



Hello,

I've came across with the same problem and I think that the attached
patch could do the job to fix this weird scenario. It looks if file
already exists and only overwrites it "in-target" if it doesn't.

Since '/e/n/i' is already written by 'debian-installer' itself in
previous steps, I think it makes no sense to overwrite it again when
installation is almost complete.

It doesn't make sense neither if the file already exists for any
reason (in e.g.: you create it in any other installation step like the
case mentioned in 'debian-users' list [1]), so the only case I think
it makes sense to set the '/e/n/i' file at that installation stage is
if there isn't one already.

Hope it helps.

[1] https://lists.debian.org/debian-user/2013/05/msg01012.html
diff --git a/finish-install.d/55netcfg-copy-config b/finish-install.d/55netcfg-copy-config
index c1d2906..23ed968 100755
--- a/finish-install.d/55netcfg-copy-config
+++ b/finish-install.d/55netcfg-copy-config
@@ -69,6 +69,9 @@ fi
 # be done if the /e/n/i option is chosen, since /e/n/i gets copied in any
 # situation.
 mkdir -p /target$(dirname $FILE_INTERFACES)
-cp $FILE_INTERFACES /target$FILE_INTERFACES
+if [ ! -e /target$FILE_INTERFACES ]
+then
+	cp $FILE_INTERFACES /target$FILE_INTERFACES
+fi
 
 exit 0

Reply to: