How to edit a gzipped boot.img file without gunzipping it first...
(forgive me if I'm not using the correct terms, but here goes...)
I am trying to edit an .iso's "boot.img" file that is gzipped to "boot.gz". If I gunzip it, edit the boot.img file, and gzip it again, it doesn't work right (I get errors upon booting the .iso and it aborts).
All I did was change the menucolor text from "11,0" to "1,0" (from cyan to blue) without making any other changes.
I'm uncertain if there is a some form of checksum verification involved to confirm the boot.img file hasn't been tampered with before booting up.
Windows XP edit method:
I am using UltraISO to explore the .iso file, and then "view" the "boot.gz" file within the .iso using IZARC. IZARC permits using the text editor (notepad2) to view the boot.img file (gunzipped name of "boot.gz"). While viewing the boot.img file in notepad2 I am able to make the change from 11,0 to 1,0 then click "save" without any error messages or complaints from notepad2, but when I try to boot it shows the original cyan on black menucolors. I believe that this method does not actually save the change in the boot.img file.
OpenBSD edit method:
I extract the boot.gz file from the .iso using UltraISO in Windows, copy the boot.gz over to OpenBSD, then I gunzip the boot.gz file and edit it using vi in OpenBSD, making the same modification (changing 11,0 to 1,0) then gzip it back to boot.gz and add the modified file back into the .iso file (overwriting the original "boot.gz" file) using UltrISO in Windows. Upon booting the .iso it aborts after displaying system errors.
I believe this method actually does edit and save the change.
I am using OpenBSD because using WINGZ in Windows to gzip the file back to "boot.gz" won't rename the file the same as gzip in OpenBSD (WINGZ creates a "boot.img.gz" file that gunzips to "boot.img", or a "boot.gz" file that gunzips to "boot". Only OpenBSD gzips the file to "boot.gz" and gunzips it back to "boot.img").
Any help you can provide would be greatly appreciated.
Thank you in advance.
Mount the boot.img file
It is done by the following command.
mount -o loop boot.img /mnt
edit the file
And then unmount it.
Thank you for the prompt reply, but in order for me to get to the boot.img file, I'd have to gunzip it, and I'm trying to avoid doing that.
Or am I misunderstanding your direction?
I was able to edit the boot.img file using vi in OpenBSD without mounting it, but I had to gunzip it, then edit it, then gzip it again.
I heard there was a way to edit the file within an archive file without the need to extract the archive first.
No, you can not edit any compressed file in any operating system.
Whenever you have an application which edits a compressed file for you, the application first uncompresses the file and edits the uncompressed copy.
Whether it will be any bloody use is a different issue ... ;)
Stop, stop - stop throwing them rocks ... :p
Sorry mate, couldn't resist.
Don't fear to about uncompressing gzip file. The tools of your system must not corrupt it.
try using gunzip instead of your archive tool.
Thank you for your replies, I'll try using gunzipping it and yes, I do have a backup copy :-)...
|All times are GMT -5. The time now is 05:01 PM.|