rootcopy vss from_iso
Posted: 16 Mar 2011, 12:36
when using the from_iso cheatcode, i.e. booting from a ISO file on usb,
it's impossible to put files inside the ISO for copying onto the root filesystem.
I would like to use the following layout on my removable media:
would it be possible to support this in the default linuxrc ?
I think this small patch implements this, in a compatible way with the existing code.
it's impossible to put files inside the ISO for copying onto the root filesystem.
I would like to use the following layout on my removable media:
Code: Select all
\boot\grub\grub.cfg
\porteus\initrd.xz
\porteus\vmlinuz
\porteus\porteus-1.0-XXX.iso
\porteus\rootcopy\root\.bashrc
I think this small patch implements this, in a compatible way with the existing code.
Code: Select all
--- linuxrc-orig 2011-03-16 11:24:30.000000000 +0100
+++ linuxrc 2011-03-16 11:25:40.000000000 +0100
@@ -309,8 +309,18 @@
done
fi
-echo $i"copying content of rootcopy directory"
-cp -af $PTH/rootcopy/* /union 2>/dev/null
+ROOT_PTH=$PTH/rootcopy
+if [ -n "$ISO" -a -n "$ISODEV" -a -n "$ISOPTH" ]; then
+ ISODIR=`echo $ISOPTH | sed 's:/[^/]*$::'`
+ if [ -d /opt/$ISODEV/$ISODIR/rootcopy ]; then
+ ROOT_PTH=/opt/$ISODEV/$ISODIR/rootcopy
+ fi
+fi
+if [ -d $ROOT_PTH ]; then
+ echo $i"copying content of rootcopy directory"
+ cp -af $ROOT_PTH/* /union 2>/dev/null
+fi
+
mount -n -o rbind /mnt/$DATA/boot /union/boot 2>/dev/null
debug