From 3e0af4db16fdd159440454a2062d9189a4f92ee7 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Wed, 12 Nov 2003 14:46:10 +0000 Subject: be sure remaining /etc files are at least available RO --- move/Makefile | 3 ++- move/move.pm | 10 +++++++++- 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); -- cgit v1.2.1