The time now is Wed 19 Jun 2013, 15:48
All times are UTC - 4 |
| Author |
Message |
R-S-H
Joined: 18 Feb 2013 Posts: 367
|
Posted: Sun 28 Apr 2013, 09:47 Post subject:
Get Boot Directory 1.3-2 Subject description: A useful script to get the boot directory of a puppy (for the use in bash) |
|
Hi.
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: | 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" |
In most of all cases the following line should be used to get the boot directory for the use in a bash script:
| Code: | # Bootdirectory
. /usr/sbin/ceelab/lp2_sys_data/LP2_BootDir |
After including the file LP2_BootDir this way into a bash script the boot directory (or partition if boot directory is root directory of a partition) is stored in $LP2BDL
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: | 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 |
Please, do note the '&' and command sleep 1 !!!
I have put this right after the following code section:
| Code: | #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 |
I hope this will be useful for any other developers and/or programmers to make the life of the users of them puppies a bit easier.
RSH
| Description |
|

Download |
| Filename |
get_boot_dir.gz |
| Filesize |
5.65 KB |
| Downloaded |
29 Time(s) |
_________________ Freiheit für Mollath - JETZT !!!
Free Mr. Mollath !!!
Send the People responsible to The Hague International Court for trial !!!
Last edited by R-S-H on Sun 28 Apr 2013, 10:13; edited 1 time in total
|
|
Back to top
|
|
 |
ASRI éducation

Joined: 09 May 2009 Posts: 1516 Location: France
|
Posted: Sun 28 Apr 2013, 10:04 Post subject:
Re: Get Boot Directory 1.3-2 Subject description: A useful script to get the boot directory of a puppy (for the use in bash) |
|
| R-S-H wrote: | | I hope this will be useful for any other developers and/or programmers to make the life of the users of them puppies a bit easier. |
Thank you RSH !
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0447s ][ Queries: 12 (0.0029s) ][ GZIP on ] |