No capability to remove boot media with a savefile

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

No capability to remove boot media with a savefile

Post#31 by Rava » 19 Nov 2023, 01:13

Ed_P wrote:
17 Nov 2023, 22:57
Does the changes script you reference beny use the /etc/changes-exit.conf file when it is run?
since this is the code creating the module

Code: Select all

mksquashfs $ch $1 -e dev tmp mnt
I very much assume it is not using /etc/changes-exit.conf - and is also not removing any .wh* files.
I never use any changes= cheat code.
And I use my own script that handles my two settings modules - 991-usr_local_bin_YYYY-MM-DD.xzm and 992-rootcopy_5.0_YYYY-MM-DD.xzm
And it uses the current date for "YYYY-MM-DD" each new day.
And it only saves settings and other files I copied to certain predefined locations, not anything from the live system.
Cheers!
Yours Rava

User avatar
KingJames
White ninja
White ninja
Posts: 25
Joined: 26 Nov 2022, 17:20
Distribution: porteus5.0

No capability to remove boot media with a savefile

Post#32 by KingJames » 06 Dec 2023, 04:10

Wow thanks y'all! I was able to modify my previous script using beny's script, and I was able to save changes made for that session. I also followed Ed_p's advice, and moved my previous changes module to a new name, and create a new changes module every shutdown. However, I found out that each time I make a new changes module, only changes made that session are saved, as best I can figure.

Am I right? Does the /mnt/live/memory/changes folder only track changes made this session, or does it keep track of previous changes loaded from a module as well? (Honestly I can't think of a way it can)

Assuming this is true, I don't want to create a module for every session and keep all of them in porteus/modules. That would result in almost as many modules as the number of times I boot my computer, the way I have it set up. Is there a better way of doing it? Or will I just need to manually merge modules every so often?
Porteus 5.0. I'm still learning linux. I hate Big Tech spying on me and I like open source. I am really enjoying Porteus. I keep it on a thumb drive and I copy to ram in less time than it takes Windows on my hard drive to boot up.

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

No capability to remove boot media with a savefile

Post#33 by Ed_P » 06 Dec 2023, 06:20

KingJames wrote:
06 Dec 2023, 04:10
However, I found out that each time I make a new changes module, only changes made that session are saved, as best I can figure.

Am I right?
Yes but changes from your previous boot should be present if you added their module to the /modules folder. They will be included with the new changes.
KingJames wrote:
06 Dec 2023, 04:10
Is there a better way of doing it? Or will I just need to manually merge modules every so often?
Not all runs of Porteus create changes that need to be kept. When you speak of your changes file are you talking about a save.dat file or a xzm file? Either way, if you create a changes file, make it a xzm file and add it to your /modules folder the next time you reboot your changes are present and if you make a new changes file the changes in the file in your /modules folder will be included in the new file.

How are you creating your changes file? If you're referring to a save.dat file type of changes file copy the file to your /modules folder and add a .xzm to it's name. The changes in it will be included in your system the next time you boot.
Ed

User avatar
KingJames
White ninja
White ninja
Posts: 25
Joined: 26 Nov 2022, 17:20
Distribution: porteus5.0

No capability to remove boot media with a savefile

Post#34 by KingJames » 06 Dec 2023, 06:37

Hmm. Okay, maybe I'm doing it wrong. I'll keep trying.

I'm speaking only of modules, that is, a .xzm file.

Here are the pertenant parts of my script:

Code: Select all

#!/bin/bash

# Drive with savefile.
driveUUID="8597-89E4"
driveLABEL=JRC_D5

# Mounting location.
mountpoint=/mnt/saveDrive

#  Savefile location.
savefile=/porteus/modules/changes.xzm


#  Make copies.
mv $mountpoint$savefile.old $mountpoint$savefile.old2
mv $mountpoint$savefile $mountpoint$savefile.old
echo
echo

#  Save changes.
mksquashfs /mnt/live/memory/changes $mountpoint$savefile -e dev tmp mnt
There's some other stuff in my copy, mostly dealing with mounting the drive automatically. Anyway, this would be copied into rc.local_shutdown.
Porteus 5.0. I'm still learning linux. I hate Big Tech spying on me and I like open source. I am really enjoying Porteus. I keep it on a thumb drive and I copy to ram in less time than it takes Windows on my hard drive to boot up.

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

No capability to remove boot media with a savefile

Post#35 by Ed_P » 06 Dec 2023, 07:06

KingJames wrote:
06 Dec 2023, 06:37
# Savefile location.
savefile=/porteus/modules/changes.xzm
Ok. What is the code to copy changes to the savefile? Whatever is saved there should be reapplied when the file is activated.

Added in 9 hours 48 minutes 56 seconds:
I primarily run Porteus in 2 modes; 1 where I update files & settings and save the changes, and one which I call my save mode which runs with my changes module and I don't create a new module.

I create my changes module with code like this:

Code: Select all

if [ -d /tmp/mod/ ]; then
   rm -rf /tmp/mod
fi
mkdir -p /tmp/mod

# copy modified files
#                  -- File Manager - nemo - bookmarks --
cp -a --parents          /root/.config/nemo*                      /tmp/mod/
cp -a --parents          /root/.config/gtk-3.0/*                  /tmp/mod/
cp -a --parents    /home/guest/.config/nemo/*                     /tmp/mod/
cp -a --parents    /home/guest/.config/gtk-3.0/*                  /tmp/mod/
and this:

Code: Select all

dir2xzm  /tmp/mod /tmp/$MOD.xzm   &&   rm -rf /tmp/mod]
With the changes module active when I run in my update mode all my prior changes are present and any new changes will be included when I create my new changes module.

hth :)
Ed

Post Reply