Loads extension list, "load.grp" in tce dir when "base" boot option is used.
Changes /opt/tce.dir path from /tmp to tce dir. (edit TCEPATH & sed )
Place script in /opt/bootlocal.sh to automatically load list when base option is used.
note: a script to add/remove the "base" option in /menu.list makes this all very fast
EDIT: I replaced this approach with symlinked groups documented later in this thread.
#!/bin/ash
###### load-grp script, jpeters
#
#### Loads extension group "load.grp" in tce dir.
#
#
### Edit path to default tce directory
TCEPATH="/mnt/hda1/tcZ2"
#### Change path to tce dir when loading BASE option
TCEDIR="$(cat /opt/.tce_dir)"
if [ $TCEDIR == "/tmp/tce/" ]; then
if [ -f ${TCEPATH}/load.grp ]; then
sed -i 's@/tmp/tce@/mnt/hda1/tcZ2@' /opt/.tce_dir
TCEDIR="$(cat /opt/.tce_dir)"
fi
cd ${TCEDIR}
######### Load default extensions
if [ -f load.grp ]; then
FILES="$(cat ./load.grp)"
echo "installing load.grp extensions.........."
for I in ${FILES}
do
tce-load -i ${I}
done
fi
fi
exit 0
"load" script for additional extensions as needed from tce dir. eg, "load gnumeric"
#!/bin/ash
TCEDIR="$(cat /opt/.tce_dir)"
cd ${TCEDIR}
if [ ! -f ${1}*.tcz -a ! -f ${1}*.tczl -a ! -f ${1}*.tczm ] ; then
echo "extention not present"
exit 1
fi
FILE="$(find ${1}* | busybox grep -v .dep | busybox grep -v .txt | busybox grep -v .list )"
[ -n ${FILE} ] && tce-load -i ${FILE}
echo "done!"
exit 0
Sample "base" script for adding/removing bootoption. (edit path and sed search words to suit).
#!/bin/ash
### Adds/Removes "base" bootoption
MENUPATH=/mnt/hda1/boot/grub
cd ${MENUPATH}
#### Show Bootoptions
echo "bootoptions: "
busybox grep -e "showapps" menu.lst
#### Prompt to add/remove "base"
echo ""
echo "Add/Remove 'base' (a/r)"
read RESPONSE
case ${RESPONSE} in
"a" ) sudo sed -i 's/showapps/showapps base/' ./menu.lst ;;
"r" ) sudo sed -i 's/showapps base/showapps/' ./menu.lst ;;
esac
exit 0