On Thu, Jan 25, 2001 at 10:05:36AM -0800, Florin Andrei wrote:
> 
> Stefanita Vilcu wrote:
> > Vreau sa fac un fel de ghidushie care face automat ISO din updateuri de
> > pachete si kernel pentru redhat, in plus vreau si suport de XFS.
> 
> http://cambuca.ldhs.cetuc.puc-rio.br/RedHat7-CDs-HowTo.html

m-am apucat si eu sa fac cam ce descrie in documentul respectiv. 

am incercat pentru inceput doar sa updatez distributia cu noile versiuni 
oficiale de pachete - fara trickerii reiserfs/xfs etc

citeva observatii derivate din practica:

1. atasez un script care (hopefully) updateaza automat rpm-urile din
distributie pe baza unui director in care sunt update-uri

2. /usr/lib/anaconda-runtime/upd-instroot trebuie putin modificat din cauza
splitarii pachetului glibc in glibc si glibc-common. atasez un patch

3. ./buildinstall ~/cd1/ (pasul 5.3 din documentul RedHat7-CDs-HowTo.html)
trebuie sa decurga fara erori daca aveti instalate toate pachetele necesare
(doar niste warning-uri ca nu gaseste niste module obscure de kernel).

4. dupa ./buildinstall apare un director in ~/cd1/buildinstall.tree* care
trebuie sters

5. verificati du (disk usage) in ~/cd1 dupa ./buildinstall. daca e prea
mare, mutati pachete din ~/cd1 in ~/cd2 si reluati "/genhdlist
--withnumbers..." si "./buildinstall ...". Eu am sters/mutat niste pachete
de aspell in diverse limbi si fonturi de X chirilice etc.


cam asta ar fi. It worked for me, YMMV!
daca mai incearca si altii, dati de stire.


-- 
        ___
       <o-o>    Viorel ANGHEL <vang AT altavista DOT net>
       [`-']    
       -"-"-    In Linux We Trust.


-- HTML Attachment decoded to text by Listar --

 RedHat7 CDs mini-HowTo

RedHat7 CDs mini-HowTo 
Miguel Freitas, [EMAIL PROTECTED] 
v0.1.0, Dec 15 2000 
  

  This document describe how to rebuild RedHat 7 distribution CDs, after 
  changing RPMS and instalation program (anaconda). 
  ______________________________________________________________________ 
  

Introduction 

  This is a mini howto, it's provided as is, I don't know if I will 
maintain it or not. It's intended to help people to rebuild RH7 CDs, 
something that is not as trivial as it may seem. This is based upon 
my own experience on creating a RH7 instalation with ReiserFS support.[1] 
  
  

Requirements 

  - Original RedHat7 CDs, iso images or their contents 
  - At least 1.5Gb of free space (more for iso images creation) 
  - Installed RedHat7 with compilers, utilities, etc 
  

1) Rebuilding RPMS 

  Building RPM is outside the scope of the present document, but there 
are some worth mentioning notes. It is important to recompile RH7 rpms 
FROM an installed RH7 linux. Doing it from RH 6.2, for example, can be 
very painfull because of different library, compiler, headers and rpm 
versions. 

  If you don't have experience with rpm, get a .src.rpm file to begin. 
This will be installed in directory /usr/src/redhat where you 
can play with it. 

  If you want to make changes to the installer and/or generation of 
media sets (e.g. to change a driver from boot disk to second stage 
because lack of disk space due to a bigger kernel) you should install 
the anaconda source. Anaconda is a fairly complex program which handles 
partitioning, hardware detection, X, newt, python and more. Use the 
original RH7 kernel headers to rebuild anaconda as it may depend heavly 
on them. 
  
  

2) Exchange or add new RPMS 

  Create two directories, eg., ~/cd1 and ~/cd2 where the contents of 
original RedHat CDs should be copied. This is your working area. 

  I prefer to keep RPM files separated on two (or more) cds since the 
beggining. Unfortunately, this has some minor implications that I 
will mention  below. If you want you can copy all files to the same 
place, edit them, and just before step 4 break them in 2 pieces 
(< 650Mb each). 

  Now you may change whatever RPMS you want in both cds. Suppose you 
want to update kde1 to kde2. You can download the rpms from kde.org 
and them carefully substitute the original files. You may copy new 
files to the same CD they were originally, taking care to remove the 
old ones. 

  NEVER, EVER, COPY THE SAME RPM TO BOTH CDs! The genhdlist utility 
(see below) supplied on RH7 does not handle duplicated files correctly 
and the result will be an instalation that looks for a crazy cd number 
like -2172326. 

  I don't know what is the criterion RedHat uses to place some rpm on 
the first or second disk. I thought it was something like "more 
important stuff first", as can be noted from the fact that when 
installing RH7 with the minimum packages you are not asked for 
the second disk. A more carefull look in their disks reveals that this 
must not be true: there are catalan and czech dictonaries on the first 
cd! (nothing personal, they just aren't the biggest market share RedHat 
should be looking forward...) 
  So I follow the "more important suff first" paradigm, moving 
packages to the second disk as I run out of space on the first. 
  

3) Editing file "RedHat/base/comps" 

  This file tells anaconda what packages should be installed if the user 
selects a particular group. If you ever installed a system using 
anaconda you should know what these groups are (printer support, X 
window, gnome, kde and so on). 

  Edit the file cd1/RedHat/base/comps to include any packages you 
might have added in a particular group. You may not need this step 
depending on what have you changed. 

  Some examples: 

     3.1) I added the reiserutils package that contains programs for 
creating ReiserFS partitions. Of course this must be always installed as 
it is a basic requirement to be able to create a new partition. This is 
as important as e2fsprogs-xxx.rpm and it's mkfs program. 

1 Base { 
  ... 
  e2fsprogs 
  ... 
  reiser-utils    <- new package inside group "Base" 
  ... 
} 
  

    3.2) The new kde2 desktop requires a library called libmng. You 
don't HAVE to add libmng to comps, but doing so you should avoid a 
depedence error during instalation. 
  
  

4) Generating file "RedHat/base/hdlist" (genhdlist) 

   The hdlist file is very familiar for everyone who had generated 
RedHat 5.x, 6.x before. hdlist contains information about all packages 
available. This information is used during the instalation to show what 
each package does and to resolve depedence problems after user selects 
them. 

   The program used to generate hdlist is called "genhdlist". It's part 
of anaconda-runtime package and is installed at /usr/lib/anaconda-runtime. 

   "genhdlist" now includes a new parameter called "--withnumbers" 
to record the media number for each rpm in hdlist. 

   Step-by-step procedure: 

  # rpm -i anaconda-runtime-xxxxx-i386.rpm 
  # cd /usr/lib/anaconda-runtime 
  # ./genhdlist --withnumbers --hdlist ~/cd1/RedHat/base/hdlist ~/cd1 ~/cd2 

   Don't change the order of cd1 and cd2, you might guess why. Don't 
forget "--withnumbers" and that's all. 

   Also note that there's no particular time to do this. I put it as 
step 4 just for convenience but it may be you last step. Step 5 does NOT 
depend on this one. 

   If you have not changed neither kernel, anaconda or any important 
package to the instalation program, congratulations! You may record you 
new RH7 cds now (step 6). 
  

5) Rebuilding installation stages 

   The installation program cannot be loaded in just one turn, it must 
be broken into pieces, usually called "stages". The first stage is very 
small, as it may be loaded from a floppy disk, tftp server and so on. 
Usually this stage contains only a stripped down version of the linux kernel

and some drivers (like scsi) that are needed to load the following stages. 

   There are a lot of images that must be generated for a new RedHat 
linux installation. The most obvious one is the boot disk itself (to 
install from cd or floppy), but we also must support installations 
from hd, nfs, etc. 

   RedHat provide us great scripts to do all this in a single shoot. 
The job of these scripts is to extract the contents of some RPMs and use 
their files to create the stage images. 

   Again we must have anaconda-runtime installed: 
  
   # rpm -i anaconda-runtime-xxxxx-i386.rpm 

   Them go to directory /usr/lib/anaconda-runtime where we have some 
usefull scripts to look: 

   5.1) mk-images.i386 - Contains i386 specific settings for creating 
boot disks (normal, network and pcmcia) and supplemental disk drivers. 
Here you may change what modules should be included in each boot image. 
For example, at the network boot disk we have: 
      ... 
      NETWORKMODULES="$COMMONMODULES 3c509 3c59x 3c90x 8390 ac3200 
         at1700 de4x5 de600 de620 depca dgrs eepro100 eepro hp-plus hp 
         hp100 ne ne2k-pci ni52 old_tulip pcnet32 rtl8139 tlan tulip 
         via-rhine nfs vfat" 
      ... 

   5.2) upd-instroot - This one extracts rpms from media sets to be used 
in installation. To avoid wasting space, it also has a list of files that 
must be preserved after rpm extraction (every file not listed here will 
not be copied to any stage). In other words, if you want to include a new 
file on anaconda images you must must set the rpm that contains it AND 
also the file name. Again, let's use reiserfs example: 
      ... 
      PACKAGES="glibc setup openssl python newt libtermcap zlib 
  e2fsprogs util-linux raidtools ... reiser-utils  <- HERE! 
      ... 
      sbin/ldconfig 
      sbin/mkdosfs 
      sbin/mkreiserfs  <- HERE! 
      sbin/mke2fs 
      sbin/mkfs.ext2 
      ... 

   5.3) buildinstall - The main one. This is very easy to use: 

      # cd /usr/lib/anaconda-runtime 
      # ./buildinstall ~/cd1/ 
  
      All other scripts will called automatically where needed. Note 
that if you are working with cd1 and cd2 files (like me) you must be sure 
every required rpm is on the first cd. In particular you must MOVE the 
file syslinux-xxx-i386.rpm from the second to the first cd. RedHat probably 
left this at the second cd because they separate the files later. If you 
don't have separated the cds yet, just ignore this. Do not COPY this file, 
instead of MOVING, or you will get the error mentioned in step 4 of this 
document. 
      The script will create a lot of files at ~/cd1/images and 
~/cd1/RedHat/instimage. The last one is the nfs installation tree and is 
originally provided by RedHat on the second cd, so you may move it if 
you want. 
  

6) Creating iso images 

   The only catch is to be sure the first CD will be bootable. In order 
to do that, try comands like these: 

   # mkisofs -V <label> -b images/boot.img -c boot.cat -J -r -T -o cd1.iso
~/cd1 
   # mkisofs -V <label> -J -r -T -o cd2.iso ~/cd2 

   I like to use -J (joliet) so it can also be read on Windowz systems. 
   If you plan to distribute these iso images over the net, consider 
generating a md5 "checksum", so others could be sure to have the file 
intact. 

   # md5sum *.iso > MD5SUM 

<end> 
  

--- Links ---
   1 index.html

-- Attached file included as plaintext by Listar --

#!/bin/sh

# vang @ altavista . net

UPDATES_DIR=/mnt/earthforce/redhat/7.0-updates
DISTRIB_DIRS="/home/vang/cd1 /home/vang/cd2"
FIRST_DISTRIB_DIR="/home/vang/cd1/RedHat/RPMS" # ths is redundant but convenient...
OLD_DIR="/home/vang/rh7-cd-old" # where to save replaced rpms

#set -x 

find $UPDATES_DIR -name '*.rpm' ! -name '*.src.rpm' -print | \
        while read p
        do
                u_name=$(rpm -qp --qf '%{NAME}' $p)
                u_vers=$(rpm -qp --qf '%{VERSION}-%{RELEASE}' $p)
                u_build=$(rpm -qp --qf '%{BUILDTIME}' $p)
                u_arch=$(rpm -qp --qf '%{ARCH}' $p)
                
                # now search in DISTRIB_DIRS for '$u_name*$u_arch.rpm'
                for d in $DISTRIB_DIRS
                do              
                        oldp=$(find $d -name "$u_name-[0-9]*$u_arch.rpm" -print)
                        # if the above line is $u_name*$u_arch.rpm
                        # it will return more than one package !!!
                        # in case of gcc, mysql, etc
                        [ -n "$oldp" ] && break
                done
                if [ -n "$oldp" ]
                then
                        oldp_vers=$(rpm -qp --qf '%{VERSION}-%{RELEASE}' $oldp)
                        oldp_build=$(rpm -qp --qf '%{BUILDTIME}' $oldp)
                        if [ $oldp_build -lt $u_build ]
                        then
                                echo "replaced $u_name ($u_arch) $oldp_vers with 
$u_vers (in $(dirname $oldp))"
                                cp $p $(dirname $oldp)
                                mv $oldp $OLD_DIR
                        else
                                echo "$p is older than $oldp!"
                        fi
                else
                        echo "NEW $p added in $FIRST_DISTRIB_DIR"
                        cp $p $FIRST_DISTRIB_DIR
                fi
        done
         


-- Attached file included as plaintext by Listar --

67c67
<       if [ $(rpm -qp --qf '%{NAME}' $n) = "glibc" ] ; then
---
>       if [ $(rpm -qp --qf '%{NAME}' $n) = "glibc-common" ] ; then
91c91
< PACKAGES="glibc setup openssl python newt libtermcap zlib ash
---
> PACKAGES="glibc glibc-common setup openssl python newt libtermcap zlib ash
109c109
<            XFree86-xfs e2fsprogs fileutils glibc rsh less ftp readline
---
>            XFree86-xfs e2fsprogs fileutils glibc glibc-common rsh less ftp readline


---
Send e-mail to '[EMAIL PROTECTED]' with 'unsubscribe rlug' to 
unsubscribe from this list.

Raspunde prin e-mail lui