[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: custom cd (with different kernel)

--- Begin Message ---
On Tue, 2003-03-11 at 06:41, asaf spanier wrote: 
> I'm trying to burn my own 'Red Hat 8.0 Custom CD'. but I'm
> not interesting in add/remove rpms in my custom CD. what I
> want is to built custom RedHat CD that will have different
> Kernel.

I have been working on a terse document that explains how I accomplished
a similar task.  I needed to change the Kernel-BOOT package and not the
actual post install kernel, but the process is very similar.  You may be
able to use my notes as a good jump start.  Any constructive criticism
is always welcome.

NOTE:  This doc is still in a pretty early revision so some of the more
obscure topics are not complete (comps.xml tweaking) and I should also
mention that I am not an active Anaconda developer or RedHat employee:

	- A workstation with the same release that you want to build (example:
a RedHat 8.0 workstation to build a custom RedHat 8.0 install)
	- A healthy Build Environment (next section)

	- Install the anaconda-runtime.rpm
	- Install the comps-8.0 package
	- Install the comps-extras package from
	  	Desc:  http://rhlinux.redhat.com/anaconda/comps.html
		Pkg: http://rhlinux.redhat.com/anaconda/comps-8.0.tar.gz
	- Get kernel source RPM for relevant kernel revision
	- (OPTIONAL) Kernel-utils package


(1) Make changes to the Red Hat Spec file (used for defining the RPM
build process) found in /usr/src/redhat/SPECS/kernel-2.4.spec to tell it
not to build only the kernel-BOOT RPMs.  This is optional but if the
other RPMs are not disabled, the rpmbuild process will build ALL of the
kernel RPMs instead of just the BOOT.

(2) Make changes to the kernel-BOOT config file found in:

(3) Build the customized kernel RPMs with rpmbuild:
    rpmbuild -bb /usr/src/redhat/SPECS/kernel-2.4.spec

(NOTE: As mentioned above, the build process will build ALL the RPMs
which will cause the process to take a bit longer, unless the other RPMs
are disabled inside the spec file.)

(4) The new RPMs will be placed in /usr/src/redhat/RPMS/i386


This section assumes that no new packages are being included in the
installation set.  The installation is smart enough to resolve package
names regardless of the version so updating packages will not matter. 
To add new packages, the package registry file, comps.xml, would have to
be rebuilt.  For information on this, see the "Adding New Packages to
the Installation" section below.

(1) Create a local directory structure of the original RedHat
installation CDs by copying the contents of all three CDs to a local
build directory.  For the purposes of this HOWTO, the directory
/var/cdrom/i386/ will be used as the build directory.  A different
directory could be substituted but it is imperative that the last
directory in the path, before your image, be named "i386" because
several of the scripts reference the subdirectory.  Copy the whole first
CD to this directory, and then copy the contents of the /RedHat/RPMS
directory on each additional CD into the /RedHat/RPMS directory of the
build directory; creating one comprehensive directory structure with all
the packages.

(2) If desired, remove old RPMs that are to be updated (including the
kernel-BOOT-2.4.x.rpm) from /var/cdrom/i386/RedHat/RPMS . Place the
updated packages into this directory (including the kernel-BOOT RPM if
built in the previous section).

(3) Remove both the hdlist files from /var/cdrom/i386/RedHat/base:
	rm -rf /var/cdrom/i386/RedHat/base/hdlist*

(4) Generate a new set of hdlist files:
	genhdlist /var/cdrom/i386/

(5) Create a file containing an ordered list of packages to include in
the installation.  This utility will put the files in order so that they
can be split onto multiple CDs later.  Before running this script, check
the environment for a PYTHONPATH variable which should be set to the
anaconda-runtime directory (/usr/lib/anaconda).  Assuming this variable
is present, run the script:
	pkgorder /var/cdrom/i386 i386 > /var/cdrom/pkgorder.txt

(6) Run the buildinstall utility to compile new Anaconda floppy and boot
images.  This utility will pull components from several different
packages in your /var/cdrom/i386/RedHat/RPMS directory.
	buildinstall --comp /var/cdrom/i386/RedHat/base/comps.xml \
	--pkgorder /var/cdrom/pkgorder.txt  --version 'Psyche 8.0 Toshiba'
	'Psyche 8.0 Toshiba' /var/cdrom/i386

(7) Use the splitdistro script to quickly create hard links to the
various files that need to be on each of the CD ISO images.  The script
will build each of the CDs in /var/cdrom as directories incrementally
labeled starting at "i386-disc1".  If only the binary CDs are being
compiled (ie: only the RPMS directory was copied over to
/var/cdrom/i386/RedHat and not the SRPMS directory), then splitdistro
may throw an error at the end of the compilation, as it tries to build
the source CDs and cannot find the SRPMS directory.  This error should
be expected.  Only the first three CD image directories are needed. 
	splitdistro --fileorder /var/cdrom/pkgorder.txt /var/cdrom i386

(8) Remove the hdlist files that were generated earlier.  These
reference all of the packages as if they were on one CD whereas separate
hdlist files for each of the CD images are needed by Anaconda.
	rm -rf /var/cdrom/i386-disc1/RedHat/base/hdlist*

(9) Generate individual hdlist files for each of the CD images:
	genhdlist --withnumbers --fileorder /var/cdrom/pkgorder.txt \
	/var/cdrom/i386-disc1 /var/cdrom/i386-disc2 /var/cdrom/i386-disc3

(10) Create a bootable ISO image from the generated directory.  The
following statement is an example and some of the fields should be
altered to reflect the new compilation (author, label, date, etc):
	mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat \
	-no-emul-boot -boot-load-size 4 -boot-info-table -R -J \
	-V "Red Hat 8.0 (psyche) Toshiba" -T -p "Matt Howell \
	<mhowell cybarworks com>" -P "Matt Howell \
	<mhowell cybarworks com>" -A "Red Hat 8.0 (psyche) Toshiba \
	created on 12 Feb 2003" -o psyche/usr/src/redhat/SPECS/kernel-2.4.spec
-i386-1.iso \

(11) Compile ISO images for the other two binary CDs using similar
syntax to the following:
	mkisofs -R -J -V "Red Hat 8.0 (psyche) Toshiba" -T \
	-p "Matt Howell <mhowell cybarworks com>" \
	-P "Matt Howell <mhowell cybarworks com>" \
	-A "Red Hat 8.0 (psyche) Toshiba created on 12 Feb 2003" \
	-o psyche-i386-2.iso /var/cdrom/i386-disc2

(12) Use a standard CD Burning application to create CDs from the ISO


<<<<<<download the comps.8.0.tar.gz package>>>>>>

generate a new set of hdlist files

/usr/share/comps-extras/getfullcomps.py comps.xml /var/cdrom i386 >
cp gen.xml /var/cdrom/i386/RedHat/base/
sed  's/<\/comps>//' comps.xml > noclose.xml
cat gen.xml >> noclose.xml
echo -n "</comps>" >> noclose.xml
mv noclose.xml comps.xml


Red Hat Anaconda Developer List

Red Hat Comps File Tools

Speakeasy's Rpm Find Directory of RedHat updates
ftp://anonymous ftp rpmfind net/linux/redhat/updates/current/en/os/i386/

--- End Message ---

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]