scripts to extract and store files in initrd.gz

Miscellaneous tools
Post Reply
Message
Author
gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

scripts to extract and store files in initrd.gz

#1 Post by gyro »

These are some scripts I wrote to make it easier to work on specific files within an initrd.gz. I publish them here just in case they are useful to others.

initrd-extract.sh: extract a file from an initrd.gz, used by the following 2 scripts
extract-bootconfig: extract "BOOTCONFIG" from an initrd.gz
extract-init: extract "init" from and initrd.gz

initrd-replace.sh: replace a file in an initrd.gz, used by the following 2 scripts
store-bootconfig: replace "BOOTCONFIG" in an initrd.gz
store-init: replace "init" in an initrd.gz

gyro
Attachments
initrd-scripts.tar.gz
In any directory, "tar xzf initrd-scripts.tar.gz" to extract the 6 files.
(916 Bytes) Downloaded 649 times

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#2 Post by nooby »

Hope it is okay to ask you to give some example what one can do with it.

Can I take out SeaMonkey and replace it with Firefox or what kind of changes does it allow?
I use Google Search on Puppy Forum
not an ideal solution though

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#3 Post by gyro »

These scripts are only useful for people modifying files that are contained within the file "initrd.gz".
No, the scripts cannot be used to add or remove applications.
I use them when modifying the "init" script that loads the various sfs files that are puppy. It means I can easily inject a different version of the "init" script into an "initrd.gz" file. This is the script that gets modified to add or remove support for boot parameters, or add support for ext3/ext4 pupsave files.

NOTE: To get some help on the parameters required by the scripts, just enter the name of the script file without any parameters.

gyro

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#4 Post by abushcrafter »

Thanks. What about having these scripts in the "devx" SFS?
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#5 Post by gyro »

abushcrafter wrote:Thanks. What about having these scripts in the "devx" SFS?
The powers that be, are free to make use of my code in any way that they might find useful. But I have no control over what goes into "devx".

gryo

User avatar
abushcrafter
Posts: 1418
Joined: Fri 30 Oct 2009, 16:57
Location: England
Contact:

#6 Post by abushcrafter »

gyro wrote:
abushcrafter wrote:Thanks. What about having these scripts in the "devx" SFS?
The powers that be, are free to make use of my code in any way that they might find useful. But I have no control over what goes into "devx".

gryo
I know. I was making the suggestion too the main puppy devs that might be reading this thread. Though I should mention this in there threads for that I guess...
[url=http://www.adobe.com/flashplatform/]adobe flash is rubbish![/url]
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

now supporting DISTRO_SPECS

#7 Post by gyro »

Added support for DISTRO_SPECS. and updated initrd-replace.sh so that the "bak" file is ".bak.gz" not ".gz.bak"

extract-distro-specs:
extract "DISTRO_SPECS" from an initrd.gz

store-distro-specs:
replace "DISTRO_SPECS" in an initrd.gz
Attachments
initrd-scripts.tar.gz
use "tar xzf /path/to/downloaded/initrd-scripts.tar.gz" in the directory where you want them to go.
(1.04 KiB) Downloaded 623 times

Post Reply