Permanent java apps on a USB stick

Forum: USB booting
Topic: Permanent java apps on a USB stick
started by: Chamane

Posted by Chamane on Feb. 02 2008,18:13

I hope I am at the right place to post this. What I want to do is to make my DSL installation on a USB permanent with all the applications (mainly java apps, but also from MyDSL and apt-get command) I installed. The applications are related to geomatics. Here are the procedures I followed so far:

1訐artitionning and formating of my 4 Gb Flash drive. I copied from Windows the DSL 4.2 iso on the frist 500 Mb FAT 32 partition (/dev/sdb1), leaving the second 3500 Mb FAT 32 free (/dev/sdb2).

2訕etting my keyboard to "cf" from the control panel, restarting X.

3託pgrading to GNU utils and enabling apt.

4蚓hanging the default repository in sources.list to " oldstable main contrib non-free". The GRASS and QGIS geomatics apps are not available in the other repos.

5衰nstalling jre1_5_0 from MyDSL-System so I can install jar apps.

6蚤ownloading OpenJUMP (
wich is a geomatics software. There are others like Landserf, but the install procedure is the same.

7記pening a terminal and typing PATH="$PATH:/opt/jre1_5_0/bin" so I can use the java -jar application.jar command.

8蚓hanging directory to where the downloaded file is. Installing the software with: java -jar OJ_ViatorisLinuxInstaller.jar successfully. The executable file has been put in the /usr/local/OpenJUMP/bin directory.

9衰n a terminal, changing directory to /usr/local/OpenJUMP/bin and typing again PATH="$PATH:/opt/jre1_5_0/bin" otherwise the software won't open.

10記pening up the software with the command ./

There. Everything is set up properly, I can use the GRASS and QGIS softwares, and the OpenJUMP java software as well. My question is "How can I make all these installations permanent" so when I reboot my DSL stick everything will appear without having to reinstall?
1配he keyboard setting
2配he enabled apt
3配he installed apps (GRASS and QGIS) from apt-get
4配he jre1_5_0 java app from MyDSL (I have tried to modify the /etc/profile file without success)
5配he installed java apps (OpenJUMP)

Damnsmall is perfect for USB stick because it leaves lots of free space on the drive compared to other distros. I have been searching a lot to make averything working so far. I would appreciate a lot if someone could give the answers I am looking for.

Many thanks.

Chamane :)

Posted by ^thehatsrule^ on Feb. 02 2008,22:14
Assuming you do not want to remaster the base DSL image...

The file may be of interest to you and backup/restore.

Here's some pointers...
1. `loadkeys <mysetting>` (or boot with lang=?)
2. Look in `cat ~/.fluxbox/menu | grep -i apt`
4. What DSL version are you using? If newer, place a symlink to java in /opt/bin would be better than to modify /etc/profile.  In any case, you'd have to back up either file.

For 2, 3: unless the version in those apt repos keeps changing, you're better off to either
- download the debs and installing them locally, or
- convert them, i.e. using deb2dsl, which will also reduce the need for dsl-dpkg

5: Depends how the installation goes.  Would be better to convert to a mydsl package as well (and installed in /opt)

Posted by humpty on Feb. 03 2008,15:58
it's hard to tell wether you did a frugal install or a hard-drive install.

anyway, have a read through this;
< >

Posted by Chamane on Feb. 04 2008,19:57
Thanks both for your reply. I will give a feedback in a near future.


Posted by Chamane on Feb. 08 2008,17:59

I tried a few things without success. I followed the procedures in the link on persistence:

dsl@box:~$sudo su
   dsl@box:~$mkdir /mnt/sdb2/opt
   dsl@box:~$cp -arv /ramdisk/opt/ /mnt/sdb2/opt
   dsl@box:~$mkdir /mnt/sdb2/home
   dsl@box:~$cp -arv /ramdisk/home/dsl /mnt/sdb2/home
and setting up sdb2 as back/restore device from the DSL Control panel.

When rebooting, I typed:

dsl fromhd=/dev/sdb1 home=/dev/sdb2 restore=sdb2 keyb=cf

The only thing that worked was the home directory where I found my jar files again. I lost jre1_5_0 and the installed apps from apt-get and from java installation (

I would be willing to give installation of deb files, but I am not that good with Linux (like I don't know what a symlink is) and it seems to me that there are a lot of dependencies that I would have to solve with GRASS.

BTW, my DSL version is 4.2.2.

Any solution welcomed.

Chamane :)

Posted by curaga on Feb. 08 2008,18:26
You should add opt=/dev/sdb2 to your boot line to have opt there too :)
Posted by ^thehatsrule^ on Feb. 08 2008,18:31
If you're using persistent dirs, you should use .tar.gz extensions for /opt as they will be permanent (or else use the mydsl autoload mechanism, or copy them over if you're using uci's). Having said that, afaik you should avoid using a persistent home, since that is usually where many writes occur.
Posted by Chamane on Feb. 09 2008,20:35
I think I have done it. I feel like I'm on top of the Everest... After all those trials. Many thanks for the answers posted above. But there are still a few irritants. Here is what I did:

1- After installing Damnsmall on the USB drive (I changed for the 4.2.5 version), I booted with the CD with the following codes:
dsl fromhd=/dev/sdb2 mydsl=sdb2 keyb=cf
so when I install jre1_5_0 it goes directly on the mydsl directory of the stick.

2- I enabled APT and changed the repository for:
< > debian oldstable main contrib non-free
where the GRASS GIS and QGIS apps are available.

3- sudo apt-get update

4- sudo apt-get install grass grass-doc qgis. That command will put all the used deb files in /var/cache/apt/archives.

5- Copy all the .deb files of /var/cache/apt/archives in /mnt/sdb2/mydsl so they become persistant.

6- sudo beaver /opt/ for editing. I added the command lines dpkg -i /mnt/sdb2/mydsl/debpackage.deb for all the deb files available in the directory. There were 41 of them...

7- Install jre1_5_0.tar.gz from the MyDSL Extension Tool.

8- Download OJ_ViatorisLinuxInstaller.jar in /home/dsl/softwares.

9- In a shell, go to /home/dsl/softwares and type:
PATH="$PATH:/mnt/sdb2/opt/jre1_5_0/bin" (I booted with mydsl=sdb2).

10- Install the jar file with: java -jar OJ_ViatorisLinuxInstaller.jar. To make the installation persistent, I chose the /mnt/sdb2/OpenJUMP directory.

11- In a shell, I typed:

sudo mkdir /mnt/sdb2/opt
sudo cp -arv /ramdisk/opt /mnt/sdb2/opt
sudo mkdir /mnt/sdb2/home
sudo cp -arv /ramdisk/home/dsl /mnt/sdb2/home

12- Setting up sdb2 for Backup/Restore in the DSL Control panel.

13- Reboot with the following codes:


That's it! I got an error message, though after trying to open up QGIS:

qgis: error while loading shared libraries: cannot open shared object file: No such file or directory.

I don't know what that means, but I'll try to find out. Also, I am not able to make: PATH="$PATH:/mnt/sdb2/opt/jre1_5_0/bin" persistent, so I have to type the line everytime I want to use my java apps. I wrote the line in, but it didn't work.

I tried to convert the .deb files with the deb2dsl script, but I got a deb file again. I think the compression worked, but I don't know why I still got debs. What if I rename the extension for dsl?

Many thanks again.

Chamane :laugh:

Posted by curaga on Feb. 09 2008,20:43
To make the PATH change persistent, modify /etc/bashrc and /etc/profile (and add them to .filetool.lst)

QGIS: hmm. is in /usr/lib. What do you get from ldd (on qgis)?

Posted by ^thehatsrule^ on Feb. 09 2008,21:26
I think libXrandr is not included in DSL... iirc it can be found in gnu-utils (mydsl)

For PATH, you could also just drop in symlinks to /opt/bin instead
or just modify ~/.bash_profile ~/.bashrc if you're just using 1 user.. so that it will avoid extra backup/restore files

Also, since it seems you decided to use persistent dirs (despite my warning), there should be no need to use the backup/restore feature.

Posted by Chamane on Feb. 10 2008,03:08
OK. I will delete /mnt/sdb2/home and forget home=/dev/sdb2 on my next boot.

I am not able to modify bashrc or profile even as superuser. I thought that it was because of the frugal install.

I also typed this:
dsl@box:~$ ldd -v grass

and got that (even as superuser):
ldd: ./qgis: No such file or directory

although I don't know if I did it right.


Posted by ^thehatsrule^ on Feb. 10 2008,04:16
If you don't know the full path, you can do something like
ldd `which grass`

If you really want to modify those system files, you problably have to remove those then copy them from KNOPPIX into ramdisk.

Posted by Chamane on Feb. 10 2008,16:00

I tried:

dsl@box:~$ ldd qgis
ldd: ./qgis: No such file or directory
dsl@box:~$ sudo ldd qgis
ldd: ./qgis: No such file or directory
dsl@box:~$ ldd which qgis
ldd: ./which: No such file or directory
ldd: ./qgis: No such file or directory
dsl@box:~$ ldd 'which qgis'
ldd: ./which qgis: No such file or directory
dsl@box:~$ sudo ldd 'which qgis'
ldd: ./which qgis: No such file or directory
dsl@box:~$ sudo ldd which qgis
ldd: ./which: No such file or directory
ldd: ./qgis: No such file or directory

But QGIS is there:

dsl@box:~$ whereis qgis
qgis: /usr/bin/qgis /usr/lib/qgis /usr/share/qgis /usr/share/man/man1/qgis.1.gz

I doubt that my deb files are not written properly in, I used copy/paste. What else can I do to make it work?

Also, I copied bashrc and profile from /KNOPPIX/etc to /ramdisk/etc and added /mnt/sdb2/opt/jre1_5_0/bin to both for the PATH. What do I do from there? I tried to replace them back in /KNOPPIX/etc, but they cannot be removed as they are read-only files.



Posted by ^thehatsrule^ on Feb. 11 2008,00:50
Those are back-ticks, usually left of your keyboard's 1 key and the same as the ~ key.  It's used for command substitution.
Why don't you select+paste?
Anyways, alternative ways are to use $() instead of `` or you could also manually type out the full path yourself.

Posted by Chamane on Feb. 11 2008,11:38
Sorry, I am a newbie with Linux. Here is what I got:

dsl@box:~$ ldd `which qgis` => /usr/lib/ (0x4001c000) => /usr/lib/ (0x40708000) => /usr/lib/ (0x40ad1000) => /usr/lib/ (0x40b4a000) => /usr/lib/ (0x40b51000) => /usr/lib/ (0x40e9b000) => /usr/lib/ (0x40ee8000) => /usr/lib/ (0x40f0a000) => /usr/lib/ (0x40fa9000) => /usr/lib/ (0x40fb2000) => /usr/lib/ (0x41002000) => /usr/lib/ (0x4101f000) => /usr/lib/ (0x41044000) => /usr/lib/ (0x41067000) => /usr/lib/ (0x411d5000) => /lib/ (0x411e3000) => /lib/ (0x41234000) => /usr/lib/ (0x41237000) => /usr/lib/ (0x41253000) => /usr/lib/ (0x41346000) => /lib/ (0x41400000) => /lib/ (0x41423000) => /lib/ (0x4142c000) => /usr/lib/ (0x4155f000) => /usr/lib/ (0x4158e000) => /usr/X11R6/lib/ (0x415a3000) => /usr/lib/ (0x415ed000) => not found => /usr/lib/ (0x415f6000) => /usr/X11R6/lib/ (0x415ff000) => /usr/lib/ (0x41612000) => /usr/X11R6/lib/ (0x4167c000) => /usr/X11R6/lib/ (0x41689000) => /usr/X11R6/lib/ (0x41746000) => /usr/X11R6/lib/ (0x4174e000)
       /lib/ => /lib/ (0x40000000) => /usr/lib/ (0x41763000) => /usr/lib/ (0x41791000) => /usr/lib/ (0x41883000) => /lib/ (0x418ec000) => /lib/ (0x41919000) => /lib/ (0x4192b000) => /usr/lib/ (0x41940000) => /usr/lib/ (0x41960000) => /lib/ (0x41984000)

Looks like the file is not found.


Posted by curaga on Feb. 11 2008,15:03
Check gnu-utils for, and for the PATH, you can add something like this to /home/dsl/.bashrc:
(both were suggestions of ^hats^, I just recapped them here)

Posted by Chamane on Feb. 11 2008,15:52
Hi. Thanks for answering.

I decided to delete everything and reinstall dsl on the stick just to make sure I didn't forget something along the way. I installed GRASS and QGIS from apt-get. GRASS worked, but not QGIS because of the same reason ( missing). That seems strange to me because it was working the first time without the use of dpkg all the debs. So I decided to try different repositories where the softwares were available. QGIS didn't work using two repositories, but finally decided to work with:

< > oldstable main contrib non-free

I continued with the rest of the procedures and now it is working:

dsl@box:~$ ldd `which qgis` => /usr/lib/ (0x4001c000) => /usr/lib/ (0x40708000) => /usr/lib/ (0x40ad1000) => /usr/lib/ (0x40b4a000) => /usr/lib/ (0x40b51000) => /usr/lib/ (0x40e9b000) => /usr/lib/ (0x40ee8000) => /usr/lib/ (0x40f0a000) => /usr/lib/ (0x40fa9000) => /usr/lib/ (0x40fb2000) => /usr/lib/ (0x41002000) => /usr/lib/ (0x4101f000) => /usr/lib/ (0x41044000) => /usr/lib/ (0x41067000) => /usr/lib/ (0x411d5000) => /lib/ (0x411e8000) => /lib/ (0x41239000) => /usr/lib/ (0x4123c000) => /usr/lib/ (0x41258000) => /usr/lib/ (0x4134b000) => /lib/ (0x41405000) => /lib/ (0x41428000) => /lib/ (0x41431000) => /usr/lib/ (0x41564000) => /usr/lib/ (0x41593000) => /usr/X11R6/lib/ (0x415a8000) => /usr/lib/ (0x415f2000) => /usr/X11R6/lib/ (0x415fb000) => /usr/lib/ (0x415fe000) => /usr/X11R6/lib/ (0x41607000) => /usr/lib/ (0x41618000) => /usr/X11R6/lib/ (0x41682000) => /usr/X11R6/lib/ (0x4168f000) => /usr/X11R6/lib/ (0x4174c000) => /usr/X11R6/lib/ (0x41754000)
       /lib/ => /lib/ (0x40000000) => /usr/lib/ (0x41769000) => /usr/lib/ (0x41797000) => /usr/lib/ (0x41889000) => /lib/ (0x418f2000) => /lib/ (0x4191f000) => /lib/ (0x41931000) => /usr/lib/ (0x41946000) => /usr/lib/ (0x41966000) => /lib/ (0x4198a000)

The explanation is out of my reach. Anyway, I put PATH="$PATH:/mnt/sdb2/opt/jre1_5_0/bin" as the last line of /home/dsl/.bashrc as you suggested and now, guess what, EVERYTHING IS WORKING FINE! I get to the directory where my java app is and just launch it. Perfect.

Thanks so much to all!

Chamane :laugh:

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