Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: michaelkj77 on October 11, 2010, 03:57:41 PM

Title: persistent data
Post by: michaelkj77 on October 11, 2010, 03:57:41 PM
I have TC booting from a compact flash drive.  I also have an application on the compact flash (/mnt/hda2/tce/options) called xastir.  Xastir displays maps and locations of items.  My maps are on the compact flash as well in /mnt/hda2/tce/maps.  However, when it is loaded, xastir expects to find maps in /usr/local/share/xastir/maps. 

At the command line, I can create a symbolic link like this:

ln -s /mnt/hda2/tce/maps /usr/local/share/xastir/maps/cfmaps

which works fine, but I need that link before xastir starts otherwise the app's startup configuration doesn't find the maps and removes them from its map list. 

I have tried adding the symbolic link to the /home/tc/.X.d/xastir file ahead of starting xastir, even with a sudo su ahead of it, but the link isn't created.  What is the correct way to create this link before starting the program?
Title: Re: persistent data
Post by: bmarkus on October 11, 2010, 04:04:41 PM
My advice is to choose an OSM (OpenStreetMap) in the map menu. In such case xastir will load map online automatically. No configuration needed other than to choose an OSM map. Downloaded maps are cached and saved in your home directory. Play a bit with OSM maps to find your favourite.

As downloaded maps are in home dir, theay will be saved and restored using backup.

Title: Re: persistent data
Post by: michaelkj77 on October 11, 2010, 05:43:11 PM
BMarkis...thank you very much for your reply.  I see your name on the Xastir tcz so I appreciate your input very much.  Unfortunately, the computer is a little 12-volt DC computer and will be running in my car.  I'll be using Xastir for emergency management deployment so I won't have an internet connection.  I failed to mention that up front.  Sorry.  That would be a better solution though if I were able to get maps that way. 

I also tried replacing the /usr/local/bin/xastir command in the /home/tc/.X.d/xastir file with a call to a shell script, and in that shell script I tried to make the symbolic link and then start Xastir.  Same result.  Seems for some reason the OS won't create a symbolic link inside one of the .X.d startup files.  Still working on it though. 

One question, if I make the symbolic link (/usr/local/share/xastir/maps/cfmaps) and then put that path in my /opts/.filelist.lst file to be persistent, would that work?  Would just the symbolic link be preserved, or would everything the symbolic link points to get zipped up in the mydata file too?  I don't want to preserve the maps.  They're already on the compact flash.  I just want to preserve the link.  Thanks.

Title: Re: persistent data
Post by: michaelkj77 on October 11, 2010, 05:46:36 PM
BMarkus, I might have misunderstood your previous reply.  I understood your message to say I should rely on online maps which I can't do because I won't have an internet connection.  If however you were suggesting placing maps in my home directory to make them persistent, I can do that.  If possible though, I would rather access the maps from the compact flash to preserve memory.  Thanks again for your help. 
Title: Re: persistent data
Post by: tinypoodle on October 11, 2010, 05:53:53 PM
One question, if I make the symbolic link (/usr/local/share/xastir/maps/cfmaps) and then put that path in my /opts/.filelist.lst file to be persistent, would that work?  Would just the symbolic link be preserved, or would everything the symbolic link points to get zipped up in the mydata file too?  I don't want to preserve the maps.  They're already on the compact flash.  I just want to preserve the link.  Thanks.

That should work fine.
Title: Re: persistent data
Post by: bmarkus on October 11, 2010, 06:46:14 PM
OK, I see now the point. The best is to put

Quote
ln -s /mnt/hda2/tce/maps /usr/local/share/xastir/maps/cfmaps

to /opt/bootlocal.sh file which is executed after extensions loaded.
Title: Re: persistent data
Post by: michaelkj77 on October 11, 2010, 08:51:33 PM
getting closer, but not there yet.  I've moved the command

ln -s /mnt/hda2/tce/maps /usr/local/share/xastir/maps/cfmaps

to /opt/bootlocal.sh. 

After booting, the symbolic link doesn't exist.  If I execute the script bootlocal.sh at the command prompt as user tc, there is a "permission denied" error when the ln -s command is executed.  If I run the script bootlocal.sh as root, it works. 

In the /opt directory, the bootlocal.sh script is owned by root so I would think it is running as root, but that doesn't seem to be the case.  Still researching and trying to figure it out but appreciate any assistance. 
Title: Re: persistent data
Post by: michaelkj77 on October 11, 2010, 09:33:03 PM
A little more info:  /home/tc/.X.d/xastir now contains only the tce-load -i xastir command.  Nothing else.  The /opt/bootlocal.sh script contains:

sudo ln -s /mnt/hda2/tce/maps /usr/local/share/xastir/maps/cfmaps
/usr/bin/xastir

When TC boots, the .../.X.d/xastir script loads the xastir directories, no problem.  The /opt/bootlocal.sh script however doesn't seem to run, or must encounter some error because the symbolic link isn't created and xastir doesn't start.  Interesting thing though, I can run the bootlocal.sh script at a command prompt as user tc or root, and it works. 
Title: Re: persistent data
Post by: maro on October 12, 2010, 03:26:36 AM
I can't help you with your application specific issues, but:
Code: [Select]
tc@box:~$ ls -l /tmp/tce-*
lrwxrwxrwx    1 root     root            13 Oct 12 07:15 /tmp/tce-bootlocal -> /mnt/hda1/tce/
lrwxrwxrwx    1 tc       staff           13 Oct 12 07:15 /tmp/tce-xsession -> /mnt/hda1/tce/
Title: Re: persistent data
Post by: ^thehatsrule^ on October 17, 2010, 02:57:24 PM
bootlocal is started during boot (as root, for non-X) while .X.d entries are done after boot during X startup (as current user, for X).

So moving the /usr/bin/xastir part to .X.d is probably what you want.  Side note: you could just have xastir