This script creates a text file which contains the boot directory of a puppy linux in several forms for the use in a bash script.
I do use this in LazY Puppy to be able to download the SFS files automatically into the LazY Puppy boot directory - no matter if it is /mnt/sda1 or /mnt/sdb2/LazY or /mnt/home or whatever directory and/or partition is used.
This is how the output file looks like:
Code: Select all
LazY_Puppy_Boot_Partition_Link="/mnt/sdd1"
LazY_Puppy_Boot_Partition="/mnt/sdd1"
LazY_Puppy_Boot_Dir_Link="/mnt/sdd1/LazY"
LazY_Puppy_Boot_Dir="/mnt/sdd1/LazY"
LP2BPL="/mnt/sdd1"
LP2BP="/mnt/sdd1"
LP2BDL="/mnt/sdd1/LazY"
LP2BD="/mnt/sdd1/LazY"
LP2MNT="+mnt+sdd1+LazY"
LP2MNTDIR="+mnt+sdd1+LazY"
LP2MNTPRTLNK="+mnt+sdd1"
LP2MNTPRT="+mnt+sdd1"
Code: Select all
# Bootdirectory
. /usr/sbin/ceelab/lp2_sys_data/LP2_BootDir
I do use this not just for the automated downloads of the LazY Puppy SFS files, but also it is used in LazY-FReD, LazY-MAID, SFS-P.L.U.S. and there might be some more (which doesn't come to mind at the moment). So, everyone who's using any of my applications should do a serach for the file get_boot_dir and also for the file getbootdir (might be named like this in some cases).
At the time I'm unable to edit my previous RSH posts so I can not update all those applications with the new get:boot_dir script by myself. That's why I did decide to publish this updated version of the get_boot_dir scritpt separately. This updated version will now also work in MacPup 5.2.9!
The attached file is a fake .gz --> remove the .gz and make executable.
Usually it will be fine if this script is called once at bootup from /root/Startup. In my special case I do Jobs in /root/Startup which makes it necessary to have this script executed before executing the scripts in /root/Startup. So, I do execute this from within the script xwin:
Code: Select all
echo -e "Getting $DISTRO_NAME Boot Directory..."
#echo -e "Ermittle $DISTRO_NAME Startverzeichnis..."
exec /usr/sbin/ceelab/tools/get_boot_dir & 2>/dev/null
sleep 1
I have put this right after the following code section:
Code: Select all
#v408 k2.6.25.16 has serial driver as a module...
[ "`grep 'ttyS' /etc/mousedevice`" != "" ] && modprobe sermouse > /dev/null 2>&1
#v411 precaution...
[ "`grep 'input/mice' /etc/mousedevice`" != "" ] && modprobe usbhid >/dev/null 2>&1
#ask about scrollwheel... DO NOT ASK, ASSUME YES...
if [ ! -f /etc/mousebuttons ];then
#dialog --yesno "Do you have a wheel/scroll type of mouse?" 0 0
#if [ $? -eq 0 ];then
echo -n "5" > /etc/mousebuttons
#echo -e "The file /etc/mousebuttons has been created, with content \"5\"."
echo -e "Die Datei /etc/mousebuttons wurde mit dem Inhalt: \"5\" erstellt."
if [ -f /etc/X11/xorg.conf ];then
cat /etc/X11/xorg.conf | tr -s '#' | sed -e 's/#Option\W\+"ZAxisMapping"\W\+"4 5"/Option "ZAxisMapping" "4 5"/g' > /tmp/xorg.conf.tmp
sync
cp -f /tmp/xorg.conf.tmp /etc/X11/xorg.conf
fi
#else
# echo -n "3" > /etc/mousebuttons
# echo -e "...you chose \"no\"."
# echo -e "The file /etc/mousebuttons has been created, with content \"3\"."
# if [ -f /etc/X11/xorg.conf ];then
# cat /etc/X11/xorg.conf | sed -e 's/Option\W\+"ZAxisMapping"\W\+"4 5"/#Option "ZAxisMapping" "4 5"/g' | tr -s '#' > /tmp/xorg.conf.tmp
# sync
# cp -f /tmp/xorg.conf.tmp /etc/X11/xorg.conf
# fi
#fi
fi
RSH