How to convert a directory to a sfs module?

Moderator: fredx181

Post Reply
Makarovnik
Posts: 36
Joined: Fri Jan 08, 2021 9:40 pm
Been thanked: 1 time

How to convert a directory to a sfs module?

Post by Makarovnik »

Hey guys, I'm learning all kinds of stuff from this forum! I'm currently running bionicdog64 frugal install on usb flash drive. Works pretty good. Bionicdog is running on ext4 (journaling disabled) and I also have a small fat32 partition so I can share files with winblows.

I would like to make a sfs module from a directory. Alternatively I would like to also be able to make a sfs module from a tarball and/or .deb. I know how to do this in straight puppy linux but on bionicdog I don't think dir2sfs is installed. What is the easiest way to achieve this? Thanks in advance.

I dreamed I was Hitler; ruler of the sea, ruler of the universe, ruler of the supermarket. - Poly Styrene

Makarovnik
Posts: 36
Joined: Fri Jan 08, 2021 9:40 pm
Been thanked: 1 time

Re: How to convert a directory to a sfs module?

Post by Makarovnik »

I scoured the internet and saw many mentions of dir2sfs. I'm not sure if it's included with bionicdog64

There are some module tools but I don't think they are quite the same as dir2sfs. I will check the .desktop files when I get a chance. I finally found a download for it but haven't tried installing it on bionicdog64. If interested here it is:

viewtopic.php?f=106&t=450

I dreamed I was Hitler; ruler of the sea, ruler of the universe, ruler of the supermarket. - Poly Styrene

User avatar
foxpup
Posts: 186
Joined: Fri Jul 24, 2020 1:23 pm
Location: Europe near the Northsea
Has thanked: 75 times
Been thanked: 32 times

Re: How to convert a directory to a sfs module?

Post by foxpup »

There are also the commands mksquashfs and unsquashfs.

Makarovnik
Posts: 36
Joined: Fri Jan 08, 2021 9:40 pm
Been thanked: 1 time

Re: How to convert a directory to a sfs module?

Post by Makarovnik »

Thank you. Now I feel silly

I dreamed I was Hitler; ruler of the sea, ruler of the universe, ruler of the supermarket. - Poly Styrene

User avatar
foxpup
Posts: 186
Joined: Fri Jul 24, 2020 1:23 pm
Location: Europe near the Northsea
Has thanked: 75 times
Been thanked: 32 times

Re: How to convert a directory to a sfs module?

Post by foxpup »

Don't.
If you look at the script for dir2sfs, you will find mksquashfs in there.

For extracting/unsquashing/untarring/unzipping etc. I use the UExtract script from JakeSFR.
It is great and a no brainer.

If you convert a package (.deb or .pet ...) to a .sfs you better check if there are scripts that are meant to run before/after/post install,
and if they are important.
I am not sure if the scripts will be executed when they are in a .sfs, I don't think so.

A package will install to the pupsave and thus will be in the top layer.
An .sfs, on the other hand, will be a layer on the bottom.

User avatar
rockedge
Site Admin
Posts: 6537
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2745 times
Been thanked: 2619 times
Contact:

Re: How to convert a directory to a sfs module?

Post by rockedge »

you can use Pkg (from @sc0ttman ) in Bionic64 to create sfs modules as well.

in a terminal:

Code: Select all

pkg help

Code: Select all

 dir2pet DIR                create a pet package from a directory
 dir2sfs DIR                create an sfs package from a directory
 dir2tgz DIR                create a tar.gz file from a directory
 deb2pet DEBFILE            convert local deb file to a pet package
 pet2sfs PETFILE            convert local pet file to an sfs package
 pet2tgz PETFILE            convert local pet file to a tar.gz package
 pet2txz PETFILE            convert local pet file to a tar.xz package
 sfs2pet SFSFILE            convert local sfs file to a pet package
 tgz2pet TARFILE            convert local tar.gz|tgz file to PET
 txz2pet TXZFILE            convert local tar.xz|txz file to PET

So I make a directory with the file structure I need for the sfs to work then:

Code: Select all

pkg dir2sfs <my-directory-that-will-be-the sfs>
user1111

Re: How to convert a directory to a sfs module?

Post by user1111 »

foxpup wrote: Thu Feb 04, 2021 7:29 am

There are also the commands mksquashfs and unsquashfs.

That's what I tend to do. In a terminal type mksq and press <tab> and it autocompletes to mksquashfs. Put the folder/directory name after that, and then the desired name of the sfs

mksquashfs somefolder my.sfs

Once you have a sfs, you can mount it by making a folder and mount it to that

mkdir myfolder
mount my.sfs myfolder

... and use rox, mc, whatever to browse the content. That ordering is common i.e. 'everything is a file' and where you more often specify the input first and then the output hence my.sfs first, folder name second to mount the sfs to that folder.

When done ...

umount myfolder

to unmount it.

If you run just unsquashfs (again you can use the <tab> to autocomplete) against the sfs

unsquashfs my.sfs

by default it creates a folder called squashfs-root with the content. There are other options you can use to specify a name, often adding a -h parameter will show the help for a program

unsquashfs -h

I primarily use a laptop, so a bit of a keyboard junkie rather than point/click/drag/drop. For instance I can move windows around by using alt-spacebar to bring down the window menu that is seen when you click the leftmost icon in a window title bar. Within that there are move, resize, close ...etc. type options where you can use the arrow keys to move or resize the window (press Enter when done to 'drop' the window at that location). Alt-tab steps between windows ...etc. Different Puppy's however can define different keycodes to do various actions, so much is subjective. I have for instance ctrl-alt-enter open a terminal, ctl-alt-m to toggle maximised and restore, ctrl-alt-x to close a window.

Sometimes a window might have its title bar off the top of screen and typically you use either alt-mousedrag (left mouse press) to move it, or you can use the window menu and arrow keys to do the same.

Takes some practice before that sort of thing all becomes second nature, but useful if you work on remote systems such as ssh into another box using command line, which can open up a whole other world to explore/partake. I use hashbang as a ssh server for instance within which I have multiple screens for the likes of email, calendar/diary, irc ...etc. A nice feature with that is I can disconnect, and it remains running in the background, so I can connect again later from a different location, using a different device and its all how it was left.

User avatar
PipzDex
Posts: 188
Joined: Sun Jul 12, 2020 11:16 pm
Location: Mexico
Has thanked: 61 times
Been thanked: 81 times

Re: How to convert a directory to a sfs module?

Post by PipzDex »

Makarovnik wrote: Thu Feb 04, 2021 1:02 am

Hey guys, I'm learning all kinds of stuff from this forum! I'm currently running bionicdog64 frugal install on usb flash drive. Works pretty good. Bionicdog is running on ext4 (journaling disabled) and I also have a small fat32 partition so I can share files with winblows.

I would like to make a sfs module from a directory. Alternatively I would like to also be able to make a sfs module from a tarball and/or .deb. I know how to do this in straight puppy linux but on bionicdog I don't think dir2sfs is installed. What is the easiest way to achieve this? Thanks in advance.

Hi @Makarovnik

Check my post and coment me if you like

Puppy Utilities Center 2.7 (PUC-2.7) ==>NEW Update<== January 2021

Cheers!! :thumbup2:

Pentium (R) 2.20GHz I RAM: 8.0 GB I F96-CE_5 I Kernel 6.6.8-64oz-ao I Glibc: 2.31 I 1600x900 Px

My Puppy Stuff and more

Post Reply

Return to “UbuntuDogs”