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: 4914
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

No capability to remove boot media with a savefile

Post#16 by Rava » 31 Aug 2023, 03:34

^
That settles it, then. The solution already exists, you are just unable to find it.

Still you request me coding it anew. Quick audacious of you, instead of, you know, doing the obvious and finding and looking at the already existing solution.
Cheers!
Yours Rava

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

No capability to remove boot media with a savefile

Post#17 by Ed_P » 31 Aug 2023, 03:43

You are by far the better coder and even have a whole thread backing that up: Ravas coding goodies. I don't.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 4914
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

No capability to remove boot media with a savefile

Post#18 by Rava » 31 Aug 2023, 03:47

Ed_P wrote:
31 Aug 2023, 03:43
You are by far the better coder and even have a whole thread backing that up
That might be, but you ignore the elephant in the room:
Rava wrote:
31 Aug 2023, 03:34
The solution already exists […]
[D]oing the obvious and finding and looking at the already existing solution.
Please answer the obvious and no moving the goalpost.
Cheers!
Yours Rava

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

No capability to remove boot media with a savefile

Post#19 by Ed_P » 31 Aug 2023, 05:37

I believe the system shutdown uses the /etc/rc.d/rc.6 and /mnt/live/cleanup files. A reference to changes-exit.conf is on lines 38 and 40 of the cleanup file.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 4914
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

No capability to remove boot media with a savefile

Post#20 by Rava » 31 Aug 2023, 06:36

Ed_P wrote:
31 Aug 2023, 05:37
I believe the system shutdown uses the /etc/rc.d/rc.6 and /mnt/live/cleanup files. A reference to changes-exit.conf is on lines 38 and 40 of the cleanup file.
indeed, it is the section of

Code: Select all

# Save 'changes=EXIT:' session:
There you have the code you need to examine:

Code: Select all

  if [ "$ans" = "" ]; then
	DEST=`cat /tmp/changes-exit`; NAME=`basename $DEST`; MNAME=/memory/images/changes; FOLDERS=`grep '^/' /union/etc/changes-exit.conf | sed s/^.//g`
	echo "saving changes to $NAME - do not power off the PC"
	cd /memory/changes; rm -rf var/lock/subsys/* var/run/laptop-mode-tools/* `grep '^!' /union/etc/changes-exit.conf | sed s/^..//g | tr "\n" " "`
and the following lines. :)

Added in 55 seconds:
Maybe how /tmp/changes-exit is set up is also of importance.
Cheers!
Yours Rava

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

No capability to remove boot media with a savefile

Post#21 by Ed_P » 02 Sep 2023, 05:27

Rava wrote:
31 Aug 2023, 06:37
Maybe how /tmp/changes-exit is set up is also of importance.
/mnt/live/init & /mnt/live/linuxrc Lines 154, 273, 284.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 4914
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.0 x86_64 + 4.0 i586
Location: Forests of Germany

No capability to remove boot media with a savefile

Post#22 by Rava » 02 Sep 2023, 07:25

^

Code: Select all

root@porteus:/# head -n 3 /mnt/live/init
#!/bin/sh
### linuxrc script by brokenman <http://www.porteus.org>

root@porteus:/# 
Wow. made by our famous (now retired) brokenman himself, seemingly without any needed changes.

Added in 1 minute 3 seconds:
At least there are no documented changes according to the initial code lines.
Cheers!
Yours Rava

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

No capability to remove boot media with a savefile

Post#23 by Ed_P » 07 Sep 2023, 21:42

Rava wrote:
30 Aug 2023, 05:09
Cave! Be aware that most likely in /home there are quite some files you do not want to save, e.g. the often quite large ~/.cache/ .
It looks like this would be easier to impliment.
https://forum.porteus.org/viewtopic.php?p=86214#p86214 wrote:
Rapha_ wrote:
19 Dec 2021, 18:36
- excluding the cache folder
:o I like this idea Rapha_. :happy62: :good:

In my changes.sh script I changed my

Code: Select all

sudo -S find /mnt/live/memory/changes  -iname "*" -mmin -$X
line to be

Code: Select all

sudo -S find /mnt/live/memory/changes  -not -path "*/.cache/*"  -iname "*" -mmin -$X
Ed

Post Reply