How to run script before quicksetup runs

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

How to run script before quicksetup runs

Post by greengeek »

I would like to run a script (or cli command) during first system boot - prior to quicksetup running.

How/where can I run this script/command?

Does it need to be somewhere in the initrd.gz?

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

Re: How to run script before quicksetup runs

Post by mikewalsh »

@greengeek :-

Hi, Ian.

I could be wrong - probably am! - but I believe you can do this from /etc/init.d? I think things from here startup before most other things do.

Doubtless others will know better than I..!

Mike. ;)

User avatar
MochiMoppel
Posts: 1232
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 21 times
Been thanked: 437 times

Re: How to run script before quicksetup runs

Post by MochiMoppel »

greengeek wrote: Sat Aug 27, 2022 9:07 am

I would like to run a script (or cli command) during first system boot - prior to quicksetup running.
How/where can I run this script/command?

Depends on your command.
A lot a things happen before /usr/sbin/quicksetup is started from /usr/sbin/delayedrun
, so if you run your command too early in the boot sequence then whatever you are trying to set might be overriden by later commands. If your only condition is to run the command "prior to quicksetup running", why not simply put it at the beginning of /usr/sbin/quicksetup itself ? This also ensures that - like quicksetup - your code runs only once per session.

User avatar
bigpup
Moderator
Posts: 6983
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 903 times
Been thanked: 1522 times

Re: How to run script before quicksetup runs

Post by bigpup »

What is your script doing?

You want it to actually do something, the very first boot of a Puppy version?

Before anything has been setup, for how the Puppy version is going to run?

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

Re: How to run script before quicksetup runs

Post by greengeek »

bigpup wrote: Sat Aug 27, 2022 4:06 pm

What is your script doing?
You want it to actually do something, the very first boot of a Puppy version?
Before anything has been setup, for how the Puppy version is going to run?

Yes - as an example I want to run a command that turns off tap-to-click. I currently have this script in /root/Startup but that does not help me during first boot. (Because /root/Startup scripts only run after the X-restart that occurs after quicksetup runs)

Another example is "Speaker volume".

Puppy defaults to about 2/3 of maximum speaker volume and I want to make sure I have full volume without user intervention.

User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

Re: How to run script before quicksetup runs

Post by greengeek »

MochiMoppel wrote: Sat Aug 27, 2022 1:05 pm

If your only condition is to run the command "prior to quicksetup running", why not simply put it at the beginning of /usr/sbin/quicksetup itself ? This also ensures that - like quicksetup - your code runs only once per session.

Great idea, thanks. Will try this.

User avatar
greengeek
Posts: 1383
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 534 times
Been thanked: 192 times

Re: How to run script before quicksetup runs

Post by greengeek »

mikewalsh wrote: Sat Aug 27, 2022 10:28 am

I believe you can do this from /etc/init.d? I think things from here startup before most other things do.

Ok, thanks. Looks very similar to /root/Startup. Will give that a try.
Cheers!

Post Reply

Return to “Users”