SFS Files not where expected [Solved]

Booting, installing, newbie
Post Reply
Message
Author
hobbit
Posts: 14
Joined: Fri 30 Sep 2005, 11:45
Location: UK

SFS Files not where expected [Solved]

#1 Post by hobbit »

Running Frugal Precise 5.4

I have installed OpenBve, which, for the uninitiated, this is a great little train sim.

I also had to load and compile mono in order for it to work, along with TAO, SDL and libgdiplus. It seems Precise already comes with OpenAl, so that was one less thing to do.

I then decided, having got everything working nicely, to create an sfs of the new software. Thinking a bit further I decided it might be wise to create an sfs for OpenBve itself (which also includes TAO) and another for mono, SDL and libgdiplus.

The main reason is that OpenBve might go up in version, and as long as it's still compatible I might not need to get a newer mono. With two sfs's, I can achieve this.

Also, for my first ever sfs attempt, OpenBve is much smaller and self contained than mono.

So, OpenBve is located in /root/my-applications/OpenBve. All required files and sub-directories are contained within it.

I then created a folder structure in /tmp so I ended up with /tmp/OpenBve/root/my-applications/OpenBve. The contents of /root/my-applications/OpenBve were copied into /tmp/OpenBve/root/my-applications/OpenBve.

The sfs was created with mksquashfs /tmp/OpenBve OpenBve.sfs.

This appeared to work, producing an sfs which I moved to /mnt/home. I used the Boot Manager to load the new sfs at boot up.

The /root/my-applications/OpenBve directory was renamed to /root/my-applications/NotOpenBve, just so I didn't lose the working installation.

After re-booting the system, I was expecting to see OpenBve re-appear in /root/my-applications, but it did not.

I eventually located it in ./initrd/pup_ro4/root/my-applications/OpenBve.

I was able to run the game no problem once I had found it.

The question I have (after a quick rendition of war and peace - sorry) is, was my expectation incorrect? I thought that an sfs would effectively put the software back in it's original location. In reality it went into the pup_ro4 instead and was not visible in /root/my-applications.

Have I missed a step somewhere or done something wrong when I set up the directory structure in /tmp? Or just mis-understood how including an sfs works?

In the case of OpenBve the question is more out of curiosity, since the software works pretty much regardless of location.

However, I would really like to get mono into an sfs, but it sprays it's files around several directories in /usr. Although I have a "before" and "after" listing of /usr so I can tell exactly what files I need to get into the sfs, I am worried where they will end up after the sfs creation therefore and if mono will still work.

I hope all that made sense!!!!

Thanks in advance ....
Last edited by hobbit on Sat 09 Mar 2013, 22:27, edited 1 time in total.
I survived "The Grind"

coopsurv
Posts: 55
Joined: Mon 23 Aug 2010, 14:27

...

#2 Post by coopsurv »

more likely than not your SFS loaded... then your pupsave config was overlaid... otherwords puppy boots main sfs... adds others... then overlays pupsave config... such as say you updated flash by way of simply copying to /usr/lib/mozilla/plugins... blah... pup would first load flash as per main sfs... then overlay pupsave... where you manually updated by simple copy.

in short... where you simply renamed dir and then created sfs... same applies.

hopefully clear enough...

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post by 8-bit »

It has always been my understanding that the Pupsave file is loaded first and when the other SFS files are loaded that if a loaded file then exists it is not overwritten by the ones in the SFS.
The exception to this is when using SFS-load-on-the-fly, existing files of the same name and location are overwritten by the ones in the SFS.

If I am wrong in this, I am sure someone will jump in and correct me!

hobbit
Posts: 14
Joined: Fri 30 Sep 2005, 11:45
Location: UK

#4 Post by hobbit »

Trying hard to follow what you are telling me.

Unfortunately, I renamed the folder AFTER creating the sfs, so I don't think your comment applies. [EDIT - but see right near the end of this reply]

I did actually completely delete that folder tonight so OpenBve did not exist anywhere other than where the sfs put it.

Done some more playing.....

Removed all prior efforts of creating OpenBve.sfs and the installation of OpenBve.

Re-Installed OpenBve, but in /usr/OpenBve this time.

Why did I choose /usr this time? Because I already found some instructions on the forum before I started trying to create an sfs. So I figured why not try to get as close to the example as possible.

Anyways, created /root/OpenBve/usr/ and moved /usr/OpenBve into it, i.e. OpenBve was removed from /usr and added to /root/OpenBve/usr.

Then: mksquashfs /root/OpenBve OpenBve.sfs

Added the sfs to bootup, rebooted ....

Success!!!!

It behaved exactly as I expected - OpenBve appeared in /usr.

There is also a /initrd/pup_ro4/usr/OpenBve similar to before. However, there is obviously a difference in the technique I used compared to when OpenBve was in /root/my-applications, since it is also in /usr this time.

At the moment I cannot see where I've zigged instead of zagged, unless someone else can point out the glaringly obvious!!!!

Or perhaps a limitation of creating sfs files is that they must be based on /usr?

The other thing I did different this time was to move OpenBve from its installed directory into the sfs "build" directory, so at the time mksquashfs was run, there was nothing in the intended target directory. There was nothing in the instructions I followed about moving rather than copying, that was my decision to do.

Which in hindsight is what I think you guys are trying to tell me?

Methinks more playing is required ..... but it's getting late. I'll do some more experiments tomorrow night.

Thanks for your feedback so far - sorry it took me a while to respond - pressure of work I'm afraid.
I survived "The Grind"

hobbit
Posts: 14
Joined: Fri 30 Sep 2005, 11:45
Location: UK

#5 Post by hobbit »

After much playing I believe I have discovered the rules of sfs creation. There seems to be 3:

1. The files you want to be in the sfs must be in /usr or a sub-directory under /usr
If the files are in any other directory structure, it will not work. I was trying to get the files to go into /root/my-applications/OpenBve. No matter what I did, the files would not appear in that directory. It was slightly frustrating, because in the /initrd/pup_ro4 (in my case) directory, you could see everything where it should be.

2. It does not seem to matter where you copy the files for the building of the sfs.
I created /root/OpenBve/usr/games/OpenBve and it worked. I also tried again by creating /tmp/OpenBve/usr/games/OpenBve and that worked too.

3. Don't forget to delete the original files and the copies after the sfs is created
A Good Reason for creating the copies in /tmp is that any files in /tmp are lost when Puppy is re-booted. One less thing to remember. In my particular case it was even easier because OpenBve does not seem to care where it is installed. In fact, installation is the wrong word to use; OpenBve for Linux is supplied in a zip file, so it is simply unzipped into the desired directory. No compiling or anything else is required. So, I unzipped directly into /tmp/OpenBve/usr/games/OpenBve, which meant I didn't even have to remember to delete it from /usr/games.

It won't be so easy when I attempt to get mono into an sfs. It is unzipped initially, but then it has to be compiled. The resulting files are put into several directories under /usr. That should be "fun"!!!!!!!!

In conclusion, I think the above are the rules for creating sfs files. They certainly work for me.

However, if anyone wishes to contradict me, answer why it only seems to work when the files are in /usr, and/or provide a solution to that, then please do.

My next challenge, before moving on to mono, is to see if I can get a menu entry and/or desktop icon incorporated into the sfs. There "has" to be a way because I know OpenOffice does it when loaded via an sfs. Perhaps I'll download it and have a look inside the sfs for clues.

I have marked the post as solved - because my initial problem is indeed solved.

Thank you for your responses that helped my thought train go in the appropriate direction.
I survived "The Grind"

Post Reply