No capability to remove boot media with a savefile
- Rava
- 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
^
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.
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
Yours Rava
- Ed_P
- 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
You are by far the better coder and even have a whole thread backing that up: Ravas coding goodies. I don't.
Ed
- Rava
- 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
That might be, but you ignore the elephant in the room:
Please answer the obvious and no moving the goalpost.
Cheers!
Yours Rava
Yours Rava
- Ed_P
- 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
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
- Rava
- 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
indeed, it is the section of
Code: Select all
# Save 'changes=EXIT:' session:
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" " "`
Added in 55 seconds:
Maybe how /tmp/changes-exit is set up is also of importance.
Cheers!
Yours Rava
Yours Rava
- Ed_P
- 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
/mnt/live/init & /mnt/live/linuxrc Lines 154, 273, 284.
Ed
- Rava
- 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
^
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.
Code: Select all
root@porteus:/# head -n 3 /mnt/live/init
#!/bin/sh
### linuxrc script by brokenman <http://www.porteus.org>
root@porteus:/#
Added in 1 minute 3 seconds:
At least there are no documented changes according to the initial code lines.
Cheers!
Yours Rava
Yours Rava
- Ed_P
- 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
It looks like this would be easier to impliment.
https://forum.porteus.org/viewtopic.php?p=86214#p86214 wrote:I like this idea Rapha_.
In my changes.sh script I changed myline to beCode: Select all
sudo -S find /mnt/live/memory/changes -iname "*" -mmin -$X
Code: Select all
sudo -S find /mnt/live/memory/changes -not -path "*/.cache/*" -iname "*" -mmin -$X
Ed
No capability to remove boot media with a savefile
I've been playing around with the /mnt/live/init file, trying to figure out a way to trick the system into setting up saving changes on exit without binding the USB drive permanently. However, I am still very much a script kiddie, and I can't decipher it all.
I did create a custom script that rsync'd all changes in my home folder to the rootcopy directory on my drive, and it worked marvelously. However, I'd like to be able to save changes to the whole system, and I can't rsync the whole system. That would be prohibitively time consuming to copy to ram. Usually, I just save changes to a .xzm file if I change a system file, so it wasn't a problem. However, I'm trying to migrate to a fat32 thumb drive, and I need to sync file permissions too, which requires either a savefile or a module. I can create a savefile, but I don't know how to save to a .dat file manually. I also don't know how to save to a .xzm file without decompressing it, editing it, then recompressing it, which takes quite a while to do (I suspect ~30 seconds if I put it in a script. Too long on shutdown).
What I really want to do is edit some of the startup scripts to trick the built in changes system into thinking there was a drive mounted for changes on exit when there actually isn't. I can then edit the /etc/rc.d/rc.local_shutdown to remount to drive to the correct location so that the /mnt/live/cleanup file can save changes as it normally would.
If anyone has any wisdom to spare I'd really appreciate it!
I did create a custom script that rsync'd all changes in my home folder to the rootcopy directory on my drive, and it worked marvelously. However, I'd like to be able to save changes to the whole system, and I can't rsync the whole system. That would be prohibitively time consuming to copy to ram. Usually, I just save changes to a .xzm file if I change a system file, so it wasn't a problem. However, I'm trying to migrate to a fat32 thumb drive, and I need to sync file permissions too, which requires either a savefile or a module. I can create a savefile, but I don't know how to save to a .dat file manually. I also don't know how to save to a .xzm file without decompressing it, editing it, then recompressing it, which takes quite a while to do (I suspect ~30 seconds if I put it in a script. Too long on shutdown).
What I really want to do is edit some of the startup scripts to trick the built in changes system into thinking there was a drive mounted for changes on exit when there actually isn't. I can then edit the /etc/rc.d/rc.local_shutdown to remount to drive to the correct location so that the /mnt/live/cleanup file can save changes as it normally would.
If anyone has any wisdom to spare I'd really appreciate it!
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.
- Ed_P
- 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
How long do you think this will take when the shutdown finds the USB drive hasn't been reinserted and you have to find it before the system shuts down? As for saving the changes to an .xzm file why decompress the old/current one and rebuild it? Rename the old one and create a new one. I rename mine to mychanges.xyzm and then build a new one when I update the module.
The problem that comes into play is manually remembering to use the USB drive and save changes when shutting down when you don't use the changes=EXIT cheatcode. Of course not all runs of Porteus create things that need to be saved.
Ed
No capability to remove boot media with a savefile
Yeah, if I haven't inserted the drive, it'll take a second to plug it in, but this a minor inconvenience compared to leaving the drive plugged in all the time. The script I currently use searches for the drive by UUID and automatically mounts it. If it's not found, it prompts the user asking whether to continue without saving or re-search (presumably after he has plugged in the drive). That part isn't a problem, even for this basic scripter
I would rather have a prompt on shutdown asking whether or not I wish to save changes for this boot. I could just open the porteus savefile manager and save changes to a file when i want, but it's rather inconvenient to have to do on every boot I change something. If there is absolutely no way to do what I want, then that's fine, don't waste too much time on it, I'll keep trying on my own until I get it.
Alternatively, is there a way I can invoke the porteus manager to save to a file directly from a terminal? If I could do that, I could just invoke it in /etc/rc.d/rc_local_shutdown and rename the old one, as you suggest, problem solved. It'll be kinda slow to create a new changes file every time, I'd rather sync it somehow, but I could live with it.
I would rather have a prompt on shutdown asking whether or not I wish to save changes for this boot. I could just open the porteus savefile manager and save changes to a file when i want, but it's rather inconvenient to have to do on every boot I change something. If there is absolutely no way to do what I want, then that's fine, don't waste too much time on it, I'll keep trying on my own until I get it.
Alternatively, is there a way I can invoke the porteus manager to save to a file directly from a terminal? If I could do that, I could just invoke it in /etc/rc.d/rc_local_shutdown and rename the old one, as you suggest, problem solved. It'll be kinda slow to create a new changes file every time, I'd rather sync it somehow, but I could live with it.
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.
No capability to remove boot media with a savefile
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.
No capability to remove boot media with a savefile
hi,you can use the save-changes script: you have to run this script just before you have to shutdown,porteus or the usb key do not shutdown if it have something to write and if you have a script like rsync maybe work...but
Code: Select all
#!/bin/bash
# Save changes into a module.
# Author: Brokenman <brokenman@porteus.org>
# Switch to root
if [ `whoami` != "root" ]; then
echo "Please enter your root password below"
su - -c "/opt/porteus-scripts/save-changes $1"
exit
fi
echo
ch=/mnt/live/memory/changes
usage(){
echo
echo "save-changes /path/to/resulting/module.xzm"
echo
echo "You must give a path to save your changes to."
}
if [ "$1" == "" -o "$1" == "-h" -o "$1" == "--help" ]; then
usage
exit
fi
# Make sure given path ends in .xzm
if [ `echo $1|awk -F. '{print$NF}'` != "xzm" ]; then
echo
echo "Your path must end in .xzm"
echo "Example: /tmp/changes.xzm"
echo
exit
fi
#dir2xzm $ch $1
mksquashfs $ch $1 -e dev tmp mnt
echo
echo "Your changes module has been created!"
echo "$1"
echo
exit
- Ed_P
- 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
Does rc.local.shutdown get executed if changes=EXIT is not used? When I reboot in my safe system I don't pay much attention to the shutdown screen.
Does the changes script you reference beny use the /etc/changes-exit.conf file when it is run?
Does the changes script you reference beny use the /etc/changes-exit.conf file when it is run?
Ed
No capability to remove boot media with a savefile
hi Ed_P no this script a lot of time ago is used to make the packages of nvidia and other huge software in a clean system,so it is another task,but you can use to manage the changes