How To Symlink Across Pupsaves/Installs

Moderator: Forum moderators

Post Reply
geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

How To Symlink Across Pupsaves/Installs

Post by geo_c »

As per @bigpup's suggestion in this topic: https://forum.puppylinux.com/viewtopic.php?t=6257 I'm creating a new topic on the symlinking of themes, configurations and system/application files outside the pupsave to be used by other pupsaves and installs of the same puppy distro, or similarly based distros and re-masters.

Let's say that you have more than one pupsave for different computers, users, or variations of a distro (as in sometimes using a standard distro like fossapup and other times a re-master of fossapup for specialized purposes -- I do this frequently because I use @puddlemoon's jackalpup remaster of fossapup for pro-audio, but standard fossapup on less powerful machines that I use for daily business) In this scenario keeping changes to application configurations, themes, and other settings can be a full time job in that I may create a new look with jwm or gtk in my standard fossapup daily save, and then want to replicate it in my jackalpup save. I could copy all the files from one save to another, and that works fine. But I've developed another approach: symlinks to a directory on the "home" drive. This not only keeps changes consistent between saves and installs, but also keeps the pupsave sizes smaller.

Here's a basic example in fossapup:

JWM stores it's theme files in /root/.jwm/themes. I share this directory with different pupsaves in the following manner.

1) Create a directory on the home drive for shared systems. I call mine linxsys
2) Inside the linxsys folder I begin to create a mock directory structure of files that will be shared between pupsaves, and I keep it all straight by naming the top folder in the mock structure by appending the folder name with a dash "-"

First create the 'mock' /root directory
/mnt/home/linxsys/root-

Then the /.jwm directory underneath it
/mnt/home/linxsys/root-/.jwm

Then the /themes directory underneath
/mnt/home/linxsys/root-/.jwm/themes

3) Now that I have a jwm themes folder established outside my pupsave on the home directory, I'm ready to copy my /root/.jwm/themes/*.* files into it using whatever file manager is preferred. In ROX open two windows, one to the actual /root/.jwm/themes folder and the other to the mnt/home/linxsys/root-/.jwm/themes folder, then simply select all of the files in /root/.jwm/themes with the mouse and drag them to the newly created /mnt/home/linxsys/-root/.jwm/themes folder. When prompted choose "copy."

4) At this point I'm ready to symlink the folder in my pupsave to the folder outside the pupsave on the home drive. To be safe I'll create a backup of the themes folder, so I select /root/.jwm/themes in ROX, right-click the folder, and select menu>Dir 'themes'>Duplicate and name the duplicate folder something like themes-BKP.

5) Delete the actual folder root/.jwm/themes and then we're ready to symlink.

6) In ROX drag the /mnt/home/linxsys/root-/.jwm/themes folder to /root/.jwm and when prompted choose "link (absolute)"

7) Test to see that it all works, use JWMdesk to change jwm themes. All of the themes should appear in the theme changer dialog.

8) To share this with other pupsaves, reboot into a different pupsave and repeat steps 4-7.

This works well for me. I use it for all sorts of applications and browsers. Because I use a LibreWolf appimage for instance, which unlike @mikewalsh's portables does not have a script to save the LibreWolf profile and cache folders in it's own portable directory, I symlink those to my /mnt/home/linxsys/root- directory and that keeps my pupsave smaller, and quicker to backup. It also allows me to boot into different pupsaves which are also symlinked so all of the bookmarks and history, etc are shared between systems. This works with a multitude of applications and systems, BUT a word of caution:

You certainly need to take care in understanding your applications, which files are necessary to symlink, and which files are unique to a specific pupsave, especially in the case of system configurations. Backups of the pupsave are always recommended to fall back when moving and linking these kinds of files.

Syncing these files between different machines only requires the use of rsync, or grsync to keep the /mnt/home/linxsys folder up to date. When working on one computer, and making changes to these files, I will sync the folder using a usb storage medium. Using these methods I'm able to keep several computers and installs completely in sync. I'll explain my method in subsequent posts.

Last edited by geo_c on Mon Aug 29, 2022 10:06 pm, edited 5 times in total.

geo_c
Old School Hipster, and Such

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

*reserved

geo_c
Old School Hipster, and Such

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: How To Symlink Across Pupsaves/Installs

Post by mikewalsh »

@geo_c :-

Sorry to hijack your thread like this, but seeing mention of the LibreWolf browser made me realise that I hadn't updated the portable version for some time! Do you want to give it a try?

If interested, you can find it here:-

https://mega.nz/folder/PLIUiBjJ#d-zkYbc7_GFEAAmt7tWUDg

This is LibreWolf 104. The usual scripts allow adding a menu entry, if so desired.

Up to you, of course.

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

mikewalsh wrote: Tue Aug 30, 2022 12:09 am

@geo_c :-

Sorry to hijack your thread like this, but seeing mention of the LibreWolf browser made me realise that I hadn't updated the portable version for some time! Do you want to give it a try?

If interested, you can find it here:-

https://mega.nz/folder/PLIUiBjJ#d-zkYbc7_GFEAAmt7tWUDg

This is LibreWolf 104. The usual scripts allow adding a menu entry, if so desired.

Up to you, of course.

Mike. ;)

Sure, I'll give it a whirl. I seem to remember you saying that you would discontinue the LibreWolf portable, which I was surprised because it's always been a solid browser. That's why I went with the appimage, which is an easy update because of my symlinked profile folder that's in the same directory. Essentially I have been doing what you do without a script or menu entry. I made a desktop file for it, and I launch it from panels, desktop, and applications that allow it like Xfe.

Last edited by geo_c on Tue Aug 30, 2022 3:22 am, edited 1 time in total.

geo_c
Old School Hipster, and Such

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: How To Symlink Across Pupsaves/Installs

Post by mikewalsh »

@geo_c :-

You're "standing on the shoulders of giants" with all this externally-linked stuff, y'know..! Davids45 pioneered this stuff a good decade back, and for a while I, too, made use of an 'external file-system'.

It'll still work better for certain things, anyway. You can't apply the 'portable' principle to everything, because it's not always practical to do so. :D

Let me know how you get on with that LibreWolf-portable, please. (I may have said I was going to discontinue it for the simple reason that there's a limit to just how many different apps I CAN maintain....) The beauty of using the AppImage, of course, is that to update all the user needs to do is to download the new version from the LibreWolf site, then re-name & substitute it in the portable for the old one.

Simples!

(*shrug*)

Mike. :thumbup:

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

mikewalsh wrote: Tue Aug 30, 2022 1:37 am

@geo_c :-
You're "standing on the shoulders of giants" with all this externally-linked stuff, y'know..! Davids45 pioneered this stuff a good decade back, and for a while I, too, made use of an 'external file-system'.

Well, I intend to expand on the logic and usage specifics. At one point I thought to myself that basically the whole "pupsave" functions as a portable OS. So when I post my system syncing strategy in the *reserved post I will explain that I transfer my pupsaves from machine to machine. In other words, my system is portable primarily from the pupsave, but then there's an added layer of portability as the system grows. The external system stores application config folders, the things that change as I customize them, account settings, email caches, things of that nature. Those are a combination of configurations and data that are constantly in flux and tend to grow in storage size. They are also the things that I can restore quickly if I decided to boot a fresh clean puppy and start over. I can install the applications I would like to keep in the fresh pup, and symlink to the meticulously configured folders and data that I had been using previously.

The installed applications remain in the pupsave, in /usr/bin, /etc, /opt, or wherever, but the setup and data files are symlinked. It's a customization technique I suppose. It creates amazing consistency and speed across devices and installs.

I have a folder /mnt/home/linxsys/usr-/share/themes which is full of gtk2/3 themes, some of them rather large. Instead of storing them in the pupsave and repeatedly copying those files in the pupsave from machine to machine, I just store them in the /home/linxsys. So they are copied once to each machine, then kept up to date with rsync. Much faster.

The same goes for the icons in /usr/local/lib/X11. I have a lot of them, and they are enormous.

So the linking strategy is just that, a personalized strategy based on the kinds of data that may be changed more often than the pupsave needs to be backed up (which is really only when a lot applications have been added, or major configurations have been changed) The rest can reside as a large data folder that is kept up to date with rsync.

In fact, I began to think that instead of backing up a pupsave, copying it to usb, then copying to another machine, perhaps I should just rsync the pupsave. I'm not sure what the pitfalls of that might be however. I'd like to look at the pupsave backup script, because I think it's an rsync function at the core.

Last edited by geo_c on Tue Aug 30, 2022 5:32 am, edited 1 time in total.

geo_c
Old School Hipster, and Such

williwaw
Posts: 1594
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 291 times

Re: How To Symlink Across Pupsaves/Installs

Post by williwaw »

geo-

lately, I have been using a method that only uses one symlink.

I have a script at mnt/sda2/portable, alongside various configuration files kept in the same directory
my save file has a single link in /root/Startup that points to the script.
the script has things like
cp /mnt/sda2/portable/.bashrc /root/.bashrc
cp /mnt/sda2/portable/.Xdefaults /root/.Xdefaults
cp /mnt/sda2/portable/jwmrc-personal /root/.jwm
source /root/.bashrc
jwm -restart
wget -O /etc/hosts https://raw.githubusercontent.com/Steve ... ster/hosts

and others, that basically overwrite any configs I don't need in the sfs or that creep into the save over time if I have made a save (I rarely do)

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

williwaw wrote: Tue Aug 30, 2022 5:14 am

geo-

lately, I have been using a method that only uses one symlink.

I have a script at mnt/sda2/portable, alongside various configuration files kept in the same directory
my save file has a single link in /root/Startup that points to the script.
the script has things like
cp /mnt/sda2/portable/.bashrc /root/.bashrc
cp /mnt/sda2/portable/.Xdefaults /root/.Xdefaults
cp /mnt/sda2/portable/jwmrc-personal /root/.jwm
source /root/.bashrc
jwm -restart
wget -O /etc/hosts https://raw.githubusercontent.com/Steve ... ster/hosts

and others, that basically overwrite any configs I don't need in the sfs or that creep into the save over time if I have made a save (I rarely do)

Interesting, almost like loading an .sfs. The sfs would overwrite what's there, but then changing those files would require creating a new sfs, whereas this just overwrites. When it comes to some of the files I use, like the hefty icon library and theme stuff, along with cache directory for email and browsers, that might take a half minute or two.

Now if your script created symlinks to those files instead of copying and overwriting the system files, then your changes would be automatically saved for next boot.

geo_c
Old School Hipster, and Such

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: How To Symlink Across Pupsaves/Installs

Post by mikewalsh »

@geo_c / @williwaw :-

This is, of course, one of Pup's 'secret weapons'. Having a very powerful - and "easy-to-use" - sym-link function available to the user opens up all kinds of possibilities. David and I also did some experimenting, and found out it was entirely possible to create .pet packages that consisted of nothing BUT sym-links.....making the quick implementation of so much stuff when setting-up another Puppy a real doddle.

I dare say you could do all this with other Linux distros. But I doubt any of those would be able to implement this stuff with anywhere near the ease that Puppy bestows.....

Yet another thumbs-up for "our Pup"! :D

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

mikewalsh wrote: Tue Aug 30, 2022 10:07 am

@geo_c / @williwaw :-
David and I also did some experimenting, and found out it was entirely possible to create .pet packages that consisted of nothing BUT sym-links.....making the quick implementation of so much stuff when setting-up another Puppy a real doddle.
Mike. ;)

When I was spending so much time working on a theme switching package with scripts, at the time I only used @williwaw's method of copying the files. Forum members who were concerned about the size of my themes didn't care for that approach, and I've since figured out that gtk-themes, jwm-themes, and some icons don't need to be stored in the pupsave, they can be symlinked, I began to think that I could pretty quickly put together a "portable theme pack" which would be a folder residing on 'home' and the install script would simply the copy the symlinks to the pupsave. It's how my systems run and it's very smooth. My package would have about 40-50 gtk themes, and 10-20 jwm themes, and some icon sets.

My theme/icons folders are symlinked to Fossapup, Jackalpup, Bionic Pup, and KLV-Airedale and work in all four, only needing one instance of the very big folder on the home drive.

geo_c
Old School Hipster, and Such

williwaw
Posts: 1594
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 291 times

Re: How To Symlink Across Pupsaves/Installs

Post by williwaw »

geo_c wrote: Tue Aug 30, 2022 5:23 am

Interesting, almost like loading an .sfs. The sfs would overwrite what's there, but then changing those files would require creating a new sfs, whereas this just overwrites. When it comes to some of the files I use, like the hefty icon library and theme stuff, along with cache directory for email and browsers, that might take a half minute or two.

Now if your script created symlinks to those files instead of copying and overwriting the system files, then your changes would be automatically saved for next boot.

I use a blended approach to keeping a directory with scripts and apps to be used with any pup. Some of the heftier apps like browsers and email clients with large storage directories run as portables from /mnt/sda/

in the case of using your own configs for say a firefox browser which is included in the main sfs, one might fire up the browser by clicking on a script which includes something like...

Code: Select all

rm -rf /root/firefox/.cache/mozilla /root/firefox/.mozilla
ln -s portable/ff/.mozilla /root/firefox/.mozilla
geo_c
Posts: 2501
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 1799 times
Been thanked: 705 times

Re: How To Symlink Across Pupsaves/Installs

Post by geo_c »

mikewalsh wrote: Tue Aug 30, 2022 12:09 am

@geo_c :-
I hadn't updated the portable version for some time! Do you want to give it a try?
If interested, you can find it here:-
https://mega.nz/folder/PLIUiBjJ#d-zkYbc7_GFEAAmt7tWUDg
This is LibreWolf 104. The usual scripts allow adding a menu entry, if so desired.
Up to you, of course.

Mike. ;)

Just to report, I finally fired up the portable and for some reason it never launches. The script creates the folder in /root/.librewolf, but the browser doesn't open. Not sure if it's my setup, because I still have my appimage on the system, and my symlink to my appimage /.librewolf folder was removed, so it should have worked. But like I said could still be on my end.

I went back to the appimage just by removing the portable-script created /.librewolf folder and symlinking my appimage folder again. I updated my appimage to version 104 just by dropping the new appimage in, which is super-duper easy.

So, no urgency on my part to get the portable working, but just I wanted to let you know the results.

geo_c
Old School Hipster, and Such

Post Reply

Return to “File Management”