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.
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
On Thu, 2005-05-05 at 19:37 -0500, Johnny Hughes wrote:
Removing unused python files in hdimage... /usr/sbin/chroot: cannot run command `/usr/bin/anaconda': No such file or directory
<snip>
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:
genhdlist twice with the pkgorder is a very good idea... (and your script is much more concise than other anaconda wrapper scripts that I have worked with, so I may just start using it instead ;-)
<snip>
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
Unfortunately, none of these issues solved the issue. I still get '/usr/bin/anaconda' not found errors.
I'm about to give up and dive into the anaconda-runtime to see where this file precisely is supposed to get copied over so I can maybe add excessive debugging statements to see why it isn't.
On Fri, 2005-05-06 at 08:56 -0500, Sam Hart wrote: <snip>
Unfortunately, none of these issues solved the issue. I still get '/usr/bin/anaconda' not found errors.
I'm about to give up and dive into the anaconda-runtime to see where this file precisely is supposed to get copied over so I can maybe add excessive debugging statements to see why it isn't.
Are you building from within chroot? I build RPMS in chroots, but I haven't tried to actually run buildinstall from within one.
Buildinstall does it's own chroot while building ... so I don't know how well it would run from within a chroot itself. (It might work fine ... I just haven't tried it).
Johnny Hughes
On Fri, 2005-05-06 at 09:25 -0500, Johnny Hughes wrote:
On Fri, 2005-05-06 at 08:56 -0500, Sam Hart wrote:
<snip> > Unfortunately, none of these issues solved the issue. I still get > '/usr/bin/anaconda' not found errors. > > I'm about to give up and dive into the anaconda-runtime to see where > this file precisely is supposed to get copied over so I can maybe add > excessive debugging statements to see why it isn't. > Are you building from within chroot? I build RPMS in chroots, but I haven't tried to actually run buildinstall from within one.
Buildinstall does it's own chroot while building ... so I don't know how well it would run from within a chroot itself. (It might work fine ... I just haven't tried it).
Yes, I have been building all my ISOs from within chroots. If buildinstall has any conflicts with this, this will be the first time I have encountered it.
In fact, as a double-check I have rebuilt the other ISOs I've built before (two FC2-based, one a mix of FC3/2) inside this exact build environment and they built successfully.
I'm also wondering if perhaps I am missing a package that might have a soft-dependency (e.g., a dependency that, for whatever reason, isn't explicitly defined and thus not checkable using my dep closure scripts). If this is the case however, nothing in the output alludes to what it could be.
What I'm doing now is stopping the script (upd-instroot, which seems to be where the problem is) when it gets the missing anaconda error. As soon as I can track down exactly what it was trying to do during that error, I can trace back to where /usr/bin/anaconda is being lost.
Okay, I think I found the solution. I'm posting it to the mailing list so that (hopefully) when someone else has this same problem and they google for it (like I did) they can find a potential solution without having to sink an excess of time into ripping anaconda apart :-)
The problem lies inside of "upd-instroot" inside the anaconda-runtime package. Inside the "prunePackageList()" function is where it is supposed to find all the RPMs needed for the install environment. It does this by iterating through a list of package names and ls'ing for their associated RPM in your asset directory, with this line: for PKG in $PACKAGES; do PATTERN="${PATTERN:+${PATTERN}|}(^$PKG )" PACKAGEFILES="$PACKAGEFILES $(ls $PACKAGEPATH/${PKG}*{${ARCH},noarch}.rpm 2>/dev/null)" done
The problem was, this custom CentOS-based distro was for an i586-based system, but it was just a first *rough* build to test installation, so I had all *i386.rpm files except for glibc and openssl, which were *i586.rpm.
So, long story short, the errors I was getting were because the i586 glibc was not being pulled into the install environment (the above code only pulls in the RPMs if it is i386).
Hope that helps someone else with this problem in the future, considering that anaconda-runtime proceeds to build bootable ISO directories even if glibc wasn't actually available for the $ARCH it's looking for :-)