How to make/configure script to extract, ecit and compress initrd.gz ??
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to make/configure script to extract, ecit and compress initrd.gz ??
OK
hey gang, haven't been here lately
working hard on my Lenny&3/4 debian live fluxbox edition
Now, I have totally modified the fluxbox desktop, modified and made a new remastersys
script(s), and have done some innovative things with the fluxbox styles and gkrellm styles
Instead of having "styles" folders in both /home and /root, and instead of having the same thing for all the gkrellm themes in both /home and /root
I made symlinks that link both to /usr/share/
Now, everythings great and the remastersys gui will now make a syslinux folder as well
anyway, I need a part of the remastersys script to extract,edit, and re-compress the initrd.gz
heres where I'm at
in this line of the script
it copies the kernel and initrd.img- to the working dir and makes the initrd.img into a initrd.gz
Code:
# make a new initial ramdisk including the live scripts
update-initramfs -t -c -k $(uname -r)
echo "Copying your kernel and initrd for the livecd"
cp /boot/vmlinuz-$(uname -r) $WORKDIR/ISOTMP/503box/vmlinuz
cp /boot/initrd.img-$(uname -r) $WORKDIR/ISOTMP/503box/initrd.gz
now, here I need the script to extract the initrd.gz, edit it and then compress it
at this point the initrd.gz is extracted in the folder "tree"
I then need to edit the script "live" in /tree/scripts/
so it says the booting dir is "503box"
instead of "live"
and change the "live-rw" to "503box-rw"
after editing it will remake the initrd.gz
Code:
find . | cpio -o -H newc | gzip -9 ../initrd.gz
and thats it
I just need to know how to make the script auto-edit the initrd.gz for me??
thanks
You could make a bash script for that, just paste in all the commands as you're writting them, and for the editing, in which file must you edit that?
Anyway, for the editing of files through bash scripting, better wait for someone else, I'm not good like that in 'em...yet.
well, see the only part I'm stuck on is how to word the script so nano or leafpad opens up and you can then input/edit thee extracted initrd.gz, before its recompressed.
so, how do I call up a text editor from the script?
I would set the global var for the editor, I usually use a case statement & ask for user input. Though if you want it to automatically open nano or vi, then export the global EDITOR var.
Code:
export EDITOR=nano
nano /tree/script
or
cat << "END"
Which editor would you like to use
1- for nano
2- for vi
END
read key
case $key in
1) export EDITOR=nano
nano /tree/script ;;
2) export EDITOR=vi
vi /tree/script ;;
esac
Many different ways to do it... Just export the global EDITOR var and your set.
Last edited by manwithaplan; 10-21-2009 at 02:18 PM.
Your the Man!
thats what I'm talking about
my bash is still rough
remastersys uses gtkdialog I believe
would that work?
I want to integrate all this into the remastersys app so
when you make your remastersys backup/iso
it will let you choose how it boots
either via default debian live
which searches for a folder named "live" and a persistency file named "live-rw"
or you can choose a custom name for each
see, this is the part of the script "live" found in any debian live initrd.gz/scripts/
now, you can change the parameter
LIVE_MEDIA_PATH="live"
to whatever, I named mine "503box", and "503box-rw", so then i can boot alongside any debian live/grml, without any problems.
thats what I want to happen, for the end user to be able to edit the extracted initrd.gz
before remastersys finishes
thus customizing the customization
I dont have much experience with gtkdialog, though I have written a Funtoo installer with basic dialog. My bash also is novice, and I happened to recently build a script for installing pacman into my CLFS, and wanted to add an editor, so I tried this exporting the var and it worked...
I have been learning, and have been using pygtk. I have written a couple basic pygtk programs to edit my system config files and shutdown, suspend apps...
In gtkdialog, I bet you could open the file in a gtk window to edit... All gui like. I prefer pygtk, because I can import gtk, tk and bash and other gtk apps.
Or, you can declare the "LIVE_MEDIA_PATH=" variable at the beginning of the script, and ask for the user input. That way you can transparently rename the "LIVE_MEDIA_PATH=" using a sed.
Last edited by manwithaplan; 10-21-2009 at 04:30 PM.
When are you going to update your multidistro toolkit..? I'm impressed with those screenshots. Even though I do use a separate drive for backups, I could use a separate toolkit distro on a disc. If you added clonezilla to the mix, that would be nice.
well, I've been working on my 503box "pocketwriter" linux
trying either ubuntu-9.04 and debian lenny&3/4
I got lenny done, thats the screenshots above^
and, what toolkit?
ThorsHammer?
I know, I need to update it
its got pmagic, which has clonezilla
you want a special cut of what?
what distros you want?
I'm gonna upload my alpha of lenny&3/4 fluxbox tonite
you want link in morning?
it install to usb with unetbootin easy
and to hd via remastersys-install
goodstuff
Ya, I was referring to Thor's hammer (your right about partclone)... My usb thumb drive stopped working recently, so I can only do a hd install.
I wouldn't mind checking out what you've done with lenny, those screenshots look really nice. Have you thought of using the Debian (Sid) testing branch..?
I see that you use gkrellm, what about conky ...? Post a link to your alpha build, and I'll give it a try.
you can "install" thorshammer to hd by just copying iso contents to hdd and installing grub to that partition.
uh, squeeze and sid both ahave issues regarding squashfs-modules, which is essential for either
live-magic or remastersys
I actually have added some squeeze stuff, like flash,etc manually
thats why I call it Lenny&3/4
its got iceweasel, opera
remastersys, live-magic
unetbootin
k3b
pcmanfm
lots of stuff
you can install start conky with fluxbox
via the startup script in /home/.fluxbox & /root/.fluxbox
heres part at startup
Code:
# Applications you want to run with fluxbox.
# MAKE SURE THAT APPS THAT KEEP RUNNING HAVE AN ''&'' AT THE END.
printinfotext "Running startup apps..." &
#yeahconsole --perl-lib ${HOME}/.urxvt-perl/ -pe tabbed &
systray-volume-control &
xset r rate 250 40 &
# xflux -z 22942
yakuake &
fbpanel &
gkrellm &
# conky -d &
so, just uncomment conky and comment gkrellm
I didnt setup conky though
its got like 30 gkrellm themes
and alot of fluxbox styles too
xflux is very cool
just use -z for zipcode
or -l for latitude
it adjusts the color temp of your monitor
very cool and easy on the eyes
Code:
--------
Welcome to xflux (f.lux for X)
This will only work if you're running X on console.
Usage: xflux [-z zipcode | -l latitude] [-k colortemp (default 3400)]
protip: Say where you are (use -z or -l).
Just got to it ... going to try it tonight. I'll make a 1G file and and make rw, and give it a try. This could be handy for the netbook users that need a persistent OS, without all the bloat. I'll post feedback later tonight.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.