Question about some scripts | remastering 5.4.1

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

Question about some scripts | remastering 5.4.1

#1 Post by dejan555 »

Hey people, sup?

So, I'm remastering puppy precise 541 for use on my laptop.
I'm doing it manually (unsquash sfs / make changes / resquash).
I want to boot remastered version without savefile and I'd like to remove the first shutdown dialog that asks me about saving session.

IIRC when I was remastering dpup for my desk PC it was some part in /etc/rc.d/rc.shutdown that handled this but now I can't find it for the life of me in precise... I did remove one block about saving but I think it was code that executes after you answer the dialog and can't find where is the dialog itself... any help?

For first run wizard was easy there are some flag files that I just created in /tmp and/or /var and now delayedrun script don't offer dialog anymore, want to do same with shutdowndialog so it just powers off without questions.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#2 Post by dejan555 »

I think I just found answer in another thread

EDIT: No, no I didn't I see he uses modified rc.shutdown and it's code for saving to usb which I removed anyway

EDIT2: Found what I needed, aparenty first session save dialog and other saving functions are now in /usr/sbin/shutdownconfig which is called from rc.shutdown, removed code that call the script and some other blocks of code for saving so it now just straight shuts down.

Another question: how can I strip size and remove uneeded hardware modules? I saved whole /etc dir so now my gfx, net and other settings are loaded on boot so, how can I determine which are all modules used and where is directory that has other non-used "drivers" "firmware" or whatever they're called so I can delete them?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
xophist
Posts: 26
Joined: Mon 10 Dec 2012, 17:00
Location: Coastal Texas

#3 Post by xophist »

> I'd like to remove the first shutdown dialog that asks me about
> saving session.

I want to do this too, as I like to avoid pupsave and save what I want manually.


> apparently first session save dialog and other saving functions
> are now in /usr/sbin/shutdownconfig which is called from
> rc.shutdown, removed code that call the script and some other
> blocks of code for saving so it now just straight shuts down.

Immediately after booting up, I mount a drive and run my setup script. I will try adding this to the setup script:

touch /etc/personal_data_save_disabled

I have not tested this, but the existence of this file should have the results we want, according to /usr/sbin/shutdownconfig:

if [ -f /etc/personal_data_save_disabled ];then #120823 rerwin
SAVECHOICE=256 #120823 rerwin: do not save - case *) below
else #120823

It might be days before I reboot, so please let me know if you get a chance to test this. It would require you to use the default shutdownconfig, rather than your hacked version.

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#4 Post by dejan555 »

Thanks, but I already resquashed sfs I still have the previous version though so I could test this, would be usefull to know both ways of making this work.

As far as I see shutdownconfig is all about saving session so calling it from rc.shutdown is not needed at all but adding just one blank file would be much easier for remastering and not risking of messing up script by removing code.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
xophist
Posts: 26
Joined: Mon 10 Dec 2012, 17:00
Location: Coastal Texas

#5 Post by xophist »

If it's true that shutdownconfig is only about saving session data, what follows is the wrong approach. As you said, just don't call shutdownconfig.

But if there is any other cleanup in shutdowconfig, then this could be useful and have fewest side effects:


Tested, and this works the way I like it (immediate shutdown):

1. You need to create the file:

touch /etc/personal_data_save_disabled

2. Then edit /usr/sbin/shutdownconfig. You need to copy the check for the file from case iso9660 to case ext2|ext3 as shown below.


edit /usr/sbin/shutdownconfig

BEFORE
======

case $xDEVFS in
ext2|ext3|ext4|reiserfs|minix|btrfs)

<content for this case here>

;;
iso9660)
if [ -f /etc/personal_data_save_disabled ];then #120823 rerwin
SAVECHOICE=256 #120823 rerwin: do not save - case *) below
else #120823
...



Just copy the check from case iso9660 into case ext2|ext3...)
and don't forget the fi at the end:

AFTER
=====

case $xDEVFS in
ext2|ext3|ext4|reiserfs|minix|btrfs)
if [ -f /etc/personal_data_save_disabled ];then #120823 rerwin
SAVECHOICE=256 #120823 rerwin: do not save - case *) below
else #120823
<content for this case here>
fi # <== don't forget this fi
;;
iso9660)
if [ -f /etc/personal_data_save_disabled ];then #120823 rerwin
SAVECHOICE=256 #120823 rerwin: do not save - case *) below
else #120823
...

Post Reply