Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 23 Oct 2014, 10:09
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Mount_all3: bash script automounts drives at startup
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [27 Posts]   Goto page: Previous 1, 2
Author Message
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Thu 04 Nov 2010, 13:57    Post subject:  

Your fix works Very Happy. 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?

_________________
adobe flash is rubbish!
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/
Back to top
View user's profile Send private message Visit poster's website 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Fri 05 Nov 2010, 03:51    Post subject:  

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 Wink
home.jpg
Description 
jpg

 Download 
Filename  home.jpg 
Filesize  77.72 KB 
Downloaded  273 Time(s) 

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Fri 05 Nov 2010, 10:22    Post subject:  

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 Wink


Hey esmourguit




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

Code:
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:

--- /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,

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Fri 05 Nov 2010, 13:48    Post subject:  

Bonjour à tous,
Thank you for your help.
Here is the mount_all3 file.
Cordialement Wink
mount_all3.tar.gz
Description 
gz

 Download 
Filename  mount_all3.tar.gz 
Filesize  1.87 KB 
Downloaded  231 Time(s) 

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Fri 05 Nov 2010, 20:45    Post subject:  

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

Code:

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

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Sat 06 Nov 2010, 01:09    Post subject:  

Bonjour à tous,
Sorry, I misread the file name to send you, here it is.
Thank you.
Cordialement Wink
drive_all.tar.gz
Description 
gz

 Download 
Filename  drive_all.tar.gz 
Filesize  3.76 KB 
Downloaded  238 Time(s) 

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Sat 06 Nov 2010, 10:47    Post subject:  

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
drive_all-fixed-french.tar.gz
Description 
gz

 Download 
Filename  drive_all-fixed-french.tar.gz 
Filesize  3.91 KB 
Downloaded  244 Time(s) 

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Mon 08 Nov 2010, 03:37    Post subject:  

Bonjour à tous,

@ big_bass
Thank you, it works perfectly.

Cordialement Wink

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Mon 08 Nov 2010, 10:54    Post subject:  

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

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Tue 09 Nov 2010, 04:42    Post subject:  

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 Wink

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Tue 09 Nov 2010, 08:14    Post subject:  

A little fix I put to together.
Code:

#*************************************************************************
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

_________________
adobe flash is rubbish!
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/
Back to top
View user's profile Send private message Visit poster's website 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Thu 11 Nov 2010, 14:34    Post subject:  

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

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [27 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

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.1136s ][ Queries: 12 (0.0396s) ][ GZIP on ]