Looking for script to generate isolinux/initrd.img
I'm looking for the script, or whatever setup is used, to generate the isolinux/initrd.img file. Something needs to be making decisions as to what files are put there, which contents, etc. Not everything in there is a replica of a regular system. Where do these files come from?
The particulars for making isolinux/isolinux.bin (the ISO boot loader) might also be useful. |
Some of the stuff can be found :- (on a slackware mirror)
source/installer source/a/pkgtools source/a/syslinux Making a bootable CD/DVD :- http://syslinux.zytor.com/wiki/index.php/ISOLINUX Look in /boot on an installed system for info on making an initrd |
man mkinitrd?
|
I've got the construction process down. Been doing that for ages. I just need know what to put in the tree that does get built, and where these files come from. I took the distributed isolinux/initrd.img apart and compared that to the running system (matched versions). Some files were the same and some files were different. Well over 200 files in there did not even exist in the installed system, most of which didn't appear to be specific to an installer. Once I can build the file tree, I'm ready for a home run the rest of the way.
But I want to patch some things in there that are not necessarily just scripts. If only scripts need to be changed, I can just use the original isolinux/initrd.img as the "source" and apply a patch and rebuild. But I really want to be building this from 100% source. What's in there may involve separate builds of some components using different configuration options, different libraries available to the build, as well as a subset selection of installed files (this much might easy enough to reverse engineer since I have a list of files). Of course, "installing" in this case would be targeting a directory acting as the root for what will be collected into isolinux/initrd.img. I can't rule out that Pat just builds it manually. I've built bootable ISOs manually myself, too. |
Quote:
|
Quote:
There are many other tools which create the distributable tree, but aren't included because they're very specific to the environment in which they are run -- the installer build is one such tool which is why it's not in the source tree. However, it's reasonably easy to update by hand if you want to make modifications to it. cd isolinux mkdir tmp cd tmp zcat ../initrd.img | cpio -div make your changes find . | cpio -o -H newc | gzip -9fv > ../initrd.img cd .. rm -rf tmp |
Quote:
Quote:
I want to make changes that are patches to the source code that gets compiled to binary programs that become part of the root tree that is used to build isolinux/initrd.img. Many of these programs are different than in the installed system. That means some changes have been made. These changes may be simply different options on the ./configure script. Or they may be source level patches (or equivalent hacks). Or it could be as benign as being based on a previous version of Slackware. I want to be able to reproduce that. If there are any patches to GPL programs, I have a legal right to those since the binary was distributed to me (e.g. a right to the complete source which includes all patches or hacks to it), just as you would have a legal right to the same (anything and everything that comprises any product that is in any part derived from any component licensed under GPL) for whatever I do, if I distribute a binary form (such as the initrd.img of it) to you. In the end, I could simply ask Pat for it. But if this is already available somewhere I'm not seeing, I would not want to be wasting Pat's time by such asking. |
I guess the source of confusion here is the different perspective people have for "script to generate". The popular perception seems to be that such a script would only be a minimal script, and that it would use input that is as close to the desired output as possible. For example, a "script to generate an ISO" would be thought of as something to take an already complete file tree of what files will be in the ISO image, and run mkisofs appropriately, possibly also making it bootable.
So I guess I wasn't clear in a poor choice of title. My perspective comes from building things all the way from source. Many people use SlackBuild scripts to do this, already, for at least some packages, if not all of them, for their target system. Or try Linux From Scratch. I've also worked for Timesys building embedded Linux systems. Ideally, there would be a script to select file components for the tree that goes into the isolinux/initrd.img. It could select them from existing packages (e.g. .tgz or .txz packages that are installed with ROOT=the directory where the tree is being built). It could run special SlackBuild scripts to make modified versions of some packages (e.g. leave out stuff not needed for the installer to keep RAM usage lighter). It could then leave the file tree as the resulting product, or proceed to use mkinitrd or discrete commands to build isolinux/initrd.img as the final product. So in summary, to me, a "script to generate" something will, where practical, build things from original pristine source (plus desired patches). |
As I read it what you are trying to do is rebuild a custom bootloader from source, but would like to modify a script to do it. However I could be wrong as your explanations are extremely convoluted.
It may be easier just to say what you would like to create and then it might be more apparent what you are looking for. I have only modified the bootloader, rather than patch and build it, but as far as I remember it is only the stuff that wildwizard mentioned plus a kernel. Quote:
|
Quote:
There is other stuff in there. Other binary programs. Maybe there is no master script to build it all. But maybe there are a bunch of SlackBuild scripts to build each package that goes into the file tree for that isolinux/initrd.img file. Those things that are different would be in there. The binary programs that are the same could just use the same SlackBuild scripts as the regular system. Think about it this way. You want to build the isolinux/initrd.img file. But you don't have the file tree that goes into it, nor do you have the original isolinux/initrd.img file, either. You need to build everything from source. Some of it probably could be build at source level using regular SlackBuild scripts and the resulting package file installed with ROOT= to the directory the file tree is being built in. But some of the packages are different than a regular system. How do you build those? In my case, I want to modify some stuff. At this point, what it is I want to modify is not important. I have not made final decisions, yet. |
Sorry I used the word bootloader incorrectly. I was using it to mean the whole of the initrd.img that booted Slackware. However you have had your answer. If you unpack that image file and look at it you will see it is just the items in the source/installer directory some scripts a kernel and not a awful lot else.
As you list LFS in your signature, I would assume that you are familiar with a toolchain, init scripts etc., if this is the case you should be able to figure your way round this fairly easily. samac |
Quote:
Quote:
Maybe some of the SlackBuild scripts are looking for an environment variable that says "we are building the installer, so do stuff different". I'll look around for that. |
Quote:
Why do you think they are patched? Check for yourself the md5sums of any of the binaries against the md5sums in the .t?z packages. They will be identical. If you want to modify the component binaries, then all you have to do is patch the source of the binary you want, and reinclude it into the initrd.img. |
Quote:
Quote:
|
Quote:
|
Quote:
|
A time wasting measure... for everyone on the forum :mad:
|
Quote:
In the initrd.img all of the busybox provided utilities are symlinked to busybox. The rest, including tar,lvm*, fsck* and others, as I said, are taken from the .t?z packages. |
Quote:
|
Quote:
Right now I'm comparing slackware-current against slackware64-current. Of course we expect file content differences in every executable and library. I found some file name differences. Examples include different version number on documentation for "tidy" and the name-version combination style for the documentation for "jove". These are nits for another thread, though. |
All times are GMT -5. The time now is 10:36 PM. |