summaryrefslogtreecommitdiffstats
path: root/move
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-12 14:46:10 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-12 14:46:10 +0000
commit3e0af4db16fdd159440454a2062d9189a4f92ee7 (patch)
treeb6bbeb54affd72e8b2df494cb6f134c44fcdb602 /move
parentde6ee233646a288be26ffb16af219724db8c138f (diff)
downloaddrakx-backup-do-not-use-3e0af4db16fdd159440454a2062d9189a4f92ee7.tar
drakx-backup-do-not-use-3e0af4db16fdd159440454a2062d9189a4f92ee7.tar.gz
drakx-backup-do-not-use-3e0af4db16fdd159440454a2062d9189a4f92ee7.tar.bz2
drakx-backup-do-not-use-3e0af4db16fdd159440454a2062d9189a4f92ee7.tar.xz
drakx-backup-do-not-use-3e0af4db16fdd159440454a2062d9189a4f92ee7.zip
be sure remaining /etc files are at least available RO
Diffstat (limited to 'move')
-rw-r--r--move/Makefile3
-rw-r--r--move/move.pm10
2 files changed, 11 insertions, 2 deletions
diff --git a/move/Makefile b/move/Makefile
index 43abd4f65..55594ec7f 100644
--- a/move/Makefile
+++ b/move/Makefile
@@ -2,7 +2,7 @@
DEST_LIVETREE = /tmp/live_tree
DEST_STAGE2 = $(DEST_LIVETREE)/usr/bin/stage2
-DATA_FILES = devices symlinks directories-to-create etcfiles
+DATA_FILES = devices symlinks directories-to-create etcfiles all-etcfiles
LANG_FILES = $(shell perl -ne 'print $$1 if /ALLOWED_LANGS = qw\((.*)\)/' move.pm)
STAGE1 = ../mdk-stage1
@@ -23,6 +23,7 @@ all: install
build: xwait
cd $(STAGE1) && ADDITIONAL_DEFS="-DMANDRAKE_MOVE" MOVE=1 make init stage1-network stage1-cdrom init-move
sudo ./collect-directories-to-create.pl $(DEST_LIVETREE) > data/directories-to-create
+ sudo find $(DEST_LIVETREE)/etc -type f | perl -pe 's|$(DEST_LIVETREE)||' > data/all-etcfiles
install: build
#- todo: make_boot_img alike to create boot volume from ../mdk-stage1/stage1-cdrom (isolinux mandatory since stock kernel is so big)
diff --git a/move/move.pm b/move/move.pm
index 9b3cfb288..6ad098323 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -80,7 +80,15 @@ sub init {
#- because programs most often won't try to create the missing subdir before trying
#- to write a file, leading to obscure unexpected failures
-d $_ or mkdir_p $_ foreach chomp_(cat_('/image/move/directories-to-create'));
-
+
+ #- remaining non existent /etc files are symlinked from the RO volume,
+ #- better to have them RO than non existent.
+ #- PB: problems arise when programs try to open then in O_WRONLY
+ #- or O_RDWR -> in that case, they should be handled in the
+ #- OVERWRITE section of data/etcfiles)
+ foreach (chomp_(cat_('/image/move/all-etcfiles'))) {
+ -f or symlinkf_short("/image/$_", $_);
+ }
#- free up stage1 memory
fs::umount($_) foreach qw(/stage1/proc /stage1);