Get Boot Directory 1.3-2

Miscellaneous tools
Post Reply
Message
Author
R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

Get Boot Directory 1.3-2

#1 Post by R-S-H »

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: 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"
In most of all cases the following line should be used to get the boot directory for the use in a bash script:

Code: Select all

# 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: 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
Please, do note the '&' and command 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
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
Attachments
get_boot_dir.gz
(5.65 KiB) Downloaded 263 times
Last edited by R-S-H on Sun 28 Apr 2013, 14:13, edited 1 time in total.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

Re: Get Boot Directory 1.3-2

#2 Post by ASRI éducation »

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 !
:D

Post Reply