Red Hat 8.0 Custom CD

Red Hat 8.0 Custom CD

 

This post was last updated on May 26th, 2020 at 02:14 pm

Since these questions keep appearing on the anaconda-devel list, I decided to start capturing some of them and documenting them here:

The following is from Robert Day:




  comments about the following while i finish the rest of it?

**** Overview
  This is a quick and dirty guide for how to create your own
customized Red Hat-based distro starting with Red Hat 8.0
as a template.
**** Preliminaries
  Before you start, issues to consider:

1) Verify that the anaconda-runtime RPM is installed, which
   supplies commands like genhdlist, buildinstall, splitdistro
   and so on, that you'll be running.

2) For convenience, you might extend your search path to save
   typing:

   # PATH=$PATH:/usr/lib/anaconda-runtime

3) If you don't want to create a complete distro, you might
   not want to add the SRPMS, just the RPMS.

4) Do all of this as root, since you will have to mount
   filesystems.
**** The initial structure:
  Assuming you're doing this on an i386 architecture, build the
entire install directory structure under a directory name of your
choice, in an "i386" subdirectory.  For this exercise, we'll use
/mydistro/i386.  (Yes, a later step really does require a 
subdirectory whose name is "i386".)

  Start with the initial build structure in this directory
(some of which is clearly optional, depending on how complete
you want to be):

autorun
dosutils/
images/
isolinux/
RedHat/
       RPMS/
	    [all RPMS you want to include]
       base/
            comps.xml
	    comps.rpm
{EULA,GPL,README*,RELEASE-NOTES*}

  Note that, unless you want to explicitly include the SRPMS,
you can leave out that entire directory structure, but this
will require you to run a modified version of the "splitdistro"
utility later.

  Note also that all of the other (original) files under the
RedHat/base directory (hdlist, hdlist2, *.img) will be rebuilt
anyway, so there's no need to make copies of them if you don't
want to waste the time or space.

  (In fact, most of the *.img floppy boot images in the images/
directory will be rebuilt as well, just in case you cared.)
**** Replace the RPMs
Add, delete, replace RPMs under RedHat/RPMS.
**** Branding your distribution
  As it stands, if you modify the stock Red Hat distro, it's 
probably a good idea to brand it with a name other than "Red
Hat".  

  Once you pick a cool, new name, you can rebrand by installing
the anaconda src RPM, hacking the source, changing all references
to "Red Hat" to your new name, rebuilding that RPM, and replacing
the stock anaconda RPM with it.  Details to follow at the end for 
the more ambitious.

  (Is the above reasonably accurate?)
**** Generate a new header list
  The files RedHat/base/{hdlist,hdlist2} contain information about
all of the RPMs, information like dependencies and mapping from
package names to file names.

  To (re)build these files based on your new collection of RPMs:

  # genhdlist /mydistro/i386
**** Update comps.xml
  Because this file is now an XML file, updating it to reflect
your new collection of RPMs is a bit more work than it used to
be when it was just a text file in earlier releases.

  Once again, let me leave this to the end.  We'll just assume
you've updated it properly to reflect your new collection of
RPMs and their component groupings.
**** Rebuilding the installer
  Run the "buildinstall" utility, which will rebuild a number
of the images/*.img floppy images, as well as RedHat/base/
{hdstg1,netstg1,stage2}.img.

  # buildinstall \
       --pkgorder /mydistro/i386/pkgorder.txt \
       --comp dist-8.0 \
       --version 8.0 \
       --release "My cool new distro" \
       /mydistro/i386

  It will also build a few other files that are needed in 
subsequent steps.


QUESTION:  This step generated all kinds of warnings, some of
which I'm not sure are serious or not.  Given that I'm just
testing a build with the stock files and directories, I would
assume that this should build nicely, so I'm assuming that all
of these warnings are not serious.  (I can supply the entire
560-line output file if anyone feels *really* ambitious. :-)

A small sample that I extracted from the output of this step
(should I be concerned about any of these?)



Expanding packages...                            
Expanding packages... util-linux-2.11r-10.i386.rpmwarning: /mydistro/i386/RedHat/RPMS/util-linux-2.11r-10.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Expanding packages...                             
Expanding packages... vte-0.8.19-1.i386.rpmwarning: /mydistro/i386/RedHat/RPMS/vte-0.8.19-1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
Expanding packages...                      
Expanding packages...
retrieving timezones
Moving comps-extras pixmaps to where anaconda expects them
Running mkfontdir...
/usr/X11R6/bin/mkfontdir: failed to create directory in /mydistro/i386/RedHat/instimage/usr/share/fonts/ISO8859-2/*
Getting pango modules
/usr/bin/pango-querymodules: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
Getting gtk2 input method modules
/usr/bin/gtk-query-immodules-2.0: error while loading shared libraries: libXi.so.6: cannot open shared object file: No such file or directory
Munging fonts.confScrubbing trees...Scrubbing trees... /mydistro/i386/image-templateusr/sbin/ldconfig: /usr/lib/libnewt.so.0.51 is not a symbolic link

usr/sbin/ldconfig: /usr/lib/libbz2.so.1 is not a symbolic link

Scrubbing trees...                              
Scrubbing trees... /mydistro/i386/RedHat/instimageusr/sbin/ldconfig: /usr/lib/libnewt.so.0.51 is not a symbolic link

usr/sbin/ldconfig: /usr/lib/libbz2.so.1 is not a symbolic link

Scrubbing trees...                                
Compressing .mo files in stage2 images...
Creating fontconfig cache
/usr/bin/fc-cache: "/usr/X11R6/lib/X11/fonts/Type1": caching, 29 fonts, 0 dirs
Loading /lib/kbd/keymaps/i386/qwertz/slovene.map.gz
found 9 valid keymaps
  


creating keymap file /tmp/keymaps.28460/slovene.map
Loading /lib/kbd/keymaps/i386/qwerty/speakup.map.gz
KDSKBENT: Invalid argument
failed to bind key 55 to value 1030
found 10 valid keymaps
creating keymap file /tmp/keymaps.28460/speakup.map
Loading /lib/kbd/keymaps/i386/qwerty/speakup-lt.map.gz
KDSKBENT: Invalid argument
failed to bind key 55 to value 1030
found 10 valid keymaps
creating keymap file /tmp/keymaps.28460/speakup-lt.map
Loading /lib/kbd/keymaps/i386/qwerty/trq.map.gz
found 10 valid keymaps
creating keymap file /tmp/keymaps.28460/trq.map
Loading /lib/kbd/keymaps/i386/qwerty/ua.map.gz
found 37 valid keymaps
creating keymap file /tmp/keymaps.28460/ua.map
Loading /lib/kbd/keymaps/i386/qwerty/uk.map.gz
found 9 valid keymaps
creating keymap file /tmp/keymaps.28460/uk.map
Loading /lib/kbd/keymaps/i386/qwerty/us.map.gz
found 9 valid keymaps
creating keymap file /tmp/keymaps.28460/us.map
Loading /lib/kbd/keymaps/i386/qwerty/us-acentos.map.gz
found 9 valid keymaps
creating keymap file /tmp/keymaps.28460/us-acentos.map
Loading /lib/kbd/keymaps/i386/qwerty/us.map.gz
warning: /mydistro/i386/RedHat/RPMS/kernel-BOOT-2.4.18-14.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
warning: /mydistro/i386/RedHat/RPMS/kernel-pcmcia-cs-3.1.31-9.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
warning: /mydistro/i386/RedHat/RPMS/kernel-BOOT-2.4.18-14.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e
unpacking /mydistro/i386/RedHat/RPMS/kernel-BOOT-2.4.18-14.i386.rpm
Building dosutils/autoboot/initrd.img
Module hid not found in kernel rpm
Module keybdev not found in kernel rpm
Module usb-ohci not found in kernel rpm
Module usb-uhci not found in kernel rpm
Module vfat not found in kernel rpm
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/x/xterm-color': No such file or directory
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/v/vt100': No such file or directory
16000+0 records in
16000+0 records out
mke2fs 1.27 (8-Mar-2002)
Wrote /tmp/makebootdisk.tree.28438 (510k compressed, 1515k free)
Building images/pxeboot/initrd.img
Module hid not found in kernel rpm
Module keybdev not found in kernel rpm
Module usb-ohci not found in kernel rpm
Module usb-uhci not found in kernel rpm
Module vfat not found in kernel rpm
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/x/xterm-color': No such file or directory
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/v/vt100': No such file or directory
16000+0 records in
16000+0 records out
mke2fs 1.27 (8-Mar-2002)
Wrote /tmp/makebootdisk.tree.28438 (543k compressed, 1472k free)
Building images/initrd-pcmcia.img
Module hid not found in kernel rpm
Module keybdev not found in kernel rpm
Module usb-ohci not found in kernel rpm
Module usb-uhci not found in kernel rpm
Module vfat not found in kernel rpm
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/x/xterm-color': No such file or directory
install: cannot stat `/mydistro/i386/RedHat/instimage/usr/share/terminfo/v/vt100': No such file or directory
16000+0 records in
16000+0 records out
mke2fs 1.27 (8-Mar-2002)
Wrote /tmp/makebootdisk.tree.28438 (520k compressed, 1392k free)


The following is from Michael Fratoni

On Tuesday 07 January 2003 04:27 pm, Robert P. J. Day wrote:

> **** Branding your distribution
>   As it stands, if you modify the stock Red Hat distro, it's
> probably a good idea to brand it with a name other than "Red
> Hat".
>
>   Once you pick a cool, new name, you can rebrand by installing
> the anaconda src RPM, hacking the source, changing all references
> to "Red Hat" to your new name, rebuilding that RPM, and replacing
> the stock anaconda RPM with it.  Details to follow at the end for
> the more ambitious.
>
>   (Is the above reasonably accurate?)

Don't forget, some of the Red Hat packages are not GPL, including them as 
part of super_cool_linux may be an issue.

$ rpm -qa --qf "%{NAME}-%{LICENSE}\n" | grep -i copyright
redhat-logos-Copyright  1999-2002 Red Hat, Inc.  All rights reserved.
anaconda-images-Copyright  2002 Red Hat, Inc.  All rights reserved.

Removing them then leads to:

$ rpm -q --whatrequires redhat-logos
firstboot-1.0.1-10
xscreensaver-4.05-6
redhat-artwork-0.47-3

> QUESTION:  This step generated all kinds of warnings, some of
> which I'm not sure are serious or not.  Given that I'm just
> testing a build with the stock files and directories, I would
> assume that this should build nicely, so I'm assuming that all
> of these warnings are not serious.  (I can supply the entire
> 560-line output file if anyone feels *really* ambitious. :-)
>
> A small sample that I extracted from the output of this step
> (should I be concerned about any of these?)

The following errors are solved with:

export LD_LIBRARY_PATH="/usr/X11R6/lib:$LD_LIBRARY_PATH"

> /usr/bin/pango-querymodules: error while loading shared libraries:
> libX11.so.6: cannot open shared object file: No such file or directory
> Getting gtk2 input method modules
> /usr/bin/gtk-query-immodules-2.0: error while loading shared libraries:
> libXi.so.6: cannot open shared object file: No such file or directory

While there is little in the way of documentation, the scripts I use for 
rebuilding the distro are here:
http://www.tuxfan.homeip.net:8080/hacks/build_distro-v0.3

- -- 
- -Michael

Instructions on adding a new screen in anaconda

On Wed, 8 Jan 2003, Brent Clements wrote:

>  I would like to add a text screen to anaconda so that I can select a choice
> then once ok is pressed, an action would occur.

I should write up a doc on this or something.  It's a little confusing, 
but it's not really that hard.  You'll need to create a window class 
module in textw/ which contains all of the code for painting the window.  
Then you register your class by adding an entry in stepToClasses{} in 
text.py.  After that you need to make a change in installclass.py to 
setStepList() which will tell the installer to use your new screen as one 
of the steps.

I made a posting to the list last November which explained how to do this.  
Here's a repost.  Hope it helps.


--Patrick.


----------------->8 snippy snippy 8<-------------------

On Thu, 7 Nov 2002, Alisha Nigam wrote:

> hi
>
>      During installation of RedHat-7.2 before disk
> partioning  i want to incorporate a program that
> will ask user to insert a floppy & the will copy
> some user given files to the floppy.

I wrote some code which would do something really similar to this.  What I
ended up doing was creating a new window class which prompts for a floppy
disk.  Call this something like "floppycopy_[text|gui].py" (I've only done
this with text mode, but I'm certain doing it for the gui would be really
similar).

.......

import os
import sys
import string
import isys

from snack import *
from constants_text import *
from translate import _
import iutil
import network


class FloppyDiskWindow:
    def __call__ (self, screen, intf, id):

        device = id.floppyDevice
        file = "/tmp/floppy"

        isys.makeDevInode(device, file)

        while 1:

            rc = ButtonChoiceWindow(screen, _("Floppy Disk Copy"),
                                _("Please insert a blank floppy diskette "
                                  "into the floppy disk drive."),
                                buttons = [TEXT_OK_BUTTON], width = 50,
                                help = "welcome")

            try:
                fd = os.open(file, os.O_RDONLY)
            except:
                intf.messageWindow( _("Error"),
                    _("An error occured while creating the floppy disk. "
                      "Please make sure that there is a formatted floppy "
                      "in the first floppy drive."))
                continue

            os.close(fd)

            args = [ 'mkdosfs', '/tmp/floppy' ]
            cmd = "/usr/sbin/mkdosfs"

            if os.access("/sbin/mkdosfs", os.X_OK):
                cmd = "/sbin/mkdosfs"

            iutil.execWithRedirect (cmd, args, stdout = '/dev/tty5',
                                stderr = '/dev/tty5')

            isys.mount(device, "/tmp/crash", fstype = "vfat")

            try:
                iutil.copyFile("/tmp/filetocopy",
                    "/tmp/crash/filetocopy")
            except:
                pass

            isys.umount("/tmp/crash")

            return INSTALL_OK


......

Next you need to need to 'register' the class by making an entry in the
stepToClasses{} (which is in text.py for doing this in text mode).  It
should be something similar to:

stepToClasses = {
    "floppycopy" : ("floppycopy_text", "FloppyDiskWindow"),
    ...
}

The 'floppycopy' key is going to point at your new class
"FloppyDiskWindow" inside the file 'floppycopy_text.py'.

Now you need to edit dispatch.py and set up which arguments are going to
be sent to your new class.  Add another entry to installSteps[] with
something like:

installSteps = [
    ("floppycopy", ("intf", "id")),
    ...
]

If you look back at the FloppyDiskWindow class, we're expecting to get
"intf" and "id" passed as arguments.

The only thing left is we need to put our new step "floppycopy" into the
StepList in the install class.  Edit the file 'installclass.py', and add
the entry "floppycopy" into the setStepList() class in setSteps.  This
should look something like:

    def setSteps(self, dispatch):
        dispatch.setStepList(
                 "language",
                 "keyboard",
                 "mouse",
                 "welcome",
                 "installtype",
                 "floppycopy",
                 ...


That's all there is to it.  You might want to change the window screen to
allow you to skip writing the floppy ever time though, as well as adding a
"Back" button to it.  Hope it helps..

--Patrick.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 26 March 2003 12:21 pm, Steve M Bibayoff wrote:

> Hello,
>
> Pierre Etzel  wrote:

> > here is my command :
> > # mkisofs -r -J -T -v -V "Redhat 7.2 LOS" -c boot.cat

>
> ^^^^ is this the path (reltive or ?) boot.cat ?
>

> > -b images/boot.img

>
>       ^^^^^^^ also, is this the relative path(or other)?


Both are the relative to the source path provided to mkisofs. (The root of 
the iso image)

I use a script to build the images, here is the command I use for 8.0 
disks:

# Flags to pass to mkisofs

MKISOFSOPTS="-J -L -N -r -T -v -x ./lost+found -quiet"
VOL_ID="-A RHL-${RHVERSION}-updated -V RHL-${RHVERSION}-updated"

# Variables

RHVERSION="8.0"
ISOPREFIX="RH-${RHVERSION}"
UPDROOT="/devel/dist-${RHVERSION}"
BOOTIMG="isolinux/isolinux.bin"
BOOTCAT="isolinux/boot.cat"
BOOTOPTS="-no-emul-boot -boot-load-size 4 -boot-info-table"

# Create the image (This is for disk 1)

mkisofs $VOL_ID $MKISOFSOPTS -b $BOOTIMG -c $BOOTCAT $BOOTOPTS\
   -o $UPDROOT/${ISOPREFIX}-disc1.iso ${UPDROOT}/i386-disc1

# Create disk 2

mkisofs $VOL_ID $MKISOFSOPTS \
- -o $UPDROOT/${ISOPREFIX}-disc2.iso ${UPDROOT}/i386-disc2

If you want to see scripts, they're here:
http://www.tuxfan.homeip.net:8080/hacks/build_distro-v0.3/

- -- 
- -Michael

On Wed, Mar 26, 2003 at 10:31:24AM -0800, Ian Macdonald wrote:

> 
> For my convenience, I want to expand all of the Shrike ISO images and
> then re-image the resulting mass as a single large ISO image for burning
> to DVD.
> 
> My only question in doing this is how to make sure the medium check
> function of the installer still works. I'm not sure which files this
> mechanism uses.
> 
> Has anyone tackled this before?


Yes. Make ISO image and use /usr/lib/anaconda-runtime/implantisomd5

Peter Bowen wrote:

On Thu, 2003-03-27 at 19:11, Ian Macdonald wrote:

Any idea what the --supported flag does?

I think that this is the flag that makes the boxset iso different from
the FTP one.  The FTP isos suggest a mediacheck while the boxset ones do
not.

Thanks.
peter


Previous cpqlinux Site Map - Sorted by Date
Next Cool Software Products
 

About author

Sibananda Sahu
Sibananda Sahu 211 posts

A Linux Kernel Developer and a Firmware Developer by profession. Have worked with few big companies: BROADCOM Corporation, Cypress Semiconductor, LSI Corporation, TOSHIBA Corporation, Western Digital; on various cutting edge technologies and product lines, such as: RAID storage Driver, SSD Firmware, WLAN Firmware etc. Having more than 9 years of experience in Software Engineering domain. Now, took a pledge to educate all aspirant students to teach about Linux Kernel Development.

View all posts by this author →

You might also like

Installation 0 Comments

Compiling The Linux Kernel

This post was last updated on May 27th, 2020 at 05:40 pmThis is the new Kernel Section (May 2001) and at least the kernel building part is finally completed out

FreeBSD 0 Comments

FreeBSD: Install And Use Fish Shell

This post was last updated on August 1st, 2020 at 09:04 amIn FreeBSD, a shell is a program that interprets the command, executes, takes input(s), and prints output(s) on the

Installation 0 Comments

Installing Linux on a Compaq PL4500

This post was last updated on June 1st, 2020 at 12:07 pm The PL4500 is about the only server I can think of that Linux cannot use the embedded SCSI

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply