Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 05 Dec 2019, 13:27
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
SFS subtraction
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
stemsee

Joined: 27 Jun 2013
Posts: 2539
Location: In The Way

PostPosted: Wed 26 Dec 2018, 13:08    Post subject:  SFS subtraction
Subject description: sfs1 - sfs2 = sfs3
 

I have an apps.sfs and I need to remove an office sfs from it, and create a results sfs. Here is my attempt. Sfs3 should be in /tmp or on a linux partition ext1/2/3/4 reiserfs btrfs f2fs etc
Code:
#!/bin/sh
# sfs1-sfs2=sfs3
# Use this script to mount two sfs files and ignorantly create a third
# sfs file. Mount sfs1 which contains the files and more as in sfs2, then copy
# the files from sfs1 to a directory for sfs3, only if those files do not exist in
# sfs2.
Version=1
on=`ps -e | grep sfseparator.sh | wc -l`
[[ "$on" -gt 2 ]] && exit #check if running, one instance only
echo "Input path/sfs1 and path/sfs2 and output path/sfs3 directory
eg /mnt/sda1/fd64.sfs /mnt/sda1/fd1/fd64.sfs /mnt/mmcblk2p2/rm/fd64"
read one two three

echo "$one $two $three" > /tmp/paths
rm -rf $three
rm -f $three.sfs
mkdir -p /tmp/one
mkdir -p /tmp/two
umount -f /tmp/one
umount -f /tmp/two
umount -f $one
umount -f $two
mount -loop -t squashfs $one /tmp/one
mount -loop -t squashfs $two /tmp/two

rsync -av --progress --stats --compare-dest=/tmp/two/ /tmp/one/  $three/
sync
mksquashfs $three $three.sfs -comp xz
umount /tmp/one
umount /tmp/two

Last edited by stemsee on Wed 26 Dec 2018, 19:27; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger 
mikeslr


Joined: 16 Jun 2008
Posts: 3536
Location: 500 seconds from Sol

PostPosted: Wed 26 Dec 2018, 14:01    Post subject:  

Not that I know enough about coding to be of any help, but:

From your post I can't tell if you were successful [and the post should have been in the "How to" Section] or unsuccessful [and the post should have been in the 'Programming Section" or "User's Section" with some information about what went wrong.

Having little knowledge of coding, I would have just mounted the SFS, copied it to a folder, deleted LibreOffice from /opt and its desktop from /usr/share/applications. Maybe with the original SFS loaded, used pfind to locate any other files/folders --such as those which may be in /usr/bin-- for deletion. Before loading the new SFS, I would have deleted the /root/.config/libreoffice folder. I wouldn't bother with deleting jpgs/pngs etc. Then dir2sfs the folder.

But then, I wouldn't have included LibreOffice in the first place. It updates too often, and surprisingly the recent updates have made it better --less RAM hungry.

By the way, Libreoffice doesn't cleanly unload. I recently upgraded from using a 6.0 SFS to a 6.1 SFS. I ran pfind while writing this post and discovered a 6.0 folder in /opt with some sub-folders (all otherwise empty) and some broken symlinks to 6.0 icons remaining in /var/local.
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2539
Location: In The Way

PostPosted: Wed 26 Dec 2018, 15:57    Post subject:  

Hi mike

Interesting scenario. I said Office (not which office, libre or wps for eg
) but it could have been Wifi-TrayNet.sfs or chrome.sfs. TIhe actual use for me is that I am using fatdog on a 2gb ram atom pc. I have Ardour, Flowblade, AnyDesk, FKTranskript, PDFeditor-4.0, Wifi-TrayNet and other smaller sfs modules in one 'apps'.sfs @ 695mb. Which I can load on most systems, no searching around for individual modules. For some reason I had to remove one package, and I tried to use this script .... tried and succeeded!

It is a working script which provides a utility, not a how to.

I am pretty sure it is in the most appropriate place!

regards
stemsee
Back to top
View user's profile Send private message MSN Messenger 
mikeslr


Joined: 16 Jun 2008
Posts: 3536
Location: 500 seconds from Sol

PostPosted: Wed 26 Dec 2018, 16:25    Post subject:  

Hi stemsee,

As I said "Not that I know enough about coding". But you're right. As a script which works and should prove useful, it's appropriately located in "Utilities". Smile
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0387s ][ Queries: 11 (0.0091s) ][ GZIP on ]