Mount_all3: bash script automounts drives at startup

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#16 Post by abushcrafter »

Your fix works :D. To apply this for remasters/installs (.E.G. USB Flash Drive install.) where you want it to work on whatever setup it is plugged into. Do this (Though I have not tested it.):

The drive icons scripts in "/root/.pup_event" are all the same. The difference is the parameters they are given when they are run. The source script they are copied from is "/usr/local/bin/drive_all". So apply the fix to that one. If you are doing this on the system you are booted in. You will need to regenerate your drive icons. By a reboot maybe? Or deleting the contents of "/root/.pup_event" then restarting X?
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#17 Post by esmourguit »

Bonjour à tous,

I think I did not know how to apply the change in the script because I have not had the desired result.
My "home" partition is sda2.

Cordialement ;)
Attachments
home.jpg
(77.72 KiB) Downloaded 404 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#18 Post by big_bass »

esmourguit wrote:Bonjour à tous,

I think I did not know how to apply the change in the script because I have not had the desired result.
My "home" partition is sda2.

Cordialement ;)
Hey esmourguit




run this in a terminal
tar gzip the file drive_all then move it to root

Code: Select all

tar -czf /usr/local/bin/drive_all.tar.gz  /usr/local/bin/drive_all
mv /usr/local/bin/drive_all.tar.gz /root
attach your file to the forum
I will patch it and send it back
then please let me know if it works or not correctly

*I made some more improvements since the first patch

thanks for the feedback
Joe
-------------------what was changed ---------------------------------

Code: Select all

--- /usr/local/bin/drive_all	2008-10-20 07:12:48.000000000 +0800
+++ /mnt/hda4/drive_all	2010-10-05 07:49:56.000000000 +0800
@@ -11,6 +11,11 @@
 #v403 icon menu, can call with 'unmount', 'eventmanager' and 'pmount_<DRV_CATEGORY>' params.
 #v411 added 'quiet' option for vfat, suppresses error msg when file attribs not preserved on copy.
 
+
+##big_bass  add filtering for /initrd/mnt/dev_ro2 and /initrd/mnt/dev_save
+#when this drive is also mounted on /mnt/   to remove multiple rox windows opening 
+
+
 FSTYPE=""
 [ $2 ] && FSTYPE="$2" #see pup_eventd
 
@@ -183,9 +188,28 @@ if [ "$FSTYPE" != "" ];then
    [ "`readlink /mnt/home`" = "$MNTPT" ] && MNTPT="/mnt/home"
   fi
   #exec rox -x /mnt/$ONEDRVNAME -d /mnt/$ONEDRVNAME
+  
+  #big_bass  add filtering for /initrd/mnt/dev_ro2 and /initrd/mnt/dev_save
+  #when this drive is also mounted on /mnt/   to remove multiple rox windows opening 
+  mount | grep "/initrd/mnt/dev_ro2" && mount | grep "/mnt/$ONEDRVNAME"
+  if [[ "$?" == 0 ]];then
+  echo "mounted on more than one place open only one rox folder"
+  exec rox -d /initrd/mnt/dev_ro2
+  fi
+  
+  mount | grep "/initrd/mnt/dev_save" && mount | grep "/mnt/$ONEDRVNAME"
+  if [[ "$?" == 0 ]];then
+  echo "mounted on more than one place open only one rox folder"
+  exec rox -d /initrd/mnt/dev_save
+  
+  else
   exec rox -x $MNTPT -d $MNTPT
+  fi
  fi
 fi
+ 
+
+
 
 
 #NOTE: if pmount already running, don't really want to kill then restart,

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#19 Post by esmourguit »

Bonjour à tous,
Thank you for your help.
Here is the mount_all3 file.
Cordialement ;)
Attachments
mount_all3.tar.gz
(1.87 KiB) Downloaded 345 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#20 Post by big_bass »

run this in a terminal
tar gzip the file drive_all then move it to root

Code: Select all

tar -czf /usr/local/bin/drive_all.tar.gz  /usr/local/bin/drive_all
mv /usr/local/bin/drive_all.tar.gz /root
attach your file to the forum
I will patch it and send it back


you sent me the mount_all3 that doesnt need the patch

the file that needs patching is called drive_all
it is also the AppRun thats where the trouble is

Thanks

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#21 Post by esmourguit »

Bonjour à tous,
Sorry, I misread the file name to send you, here it is.
Thank you.
Cordialement ;)
Attachments
drive_all.tar.gz
(3.76 KiB) Downloaded 329 times
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#22 Post by big_bass »

Hey esmourguit

Its very good that you attached the file your file was translated to french so the line numbers are different and there were also edits to the file since it is a different version than mine

please let me know if it corrected the problem




you will also need to make a copy of this fixed drive_all and call it AppRun
and place /root/.pup_event/drive_sda2/AppRun

/root/.pup_event/drive_sda2/AppRun
to test with

*the AppRun is for each drive the drive_all is the master file that gets copied
the first time the drive icon is clicked

thanks
Joe
Attachments
drive_all-fixed-french.tar.gz
(3.91 KiB) Downloaded 352 times

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#23 Post by esmourguit »

Bonjour à tous,

@ big_bass
Thank you, it works perfectly.

Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#24 Post by big_bass »

Hey esmourguit

Thanks for being patient
and testing.

great to hear its working now.

*It must have taken you a very long time to translate everything into French
that's dedication.


Joe

User avatar
esmourguit
Posts: 1410
Joined: Fri 17 Nov 2006, 14:45
Location: Entre l'ile aux oiseaux.et l'ile de sainte Lucie

#25 Post by esmourguit »

Bonjour à tous,

Yes, it takes me a long time. In the begining, for Puppy 2.12 until Puppy 2.14, I was all alone, but one then two people came later to join me occasionally.
I found Puppy so exceptional that I wanted my compatriots, who are not good with foreign languages, discover and then use it more easily.

Cordialement ;)
[url=http://moulinier.net/][color=blue][b]Toutou Linux[/b][/color][/url] - [url=http://toutoulinux.free.fr/pet.php][color=blue][b]Paquets français[/b][/color][/url]

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#26 Post by abushcrafter »

A little fix I put to together.

Code: Select all

#*************************************************************************
fdisk -l | grep Linux | egrep -v "swap" | cut -f 1 -d ' '| sed 's/\/dev\///'>/tmp/Linux_LIST
  if [ "$?" == "0" ]; then

      echo "Linux_LIST written to /tmp/Linux_LIST"

        Linux_LIST=$(</tmp/Linux_LIST)

        #Code to produce home drive.
        #Most of code is from the script: "/etc/rc.d/functions4puppy4".
        imPATTERN='^/dev/'"${1}"
        homedirve=`df | tr -s ' ' | cut -f 1,6 -d ' ' | grep "$imPATTERN" | grep -e ' /initrd/' | grep -v '/dev/loop*' | cut -f 1 -d ' '| sed 's/\/dev\///'`
        #Removes the home drive from the Linux drives list.
        #This means that the home drive desktop icon has the correct icon.
        #I think should also fix the bug: "When home drive icon is clicked on. It gave me three Rox-Filer windows.".
        cat /tmp/Linux_LIST | grep -v "$homedirve" > /tmp/Linux_LIST

        for Linux_drive in  `cat /tmp/Linux_LIST` ; do
            mkdir -p /mnt/$Linux_drive
            mount  /dev/$Linux_drive /mnt/$Linux_drive
            cat /tmp/Linux_LIST >>/tmp/list_of_drives   
        done
   fi # bypass the mounting if no Linux drive found
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

big_bass
Posts: 1740
Joined: Mon 13 Aug 2007, 12:21

#27 Post by big_bass »

abushcrafter

thanks for posting the code thats another way to go about removing the home directory

I just mount it on /mnt with the folder on the desktop
it can be safely unmounted because its at another mount point than the home directory

maybe later some different configure options could be passed to
allow for different preferences

maybe different icons or locations of icons too something like the
drive icon manager

Joe

Post Reply