How to edit a gzipped boot.img file without gunzipping it first...
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.