multiple storage folder for extensions


Forum: DSL Ideas and Suggestions
Topic: multiple storage folder for extensions
started by: ypx

Posted by ypx on Sep. 02 2004,09:34
hello,
with the number of extensions growing at a fast pace, it's more and more difficult to find our way to the one needed in the fluxbox menu, or in the MyDSL click and Load app.

So i came up with the idea to store the extension in subfolders inside the optional one... but these are only recognised by emelfm.
I think that an implementation in the fluxbox menu and in the MyDSL app of such a way to manage extension should be a great addition to this already very good distro.

Thinking about it, if such an upgrade should come to life, the subfolders may be named after the existing fluxbox menu entries,  and the extensions, once loaded, should appear in these ones instead of the mydsl entry (which should imho be used only to load and unload extension)

Another idea would be to extend the capabilities of the mydsl boot parameter to include folders to be automaticaly loaded. This way, one could setup specialized environnement just by placing extensions in the right folders (eg. a game folder, a work one, an internet one, etc...)

As a linux complete newbie, however, i'm unable to do it by myself, that's why i suggest.

Thanks for all the great work allready done... and to come.

Posted by ripcrd6 on Sep. 03 2004,04:24
I was thinking the same thing the other day.  At least a way to sort them and still have the folders scanned at boot time to appear in the mydsl menu.
themes folder
games
ham_radio
tools
net

Posted by henk1955 on Sep. 03 2004,08:25
i think it is possible to add a MYDS_DIR= bootoption. (like KNOPPIX_DIR="

then you need a patch to /etc/init.d/dsl-config like:

Code Sample

echo -n "${BLUE}Checking for myDSL apps... ${NORMAL}"
  if checkbootparam "mydsl"; then
     CKMYDSL="yes"
  fi

>>   MYDSL_DIR=""
>>   MYDSL_DIR="$(getbootparam 'mydsl_dir')"

  if checkbootparam "toram"; then
     TORAM="yes"
     mount -t iso9660 /dev/cdrom /cdrom2 > /dev/null 2>&1
>>      getmydslapps "/cdrom2$MYDSL_DIR"
     umount /cdrom2
  else
>>      getmydslapps "/cdrom$MYDSL_DIR"
  fi
  MYDSL="$(getbootparam 'mydsl')"
  if [ ! -z "$MYDSL" ]; then
     MYDSL="/mnt/$MYDSL"
     echo "$MYDSL" > /etc/sysconfig/mydsl.mount
     mount "$MYDSL"
     if [ $? == 0 ]; then
        UMOUNT="yes"
>>         getmydslapps "$MYDSL$MYDSL_DIR"
        if [ "$UMOUNT" == "yes" ]; then
           umount "$MYDSL"
        fi
     fi
  fi


maybe it is possible to do a hotfix.
put the new dsl-config in a dsl-config.dsl in the root of your MYDSL= ( this will overwrite the old dsl-config) and then have it call itself?

henk.

Posted by henk1955 on Sep. 03 2004,12:59
This is how i did it

i made a copy of/etc/init.d/dsl-config to /etc/rc5.d/S02dsl-config

i modified the lower part oft the file to:

Code Sample


MYDSL_DIR=""

mkmydslmenu(){
  MYMENU="/var/tmp/mydsl.menu"
  if [ -d "$MYMENU" ]; then
     DSLMENU="$HOME/.fluxbox/menu"
     WORK="/var/tmp/menu.$$"
     CNT=$(wc -l "$DSLMENU"|awk '{print $1}')
     RESTOFIT=`expr "$CNT" - 2`
     head -2 "$DSLMENU" > /"$WORK"
     echo "   [submenu] (myDSL-$MYDSL_DIR) {}" >> "$WORK"
     for FILE in `ls $MYMENU/ 2>/dev/null`
     do
        cat "$MYMENU/$FILE" >> /"$WORK"
     done
     echo "   [end]" >> "$WORK"
     tail -"$RESTOFIT" "$DSLMENU" >> "$WORK"
     mv "$WORK" "$DSLMENU"
     rm -rf "$MYMENU"
  fi
  return 0
}


# Reread boot command line; echo last parameter's argument or return false.
getbootparams(){
stringinstring " $1=" "$CMDLINE" || return 1
result="${CMDLINE##*$1=(}"
result="${result%%[)]*}"
echo "$result"
return 0
}
### END functions

HOME="/home/dsl"
INSTALLED=""
TORAM=""
CKMYDSL=""

  CMDLINE="$(cat /proc/cmdline)"

  echo -n "${BLUE}Checking for myDSL apps... ${NORMAL}"
  if checkbootparam "mydsl"; then
     CKMYDSL="yes"
  fi
 
 
  if checkbootparam "mydsl_dir"; then
 
 
  MYDSL_DIRS="$(getbootparams 'mydsl_dir')"

echo $MYDSL_DIRS


  for MYDSL_DIR in $MYDSL_DIRS
  do

  if checkbootparam "toram"; then
     TORAM="yes"
     mount -t iso9660 /dev/cdrom /cdrom2 > /dev/null 2>&1
#      getmydslapps "/cdrom2"
     getmydslapps "/cdrom2$MYDSL_DIR"
     umount /cdrom2
  else
#      getmydslapps "/cdrom"
     getmydslapps "/cdrom$MYDSL_DIR"
  fi
  MYDSL="$(getbootparam 'mydsl')"
  if [ ! -z "$MYDSL" ]; then
     MYDSL="/mnt/$MYDSL"
     echo "$MYDSL" > /etc/sysconfig/mydsl.mount
     mount "$MYDSL"
     if [ $? == 0 ]; then
        UMOUNT="yes"
#         getmydslapps "$MYDSL"
getmydslapps "$MYDSL$MYDSL_DIR"
        if [ "$UMOUNT" == "yes" ]; then
           umount "$MYDSL"
        fi
     fi
  fi
  mkmydslmenu
  done
 
  echo " ${BLUE}Done. ${NORMAL}"

else
  echo " ${BLUE}None. ${NORMAL}"
fi



1. a small change to mkmydslmenu()
2. a new getbootparams()
3. many more changes in main part
 ( check for mydsl_dir=, loop all mydsl_dirs)

4. than made a .dsl file of if ( tar -czvf S02dsl-config.dsl /etc/rc5.d/S02dsl-config)
5. copied to the boot root or MYDSL=
6. added mydsl_dir=(dir1 dir2) to the boot prameters

This is how it works:

first it does the normal loading of dsl extentions (during /etc/rcS.d)
then it does the extra loading (during /etc/rc5.d)

as a result you get all extentions loaded from the root and /optional AND all extentions en optionals from the directories named in mydsl_dir=( ... )

this results in the following fluxbox menu:
Code Sample

ebian MENU
[begin] (DSL)
  [submenu] (myDSL-/dir2) {}
 [submenu](Install Optional Extensions){}
   [exec](bittorrent){/usr/bin/mydsl-load /cdrom/dsl-wendy/optional/bittorrent.dsl}
 [end]
  [end]
  [submenu] (myDSL-/dir1) {}
  [exec] (AbiWord) {/opt/abiword/abiword}
  [exec] (MPlayer) {/usr/bin/gmplayer}
    [submenu](Install Optional Extensions){}
   [exec](samba){/usr/bin/mydsl-load /cdrom/dsl-henk/optional/samba.dsl}
 [end]
  [end]
  [submenu] (myDSL) {}
     [exec] (FireFox) {/opt/firefox/firefox}
   [exec] (Amsn) {/usr/bin/amsn}
[exec] (Aterm) {/opt/aterm/dsl-aterm}
 [submenu](Install Optional Extensions){}
   [exec](nmap){/usr/bin/mydsl-load /cdrom/optional/nmap.dsl}
 [end]
     [exec] (Rox Filer) {/opt/.start_rox}
     [submenu] (tcltk) {}
        [exec] (tclsh) {rxvt -rv -fn fixed -T "tclsh8.3" -e /bin/tclsh8.3}
        [exec] (wish) {rxvt -rv -fn fixed -T "wish8.3" -e /bin/wish8.3}
     [end]
  [end]
  [submenu] (Apps) {}
     [submenu] (Editors) {}
.....



henk.

Posted by ypx on Sep. 03 2004,15:05
wow ! seems to be exactly what i mean ! thanks a lot, i'll try it this week-end...
it might be a good idea to post it to the repository as a .dsl for the tech afraid newbies however.

Posted by ypx on Sep. 06 2004,13:43
due to lack of time, i couldn't test it last week end, but i will this evening, and give feedback as soon as possible.
Posted by ypx on Sep. 06 2004,23:18
it seems i've done something wrong... i don't obtain any success in having .dsl in subfolders appear anywhere but emelfm.

Is the location of the S02dsl-config file mandatory ? as i couldn't do a copy to /etc/rc5.d/S02dsl-config... (even as root, but i'm a live-cd user)

and are there any part of the original script that should be removed ? if yes, could you tell me wich part (and also, i've done editing by cuting and pasting from this topic shown by opera, to scite, are these the appropriate programs to do it)

well, the above questions may seem dumb and poorly written, please forgive the french linux newbie that i am.
and thanks a lot for your answers

Posted by henk1955 on Sep. 07 2004,07:23
yes it must be in /etc/rc5.d/S02dsl-config.

when DSL (linux) start if first runs all scripts in /etc/rcS.d then it goes to runleven 5 and runs all scripts in /etc/rc5.d

now first /etc/rcS.d/S02dsl-config is run this loads all *.dsl from the root (including S02dsl-config.dsl)
then it runs the newly loaded /etc/rcS.d/S02dsl-config wich loads all *.dsl you specify in the bootparam mydsl_dir=(/dir1 /dir2)


yes you can not copy to /etc/...
i am a poor man's install user and cant copy to /etc/.. to
you have to copy to /ramdisk/etc/...
if you create the *.dsl you use /etc/...

maybe we can fint a way so i can send you my S02dsl-config.dsl?

Posted by ypx on Sep. 07 2004,07:49
Quote (henk1955 @ Sep. 07 2004,09:23)
when DSL (linux) start if first runs all scripts in /etc/rcS.d then it goes to runleven 5 and runs all scripts in /etc/rc5.d

you can not copy to /etc/...
you have to copy to /ramdisk/etc/...

very helpfull hints indeed... :)
with quality answers like yours, i likely won't stay a newbie for long (that's a good thing :cool: )
i'll be glad if you sent me the .dsl by mail (i've enabled it today)
but i keep thinking that it should find it's way in the repository.

Posted by henk1955 on Sep. 07 2004,19:05
I dont think it should be part of the extension repositoty.
if it is a usefull patch it could be part of a next version of DSL.
until this hapens i will use the patch to enable me to have multiple DSL configurations on one partition ( i use poor man's install and grub bootloader)

Posted by ypx on Sep. 07 2004,19:49
still having trouble building my own S02dsl-config.dsl
/ramdisk/etc/rc5.d did not exist.
so i used emelfm to create the /ramdisk subdirs, make the copy, and rename it.
then i edited it with scite. when i tried to save, scite wont let me do.
so i saved as /ramdisk/etc/rc5.d/S03dsl-config , deleted the original copy and renamed S03dsl-config to S02dsl-config.
then i went to the process of creating the .dsl :
opening an xterm, going to /mnt/hda2 (my windows me partition to be able to get the result back and burn it to the cd)
typing  tar -czvf S02dsl-config.dsl /ramdisk/etc/rc5.d/S02dsl-config
all seems to have worked fine...
rebooting
burning the file to the root of the cd with nero
rebooting
dsl lang=fr mydsl_dir=(/jeux)
(my .dsl games are in a dir called "jeux" inside the optional folder of the cd)
and nothing seems to be loaded

what did i do that made things go wrong ?

Posted by ypx on Sep. 07 2004,19:55
Quote (henk1955 @ Sep. 07 2004,21:05)
I dont think it should be part of the extension repositoty.
if it is a usefull patch it could be part of a next version of DSL.
until this hapens i will use the patch to enable me to have multiple DSL configurations on one partition ( i use poor man's install and grub bootloader)

i agree that such a useful patch should be added to next version, but it could be useful as a .dsl while waiting for it to be available...

i've read about 0.8.1 in another topic so the waiting may be short...

Posted by henk1955 on Sep. 07 2004,19:57
did you down loaded the *.dsl from my website.
is i the same as the one you made yourself

Posted by ypx on Sep. 07 2004,20:11
Quote (henk1955 @ Sep. 07 2004,21:57)
did you down loaded the *.dsl from my website.
is i the same as the one you made yourself

i did not download anything on your website as i haven't received anything in my mailbox, yahoo may be buggy today...
please could you send me the url, either here or by PM so that i can compare

Posted by henk1955 on Sep. 07 2004,20:22
i did send yoy at leat 3 PMs i think the got lost.
please chech your mail now.

Posted by ypx on Sep. 07 2004,20:28
the forum had a problem at about 20PM (french time) perhaps it can explain why i didn't receive anything...
checked my mailbox... nothing new now
:(

Posted by henk1955 on Sep. 07 2004,20:34
i hope this will help .
Posted by ypx on Sep. 07 2004,20:39
downloaded it, i'll burn it to the cd and give feedback within minutes
Posted by ypx on Sep. 07 2004,21:04
your .dsl is working perfectly fine... the only thing that i had to take care of was to use the right path to my files (/optional/jeux instead of only /jeux) but i think it's better this way (i'll reburn my cd to take care of that).
I'll have to check what has gone wrong with mine.
Meanwhile i'll use yours if you don't mind ;)

Great job :laugh:

P.S. :
i know it's a little off topic (i posted about that in the howto section)
but do you know how to set my keyboard properly before typing cheatcode ?as i would like to be able to do it without having to guess where is what

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.