[CentOS-devel] Anaconda errors when building custom CentOS-based distro

Johnny Hughes mailing-lists at hughesjr.com
Fri May 6 00:37:14 UTC 2005


On Thu, 2005-05-05 at 17:01 -0500, Sam Hart wrote: 
> I am building a custom CentOS 4.0 based distribution (basically, trimmed
> down size and a few custom packages). I have successfully built other
> RPM-based distributions in the past without much trouble. However, this
> CentOS 4.0-based one is giving me headaches.
> 
> The document I follow for remastering CentOS 4.0 is this one:
> http://fedoranews.org/contributors/gene_czarcinski/update_distro/
> 
> I know it is written for FC3, but I also was under the impression it
> contained information more general.
> 
> When I run buildinstall with the CentOS 4.0 RPMs (right now, it contains
> no custom RPMs, these are all stock CentOS 4.0) it creates boot images
> which do not contain the anaconda script (/usr/bin/anaconda). Here is
> the relevant output:
> 
> prickly-pear:/work# buildinstall --pkgorder $BASE/custom/pkgfile \
> > --version 1 --product "Custom01" --release "Custom01" --prodpath CentOS $BASE/custom/i386
> warning: /work/custom/i386/CentOS/RPMS/anaconda-runtime-10.1.1.13-1.centos4.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
> Running buildinstall...
> /work/custom/i386/buildinstall.tree.21011 /work
> /work
> Going to run buildinstall again
> warning: /work/custom/i386/CentOS/RPMS/anaconda-runtime-10.1.1.13-1.centos4.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
> Building images...
> Assembling package list...
> Expanding text packages...
> Expanding graphical packages...
> retrieving timezones
> Creating nsswitch.conf
> Fixing up /etc/man.config to point into /mnt/sysimage
> Running mkfontdir...
> /work/custom/i386/buildinstall.tree.21011/upd-instroot: line 929: /usr/X11R6/bin/mkfontdir: No such file or directory
> Getting pango modules
> /usr/sbin/chroot: cannot run command `/usr/bin/pango-querymodules': No such file or directory
> Getting gtk2 input method modules
> /usr/sbin/chroot: cannot run command `/usr/bin/gtk-query-immodules-2.0': No such file or directory
> Getting gtk2 gdk-pixbuf loaders
> /usr/sbin/chroot: cannot run command `/usr/bin/gdk-pixbuf-query-loaders': No such file or directory
> Scrubbing trees... /tmp/treedir.21024/image-template
> /usr/sbin/chroot: cannot run command `usr/sbin/ldconfig': No such file or directory
> Scrubbing trees... /tmp/treedir.21024/instimage
> cp: cannot stat `/tmp/treedir.21024/instimage/boot/memtest*': No such file or directory
> /usr/sbin/chroot: cannot run command `usr/sbin/ldconfig': No such file or directory
> Compressing .mo files in stage2 images...
> Creating fontconfig cache
> /usr/sbin/chroot: cannot run command `/usr/bin/fc-cache': No such file or directory
> Creating debug dir
> Patching python library...
> Removing unused python files in hdimage... /usr/sbin/chroot: cannot run command `/usr/bin/anaconda': No such file or directory
> 
> I have googled for this error, and found many mentions of it, but no
> real solutions. The anaconda-runtime, anaconda, anaconda-help and
> busybox-anaconda packages are all installed and present as RPMs in the
> RPM asset directory (/work/custom/i386/CentOS/RPMS). Similarly, the
> other files that report errors (`usr/sbin/ldconfig', etc) are installed
> and present with their parent RPMs in the RPM asset directory.
> 
> I am reasonably certain that I have dependency closure on these RPMs (I
> have made in-house rpmstrap scripts for it and can install via
> bootstrap), and my comps.xml file seems correct.
> 
> Has anyone ever seen this "/usr/sbin/chroot: cannot run command
> `/usr/bin/anaconda'" error ever before? If so, any suggestions for what
> I can do to fix this?
> 
> I'm not certain if this is the right place to ask this, but since the
> only RPM-base that is giving me this problem is CentOS 4.0 I figured it
> was the best place to go.

One thing I notice is that I have to run genhdlist twice ... the guide
only does it once.  Here is the appropriate part of my build script:

#-------------------------------------------------------------------

## Run genhd first time
echo "Running genhdlist"
/usr/lib/anaconda-runtime/genhdlist \
--withnumbers \
--productpath=CentOS \
${DISTDIR}/${ARCH} >> ${LOGFILE} 2>&1

## then pkgorder
echo "Getting pkgorder"

/usr/lib/anaconda-runtime/pkgorder \
${DISTDIR}/${ARCH} ${ARCH} \
| tee --append ${DISTDIR}/pkgorder-${ARCH}.txt ${LOGFILE} 2>&1

## then genhd again
echo "Running genhdlist again"

/usr/lib/anaconda-runtime/genhdlist \
--withnumbers \
--productpath=CentOS \
--fileorder=${DISTDIR}/pkgorder-${ARCH}.txt \
${DISTDIR}/${ARCH} >> ${LOGFILE} 2>&1

## then build installer
echo "Building Installer"

/usr/lib/anaconda-runtime/buildinstall --comp dist-${VERSION} \
        --pkgorder ${DISTDIR}/pkgorder-${ARCH}.txt \
        --release "${DISTRONAME}-4 ${ARCH}" \
        --product "${DISTRONAME}-4 ${ARCH}" \
        --version ${VERSION} \
        ${DISTDIR}/${ARCH}  >> ${LOGFILE} 2>&1

#-------------------------------------------------------------

IN your case, it looks like your $DISTDIR would be /work/custom 

Other issues I have had:

When making from a new tree (where there are no
$DISTDIR/$ARCH/CentOS/base) ... touch these files in
$DISTDIR/$ARCH/CentOS/base (before running
genhdlist/pkgorder/buildinstall):

hdlist  hdlist2  hdstg2.img  netstg2.img  stage2.img

and

also touch $DISTDIR/$ARCH/.discinfo


buildinstall has to be run as root

My full build script (that I just used for build CentOS-4.1beta ISOs) is
here:

http://centos.hughesjr.com/testing/build.sh.txt

--
Johnny Hughes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.centos.org/pipermail/centos-devel/attachments/20050505/c4d73106/attachment.bin


More information about the CentOS-devel mailing list