How can I edit initrd.gz in puppy 2.0x?
I need to change one letter in a file, remasterpup2, in initrd.gz in 2.00 and/or 2.01. Like my Mandriva 2005, puppy 2.0x will not burn a good iso, though 1.06 did fine. I finally traced it to tao mode, dao works fine. In Mandriva, I simply changed k3b write mode to DAO, and saved my settings.
In puppy, it was necessary to edit burniso2cd script file so each cdrecord had a -dao after it.
I chose to run remasterpup2 to save the editing. OOPS!!! remasterpup2 script file has -tao after cdrecord, and remasterpup2 is located in initrd.gz. So, no editing while running puppy. Thus, I did not get a good iso burn on the cd.
I opened the iso file as loopback file in Mandriva, and can see the basic file contents, but attempts to extract initrd.gz have failed.
Any ideas how to open initrd.gz? It looks so easy, so it may be a standard idiot mistake. Thanks.
To edit initrd.gz in linux you will have to:-
If you have an .img extenstion:-
gunzip -S .img initrd-2.6.X.img
cpio -imdF initrd
And you get the contents of initrd which you can change to the content of your heart!
Hope, this helps you
An additional suggestion...
If you run into further problems with editing the file you can also try asking in the main Puppy forum in the user or bugs forum - lots of people experienced in working with and remastering Puppy there. Also when you burn the CD from your finished image remember to use the lowest speed setting possible - I use a program called BurnCDCC from Terrabyte which will allow speed settings as low as 4x. The program is a free download and does nothing but burn ISO's to disc. If you use MS Windows at all it by far the simplest way to make bootable discs.
Thanks for tips...
I have been working with some vigor on this problem, from several directions. If I can't find other help that works, I will go back to puppy forums. The problem is those forums seem to take turns being dead, seriously. This week two of the three were dead at the same time. This tends to discourage me a bit.
I have learned my problem with initrd.gz is the loopback mounted file is READ-ONLY. So, though I can copy initrd.gz and gunzip does extract it, until I can figure out how to put it back, it is a waste of time. It just seems there should be a way to change a loopback file to write, I even mounted it once with a command I saw via google, ...loop,rw... and it didn't object, but it also did not mount as write mode.
I have learned that this problem relates to kernel problems. Project manager Schillig has been a bit hot that the distros change kernel set up with no regard for cdrecord, then whine cdrecord is broke.
(He seems to be a very dedicated man, but he lost a lot of points with me when he claimed that SuSe and others are violating the GPL by making "illegal forks", whatever that means. There is no such thing as illegal forks in the GPL. That is the whole point of GPL, you can do almost whatever you wish, as long as you give back the source. As best as I could tell, he thought he could unilaterally add his own conditions to the GPL and they were binding, but I think the GPL by its nature prohibits unilateral changes like that.)
I put burniso2cd and cdrecord from puppy 1.06, which works, in puppy 2.01, and it also failed. I put burniso2cd and cdrecord from puppy 2.00 in puppy 1.06 and it burned fine.
I just downloaded the lastest alpha for cdrtools, and will see when I go home later tonight if it works.
Still, for me, the best thing is to get that one letter changed in remasterpup2. Not only will it work, but I will have learned something useful which will be useful to me in the future.
As far as Windows, I can burn iso's fine with Roxio. I had to for many months, because Mandriva LE 2005 has exactly the same problem, and until this week I did not realize I merely had to change K3B write mode to -dao to make it work. As soon as I found out about puppy, and having the one CD writer free with it, I started using puppy 1.06 for iso burning.
I simply have developed a negative attitude for MS, not only for 20+ years of their software problems, but also the legal restrictions they have on software. I saw one too many schools and small businesses being fined almost out of existence, because a uninformed teacher or employee did not realize the legal consequences of using their "own" software in the school or workplace. Enough already.
That is my personal opinion, and clearly other intelligent people will have a different opinion, and should react based on their personal opinion as I have done.
Thanks to all for tips. I will try to give feedback if I get one of two solutions -- alpha cdrecord works, or I learn how to write to that loopback file. I have seen a lot of people with cdrecord problems, so if I can, will try to spread any solution.
Forum Problems at Puppy Linux
You are correct about our having had problems with the main Puppy forum and others going dead. There have according to my understanding been server issues primarily dealing with size and capacity. That is one of the main reasons that we arranged for this forum to be set up! So that there is more than one place for people to go with a question or problem. Hopefully the problems are behind us now. So visit us when you can - we'll look forward to seeing you!:)
What kind of file is your initrd. If it is a compressed cpio archive, then you can do what imgineer7 suggested:
jschiwal@hpamd64:~/temp2> mkdir ~/temp2
jschiwal@hpamd64:~/temp2> cd ~/temp2
jschiwal@hpamd64:~/temp2> zcat /boot/initrd | cpio -idv
Now the directory contains the files from initrd.
You can recreate the initrd file with:
find . -print -depth | cpio -ov | gzip >initrd
If your problem is that you need to change the initrd file that is contained in an iso image of a live distro, then you need to create a new iso image. There is now way to edit the contents of an iso9660 image because the filesystem itself is readonly.
Also remeber that the entire filesystem is writable by way of unionfs in Puppy2, so you can edit burniso2cd script and use the edited version without doing a remaster. The same applies to the remasterpup2 script, so it should be possible to alter the script and run it to make an iso with the changed version of the burniso2cd script in it.
Think of the filesystem in Puppy as a bunch of layers, with initrd at the bottom and your persistent storage file on the top layer. Any file written to the top layer will overwrite a file by the same name down below in another layer.
And if all else fails either burn directly from the command line or use Graveman, which is very easy for even a noob.
I have spent a lot of time and energy chasing a false trail. Find told me the only place remasterpup2 existed was in intrd.gz. Accidentally, I found it in /usr/sbin where it can easily be modified to my heart's content. Perhaps find has different parameters in puppy?
So, initrd.gz is not a problem at all. But as far as advice how to extract and build it again via usual commands, that is not possible since that is a read-only system, period. I can move it out, but can't put it back.
Now that I have found where it really is, yes, if I can burn an iso (my original problem after all) I can indeed remaster.
I finally set in remasterpup2, cdrecord to -dao and had to add -tsize=nnnns. Since my machine does not have bashdiff's I had to run it to the point of burning, then close the box, run mkisofs -R -q -print-size to get the tsize, then manually edit the tsize=nnnns, then run it again. Yes, I could play with commands and simply continue where I stopped, but it was more efficient the other way. So, I got my remastered version with burniso2cd modified to run -dao and it does indeed produce perfect iso's.
My next project on this is to modify remasterpup2 so it does not try to burn an iso. Cdrecord is just too put-off by kernel padding to be bothering with it at all. I can burn the CD a number of ways, including 1.06 and kernel 2.4 if I must, or K3b in Mandriva. Or, frankly, while still on puppy2.01-modified, since that works now.
I am going to download Bashdiff's and see if I can build that -tsize=nnnns with strcat and/or strcopy, to make it fully automatic. But, that would not be a general fix. I think the original create iso file is the best solution to what is apparently a well-known conflict between cdrecord and the 2.6 kernel. Why bother with it for a not so common remastering?
On the other comment, if you mean I can edit those script files without remastering, I did that several times, but after while it got to be a nuisance to re-edit it every time.
Frankly, once I learned how to set K3b to DAO, and it worked, I really have no need for puppy at this time. However, it sort of "pulled my string" so I worked on it a lot, sort of like some work on the New York Times Puzzles. I did learn a lot.
Good news! On the Puppy Developer News page on June 27, 2006 our main developer announced that the changes you're manually implementing are going to be in future releases as well.
Um, thanks but...
In my opinion, those minor fixes are already probably obsolete. I am going to try to implement cdrdao for burniso2cd and remasterpup2. cdrdao is a bit larger, (539K v. 314K?) which I realize is a major problem, but...
Of course, if we can get rid of cdrecord, that will minimize the increase.
I hope you guys tested those changes on your machines. I have the grand total of one machine, with a TEAC W224-E, and that one machine does not really make for quality testing of changes.
Also, I just discovered by accident that Graveman v. 0.3.9 was changed some time ago to use cdrdao for iso copies, we know why, don't we???
So, I will be trying to make my own re-master with that, since it has the same compile reqs as 3.8
The problem, though, is that while my rewrites may have made it possible to burn iso's on more writers, it still does not cope with multisession which has been such a major part of puppy for many users.
Wish me luck, and thanks for note.
|All times are GMT -5. The time now is 01:09 AM.|