Code Sample |
#!/bin/sh # Original author: cbagger01 from the Damn Small Linux forum # # 04/09/04 modified for use in DSL by RobertS # # changed to use ext2 hdpartition instead of ramdisk # /cdrom is the ext2 partion i boot from WRITEABLE_DIR=/cdrom/writeable if [ -f /etc/sysconfig/writeable ]; then exit fi INSTALLED="" [ -e /KNOPPIX/bin/ash ] || INSTALLED="yes" if [ -z "$INSTALLED" ]; then rm -rf $WRITEABLE_DIR mkdir $WRITEABLE_DIR cp -srd /KNOPPIX/usr/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/usr/X11R6/lib/X11 $WRITEABLE_DIR/usr/lib/ ln -sf $WRITEABLE_DIR/usr / cp -srd /KNOPPIX/bin/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/bin / cp -srd /KNOPPIX/boot/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/boot / cp -srd /KNOPPIX/lib/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/lib / cp -srd /KNOPPIX/sbin/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/sbin / # rm -rf /ramdisk/var/cache/apt # cp -srd /KNOPPIX/var/cache/apt/ /ramdisk/var/cache # rm -rf /ramdisk/var/cache/apt/archives/lock # cp /KNOPPIX/var/cache/apt/archives/lock /ramdisk/var/cache/apt/archives # rm -rf /ramdisk/var/lib/apt # cp -srd /KNOPPIX/var/lib/apt/ /ramdisk/var/lib rm -f /var/lib/dpkg cp -dpR /ramdisk/var/ $WRITEABLE_DIR ln -sf $WRITEABLE_DIR/var / # mkdir $WRITEABLE_DIR/var # mkdir $WRITEABLE_DIR/ # mkdir $WRITEABLE_DIR/var/lib rm -rf $WRITEABLE_DIR/var/cache/apt cp -srd /KNOPPIX/var/cache/apt/ $WRITEABLE_DIR/var/cache rm -rf $WRITEABLE_DIR/var/cache/apt/archives/lock cp /KNOPPIX/var/cache/apt/archives/lock $WRITEABLE_DIR/var/cache/apt/archives rm -rf $WRITEABLE_DIR/var/lib/apt cp -srd /KNOPPIX/var/lib/apt/ $WRITEABLE_DIR/var/lib rm -f /var/lib/dpkg touch /etc/sysconfig/writeable fi |
Code Sample |
echo "mkwriteable ..." /opt/mkwriteable |
Quote |
What about once the files are copied? Can I remove the cp lines and just link the directories next time I boot? |