mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: May 20 2005,22:18 |
|
So clivesay got me thinking about yet another possibility, and i had to try it out...
You can presently specify a partition to have a collection of myDSL apps automatically load on boot (mydsl=<partition>), so you can have a variety of DSL configurations using a single liveCD or frugal install. However, the number of variants is currently limited by the number of partitions you have, using the "mydsl=" boot option.
Fortunately, DSL has been configured to save your boot options so that you can use them at any time (sweeeet!). So here's a way to provide numerous mydsl combinations chosen at boot, with only a single partition, or with no partitions by using a rebuilt CD.
By including a special bit of script in /opt/bootlocal.sh, you can specify on the boot line a path to where mydsl applications are stored. For example: mydsldir=hda1/myDSL/xfree Using this boot option, the mydsl apps in /mnt/hda1/myDSL/xfree will be loaded from bootlocal.sh If you want multiple configs using some of the same applications, symlinks put in the subdirectories will work just as well as copies, so you can save some space.
Here's what I put in /opt/bootlocal.sh:
Code Sample | . /etc/init.d/dsl-functions CMDLINE="$(cat /proc/cmdline)"
getmydsl() { for FILE in `ls $1/* 2>/dev/null`; do case $FILE in *.tar.gz) BASE=$(getbasefile "$FILE" 2) if [ "$BASE" != "backup" ]; then echo "${YELLOW}$BASE${NORMAL}" sudo su dsl -c mydsl-load $FILE fi ;; *.dsl|*.uci) BASE=$(getbasefile "$FILE" 1) echo "${YELLOW}$BASE${NORMAL}" sudo su dsl -c mydsl-load $FILE ;; esac done }
MYDSL="$(getbootparam 'mydsldir')" if [ -n "$MYDSL" ]; then DEVICE="${MYDSL%%/*}" MOUNTED=`grep "/dev/$DEVICE" /etc/mtab 2>/dev/null` if [ -n "$MOUNTED" ]; then DIR="/cdrom/${MYDSL#*/}" else DIR="/mnt/$DEVICE/${MYDSL#*/}" mount /dev/$DEVICE &>/dev/null fi if [ -d "$DIR" ]; then getmydsl "$DIR" fi fi
|
It's loosely based on Robert's getmydslapps function in dsl-config
There are some minor issues i need to fix...
It wasn't working with the partition containing KNOPPIX, because it was already mounted. The code i added to address this is sloppy and probably unreliable, but it does seem to work as long as you haven't booted toram and mounted that drive from bootlocal. I'll have to work out a better solution.
It hasn't been tested from a rebuilt iso including the mydsl directories, but i'm thinking it should work the same. Using "mydsldir=cdrom/path/to/files" *should* end up using /cdrom.
This doesn't apply to mydsl apps in /cdrom/optional...you'd still need to use mydsl=whatever to get those.
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|