diff --git a/etc/lorax/config.s390 b/etc/lorax/config.s390
index 5593f498..56e359c3 100644
--- a/etc/lorax/config.s390
+++ b/etc/lorax/config.s390
@@ -8,4 +8,4 @@ modules: zfcp tape390 dasd_diag_mod dasd_eckd_mod dasd_fba_mod dasd_mod
ctc netiucv smsgiucv lcs qdio qeth ccwgroup crypto_api xfrm_nalgo
initrd_template=templates/initrd/initrd.s390
-scrubs_template=templates/scrubs/scrubs.s390
+scrubs_template=templates/scrubs/scrubs.i386
diff --git a/etc/lorax/templates/scrubs/scrubs.s390 b/etc/lorax/templates/scrubs/scrubs.s390
deleted file mode 120000
index 782e69b5..00000000
--- a/etc/lorax/templates/scrubs/scrubs.s390
+++ /dev/null
@@ -1 +0,0 @@
-scrubs.i386
\ No newline at end of file
diff --git a/rewrite/mk-images b/rewrite/mk-images
deleted file mode 100755
index 56a7a88d..00000000
--- a/rewrite/mk-images
+++ /dev/null
@@ -1,1019 +0,0 @@
-#!/bin/bash
-#
-# mk-images
-#
-# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-LANG=C
-
-PATH=$PATH:/sbin:/usr/sbin
-IMAGEUUID=$(date +%Y%m%d%H%M).$(uname -i)
-TMPDIR=${TMPDIR:-/tmp}
-
-usage () {
- echo "usage: mk-images []"
- exit 0
-}
-
-DEBUG=""
-BUILDARCH=`uname -m`
-BOOTISO="boot.iso"
-
-while [ $# -gt 0 ]; do
- case $1 in
- --debug)
- DEBUG="--debug"
- shift
- ;;
- --noiso)
- BOOTISO=""
- shift
- ;;
- --arch)
- BUILDARCH=$2
- shift; shift
- ;;
- --imgdir)
- IMGPATH=$2
- shift; shift
- ;;
- --product)
- PRODUCT=$2
- shift; shift
- ;;
- --version)
- VERSION=$2
- shift; shift
- ;;
- --bugurl)
- BUGURL=$2
- shift; shift
- ;;
- --output)
- TOPDESTPATH=$2
- shift; shift
- ;;
- --nogr)
- echo "*** DeprecationWarning: ignoring --nogr option." >&2
- shift
- ;;
- --mindir)
- echo "*** DeprecationWarning: ignoring --mindir option." >&2
- shift; shift
- ;;
- --stg2dir)
- echo "*** DeprecationWarning: please use --imgdir instead of --stg2dir." >&2
- shift; shift
- ;;
- *)
- yumconf=$1
- shift
- ;;
- esac
-done
-
-if [ -z "$TOPDESTPATH" -o -z "$IMGPATH" -o -z "$PRODUCT" -o -z "$VERSION" ]; then usage; fi
-
-TOPDIR=$(echo $0 | sed "s,/[^/]*$,,")
-if [ $TOPDIR = $0 ]; then
- $TOPDIR="."
-fi
-TOPDIR=$(cd $TOPDIR; pwd)
-
-# modules that are needed. this is the generic "needed for every arch" stuff
-COMMONMODS="fat vfat nfs sunrpc lockd floppy cramfs loop edd pcspkr squashfs ipv6 virtio_pci"
-USBMODS="ohci-hcd uhci-hcd ehci-hcd usbhid mousedev usb-storage sd_mod sr_mod ub appletouch"
-FIREWIREMODS="ohci1394 sbp2 fw-ohci fw-sbp2 firewire-sbp2 firewire-ohci"
-SDMODS="mmc-block sdhci sdhci-pci"
-IDEMODS="ide-cd ide-cd_mod"
-SCSIMODS="sr_mod sg st sd_mod scsi_mod iscsi_tcp iscsi_ibft"
-FSMODS="fat msdos vfat ext2 ext3 ext4 reiserfs jfs xfs gfs2 cifs fuse btrfs"
-LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror dm-multipath dm-round-robin dm-crypt"
-RAIDMODS="raid0 raid1 raid5 raid6 raid456 raid10 linear"
-CRYPTOMODS="sha256_generic cbc xts lrw aes_generic crypto_blkcipher crc32c ecb arc4"
-PCMCIASOCKMODS="yenta_socket i82365 tcic pcmcia"
-INITRDMODS="$USBMODS $FIREWIREMODS $IDEMODS $SCSIMODS $FSMODS $LVMMODS $RAIDMODS $CRYPTOMODS $COMMONMODS $PCMCIASOCKMODS $SDMODS =scsi =net =drm"
-
-. $(dirname $0)/buildinstall.functions
-
-# Set, verify, and create paths
-IMAGEPATH=$TOPDESTPATH/images
-FULLMODPATH=$TMPDIR/instimagemods.$$
-FINALFULLMODPATH=$IMGPATH/modules
-INSTIMGPATH=$TOPDESTPATH/images
-KERNELBASE=$TMPDIR/updboot.kernel.$$
-
-KERNELNAME=vmlinuz
-if [ "$BUILDARCH" = "ia64" ]; then
- KERNELDIR="/boot/efi/EFI/redhat"
-else
- KERNELDIR="/boot"
-fi
-
-if [ "$BUILDARCH" = "sparc64" ]; then
- BASEARCH=sparc
-else
- BASEARCH=$BUILDARCH
-fi
-
-# explicit block size setting for some arches (FIXME: we compose
-# ppc64-ish trees as ppc, so we have to set the "wrong" block size)
-if [ "$BUILDARCH" = "sparc64" ]; then
- CRAMBS="--blocksize 8192"
-elif [ "$BUILDARCH" = "sparc" ]; then
- CRAMBS="--blocksize 4096"
-else
- CRAMBS=""
-fi
-
-if [ "$BUILDARCH" = "x86_64" -o "$BUILDARCH" = "s390x" -o "$BUILDARCH" = "ppc64" ]; then
- LIBDIR=lib64
-else
- LIBDIR=lib
-fi
-
-rm -rf $IMAGEPATH
-rm -rf $FULLMODPATH
-rm -rf $FINALFULLMODPATH
-rm -rf $KERNELBASE
-mkdir -p $IMAGEPATH
-mkdir -p $FULLMODPATH
-mkdir -p $FINALFULLMODPATH
-mkdir -p $KERNELBASE
-mkdir -p $INSTIMGPATH
-
-# Stuff that we need
-TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids
-GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps
-GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz
-MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot
-GENMODINFO=$IMGPATH/usr/lib/anaconda-runtime/genmodinfo
-KEYMAPS=$TMPDIR/keymaps-$BUILDARCH.$$
-SCREENFONT=$IMGPATH/usr/lib/anaconda-runtime/screenfont-${BASEARCH}.gz
-MODLIST=$IMGPATH/usr/lib/anaconda-runtime/modlist
-MODINFO=$TMPDIR/modinfo-$BUILDARCH.$$
-LOADERBINDIR=$IMGPATH/usr/lib/anaconda-runtime/loader
-BOOTDISKDIR=$IMGPATH/usr/lib/anaconda-runtime/boot
-LANGTABLE=$IMGPATH/usr/lib/anaconda/lang-table
-PCIIDS=$IMGPATH/usr/share/hwdata/pci.ids
-XDRIVERS=$IMGPATH/usr/share/hwdata/videoaliases
-XDRIVERDESCS=$IMGPATH/usr/share/hwdata/videodrivers
-
-REQUIREMENTS="$TRIMPCIIDS $PCIIDS $XDRIVERDESCS $GENMODINFO
- $LANGTABLE $GETKEYMAPS"
-
-dieLater=
-for n in $REQUIREMENTS; do
- if [ ! -f $n ]; then
- echo "$n doesn't exist"
- dieLater=1
- fi
-done
-
-for n in $BOOTDISKDIR; do
- if [ ! -d $n ]; then
- echo "$n doesn't exist"
- dieLater=1
- fi
-done
-
-if [ -n "$dieLater" ]; then exit 1; fi
-
-if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then
- # go ahead and create the keymaps so we only have to do it once
- if [ -f $IMGPATH/usr/lib/anaconda-runtime/keymaps-override-$BUILDARCH ]; then
- echo "Found keymap override, using it"
- cp $IMGPATH/usr/lib/anaconda-runtime/keymaps-override-$BUILDARCH $KEYMAPS
- else
- echo "Running: $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH"
- $GETKEYMAPS $BUILDARCH $KEYMAPS $IMGPATH
- if [ $? != 0 ]; then
- echo "Unable to create keymaps and thus can't create initrd."
- exit 1
- fi
- fi
-fi
-
-findPackage() {
- name=$1
-
- pkg=$(repoquery --qf "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}" -c $yumconf --archlist=$KERNELARCH $name.$KERNELARCH)
- if [ -n "$pkg" ]; then
- echo $pkg
- return
- fi
- echo "cannot find package $name" >&2
-}
-
-rundepmod () {
- where=$1
-
- $FAKEARCH /sbin/depmod -a -F $KERNELROOT/boot/System.map-$version \
- -b $where $version
-}
-
-# This loops to make sure it resolves dependencies of dependencies of...
-resdeps () {
- items="$*"
-
- deplist=""
- for item in $items ; do
- deps=$(awk -F ':' "/$item.ko: / { print gensub(\".*/$item.ko: \",\"\",\"g\") }" $KERNELROOT/lib/modules/$version/modules.dep)
- for dep in $deps ; do
- depfile=${dep##*/}
- depname=${dep%%.ko}
- deplist="$deplist $depname"
- done
- done
- items=$(for n in $items $deplist; do echo $n; done | sort -u)
- echo $items
-}
-
-expandModuleSet() {
- SET=""
- for name in $1; do
- char=$(echo $name | cut -c1)
- if [ $char = '=' ]; then
- NAME=$(echo $name | cut -c2-)
- if [ "$NAME" = "ata" ]; then
- SET="$SET $(egrep '(ata|ahci)' $KERNELROOT/lib/modules/$version/modules.block |sed -e 's/.ko//')"
- elif [ "$NAME" = "scsi" ]; then
- SET="$SET $(sed -e 's/.ko//' $KERNELROOT/lib/modules/$version/modules.block)"
- elif [ "$NAME" = "net" ]; then
- SET="$SET $(sed -e 's/.ko//' $KERNELROOT/lib/modules/$version/modules.networking)"
- else
- # Ignore if group list does not exist
- if [ -e $KERNELROOT/lib/modules/$version/modules.$NAME ]; then
- SET="$SET $(sed -e 's/.ko//' $KERNELROOT/lib/modules/$version/modules.$NAME)"
- fi
- fi
- else
- SET="$SET $name"
- fi
- done
-
- echo $SET
-}
-
-makemoduletree() {
- MMB_DIR=$1
- MMB_MODULESET=$(resdeps $2)
-
- mkdir -p $MMB_DIR/lib
- mkdir -p $MMB_DIR/modules
- mkdir -p $MMB_DIR/firmware
- ln -snf ../modules $MMB_DIR/lib/modules
- ln -snf ../firmware $MMB_DIR/lib/firmware
-
- echo "Copying kernel modules..."
- cp -a $KERNELROOT/lib/modules/* $MMB_DIR/lib/modules/
- echo "Removing extraneous modules..."
- find $MMB_DIR/lib/modules/ -name *.ko | while read module ; do
- m=${module##*/}
- modname=${m%%.ko}
- echo $MMB_MODULESET | grep -wq $modname || {
- rm -f $module
- }
- done
-
- echo "Copying required firmware..."
- find $MMB_DIR/lib/modules/ -name *.ko | while read module ; do
- for fw in $(modinfo -F firmware $module); do
- dest=$MBD_DIR/firmware/$fw
- destdir=$(dirname $dest)
-
- # Some firmware files are expected to be in their own directories.
- if [ ! -d $destdir ]; then
- mkdir -p $destdir
- fi
-
- cp $KERNELROOT/lib/firmware/$fw $dest
- done
- done
-
- # Copy in driver firmware we know we'll want during installation. This is
- # required for modules which still don't (or can't) export information
- # about what firmware files they require.
- for module in $MODSET ; do
- case $module in
- ipw2100)
- cp $KERNELROOT/lib/firmware/ipw2100* $MBD_DIR/firmware
- ;;
- ipw2200)
- cp $KERNELROOT/lib/firmware/ipw2200* $MBD_DIR/firmware
- ;;
- iwl3945)
- cp $KERNELROOT/lib/firmware/iwlwifi-3945* $MBD_DIR/firmware
- ;;
- atmel)
- cp $KERNELROOT/lib/firmware/atmel_*.bin $MBD_DIR/firmware
- ;;
- zd1211rw)
- cp -r $KERNELROOT/lib/firmware/zd1211 $MBD_DIR/firmware
- ;;
- esac
- done
-
- # clean up leftover cruft
- find -H $MMB_DIR/lib/modules -type d -exec rmdir -f {} \; 2>/dev/null
- $MODLIST --modinfo-file $MODINFO --ignore-missing --modinfo \
- $MMB_MODULESET > $MMB_DIR/lib/modules/module-info
- # compress modules
- find -H $MMB_DIR/lib/modules -type f -name *.ko -exec gzip -9 {} \;
- rundepmod $MMB_DIR
- rm -f $MMB_DIR/lib/modules/*/modules.*map
- rm -f $MMB_DIR/lib/modules/*/{build,source}
-
- # create the pci.ids, from modules.alias and the X driver aliases
- awk '!/^(\t\t|#)/ { print ;if ($0 == "ffff Illegal Vendor ID") nextfile; }' < $PCIIDS | \
- $TRIMPCIIDS $MMB_DIR/lib/modules/*/modules.alias $XDRIVERS/* > ../pci.ids
-}
-
-
-makeproductfile() {
- root=$1
-
- rm -f $root/.buildstamp
- echo $IMAGEUUID > $root/.buildstamp
- echo $PRODUCT >> $root/.buildstamp
- echo $VERSION >> $root/.buildstamp
- if [ -n "$BUGURL" ]; then
- echo $BUGURL >> $root/.buildstamp
- fi
-}
-
-instbin() {
- ROOT=$1
- BIN=$2
- DIR=$3
- DEST=$4
-
- iself="$(file $ROOT/$BIN | grep ELF)"
-
- if [ -L $ROOT/$BIN ]; then
- cp -a $ROOT/$BIN $DIR/$DEST
- else
- if [ -z "$iself" ]; then
- install -m 755 $ROOT/$BIN $DIR/$DEST
- else
- install -s -m 755 $ROOT/$BIN $DIR/$DEST
-
- get_dso_deps $ROOT "$BIN"
- local DEPS="$DSO_DEPS"
- mkdir -p $DIR/$LIBDIR
-
- for x in $DEPS ; do
- cp -Lfp $ROOT/$x $DIR/$LIBDIR
- done
-
- pushd $DIR/$LIBDIR
- if [ -f ld-linux.so.2 -a ! -L ld-linux.so.2 ]; then
- rm -f ld-linux.so.2
- linker="$(ls -1 ld-*.*.*.so)"
- if [ -z "$linker" ]; then
- linker="$(ls -1 ld-*.*.so)"
- fi
- found=$(echo $linker | wc -l)
- if [ $found -ne 1 ]; then
- echo "Found too many dynamic linkers:" >&2
- echo $linker >&2
- exit 1
- fi
- ln -s $linker ld-linux.so.2
- fi
- popd
- if [ "$BUILDARCH" = "s390x" ]; then
- pushd $DIR/lib
- ln -s ../$LIBDIR/ld64.so.1
- popd
- fi
- fi
- fi
-}
-
-setupShellEnvironment() {
- echo "tcp 6 TCP" > $MBD_DIR/etc/protocols
-
- # PAM configuration
- for i in pam_limits.so pam_env.so pam_unix.so pam_deny.so; do
- cp -f $IMGPATH/$LIBDIR/security/$i $MBD_DIR/$LIBDIR/security
- done
-
- cp -f $IMGPATH/etc/pam.d/other $MBD_DIR/etc/pam.d
- cat > $MBD_DIR/etc/pam.d/login << EOF
-#%PAM-1.0
-auth required pam_env.so
-auth sufficient pam_unix.so likeauth nullok
-auth required pam_deny.so
-account required pam_unix.so
-password sufficient pam_unix.so nullok use_authtok md5 shadow
-password required pam_deny.so
-session required pam_limits.so
-session required pam_unix.so
-EOF
- cp -f $MBD_DIR/etc/pam.d/login $MBD_DIR/etc/pam.d/sshd
- cp -f $MBD_DIR/etc/pam.d/login $MBD_DIR/etc/pam.d/remote
-
- cp -f $IMGPATH/etc/security/{limits.conf,pam_env.conf} $MBD_DIR/etc/security/
-
- # key generation takes ages on s390, you really don't want this for every
- # installation attempt. These are NOT the keys of the installed system!
- mkdir -m 0700 -p $MBD_DIR/etc/ssh
- echo -n "Generating SSH1 RSA host key: "
- /usr/bin/ssh-keygen -q -t rsa1 -f $MBD_DIR/etc/ssh/ssh_host_key \
- -C '' -N '' >&/dev/null
- echo
- echo -n "Generating SSH2 RSA host key: "
- /usr/bin/ssh-keygen -q -t rsa -f $MBD_DIR/etc/ssh/ssh_host_rsa_key \
- -C '' -N '' >&/dev/null
- echo
- echo -n "Generating SSH2 DSA host key: "
- /usr/bin/ssh-keygen -q -t dsa -f $MBD_DIR/etc/ssh/ssh_host_dsa_key \
- -C '' -N '' >&/dev/null
- echo
- (cd $MBD_DIR/etc/ssh; \
- chmod 600 ssh_host_key ssh_host_rsa_key ssh_host_dsa_key; \
- chmod 644 ssh_host_key.pub ssh_host_rsa_key.pub ssh_host_dsa_key.pub; )
-
- cat > $MBD_DIR/etc/ssh/sshd_config <&2
- exit 1
- fi
- if [ -z "$INITRDMODULES" ]; then
- echo "warning: no loader modules specified!" >&2
- fi
- if [ -z "$INITRDSIZE" ]; then
- echo "I don't know how big to make the initrd image!" >&2
- exit 1
- fi
-
- MBD_DIR=$TMPDIR/makebootdisk.dir.$$
- MBD_FSIMAGE=$TMPDIR/makebootdisk.initrdimage.$$
- MBD_BOOTTREE=$TMPDIR/makebootdisk.tree.$$
-
- rm -rf $MBD_DIR $MBD_FSIMAGE
- mkdir -p $MBD_DIR/modules
- mkdir -p $MBD_DIR/sbin
- mkdir -p $MBD_DIR/dev
- mkdir -p $MBD_DIR/etc
- mkdir -p $MBD_DIR/etc/udev/rules.d
- mkdir -p $MBD_DIR/lib/udev/rules.d
- mkdir -p $MBD_DIR/proc
- mkdir -p $MBD_DIR/selinux
- mkdir -p $MBD_DIR/sys
- mkdir -p $MBD_DIR/etc/terminfo/{a,b,d,l,s,v,x}
- mkdir -p $MBD_DIR/tmp
- mkdir -p $MBD_DIR/usr/libexec
- mkdir -p $MBD_DIR/usr/$LIBDIR/NetworkManager
- mkdir -p $MBD_DIR/usr/share/dbus-1/system-services
- mkdir -p $MBD_DIR/var/cache/hald
- mkdir -p $MBD_DIR/var/lib/dbus
- mkdir -p $MBD_DIR/var/lib/dhclient
- mkdir -p $MBD_DIR/etc/dhcp
- mkdir -p $MBD_DIR/var/lock/rpm
- mkdir -p $MBD_DIR/var/run
- mkdir -p $MBD_DIR/var/run/dbus
- mkdir -p $MBD_DIR/var/run/hald
- mkdir -p $MBD_DIR/var/run/NetworkManager
- mkdir -p $MBD_DIR/etc/dbus-1/system.d
- mkdir -p $MBD_DIR/etc/modprobe.d
- mkdir -p $MBD_DIR/etc/NetworkManager/dispatcher.d
- mkdir -p $MBD_DIR/$LIBDIR/dbus-1
- mkdir -p $MBD_DIR/etc/sysconfig/network-scripts
- mkdir -p $MBD_DIR/usr/share/PolicyKit/policy
- mkdir -p $MBD_DIR/etc/PolicyKit
- mkdir -p $MBD_DIR/var/lib/misc
- mkdir -p $MBD_DIR/etc/hal/fdi
- mkdir -p $MBD_DIR/usr/share/hal/fdi
- mkdir -p $MBD_DIR/usr/share/hwdata
- mkdir -p $MBD_DIR/etc/rc.d/init.d
- mkdir -p $MBD_DIR/usr/sbin
- mkdir -p $MBD_DIR/var/run/wpa_supplicant
-
- if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then
- mkdir -m 111 -p $MBD_DIR/var/empty/sshd
- mkdir -p $MBD_DIR/etc/{pam.d,security}
- mkdir -p $MBD_DIR/$LIBDIR/security
- cp $IMGPATH/$LIBDIR/libpam_misc.so.0.* $MBD_DIR/$LIBDIR/libpam_misc.so.0
- cp $IMGPATH/$LIBDIR/libwrap*.so* $MBD_DIR/$LIBDIR/
- ln -s /tmp $MBD_DIR/var/state/xkb
- cp $IMGPATH/usr/bin/xauth $MBD_DIR/sbin/xauth
- cp $IMGPATH/usr/sbin/cmsfs* $MBD_DIR/sbin/
- fi
-
- if [ -n "$INITRDMODULES" ]; then
- MODSET=`expandModuleSet "$INITRDMODULES"`
- makemoduletree $MBD_DIR "$MODSET"
- fi
-
- # set up the arch bits
- echo $arch > $MBD_DIR/etc/arch
-
- echo "Setting up arch bits"
- instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/$LOADERBIN $MBD_DIR /sbin/loader
- if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then
- instbin $IMGPATH ${LOADERBINDIR##$IMGPATH}/init $MBD_DIR /sbin/init
- ln -s ./init $MBD_DIR/sbin/reboot
- ln -s ./init $MBD_DIR/sbin/halt
- ln -s ./init $MBD_DIR/sbin/poweroff
- else
- instbin $IMGPATH ${LOADERBINDIR##IMGPATH}/shutdown $MBD_DIR /sbin/shutdown
- instbin $IMGPATH /usr/lib/anaconda-runtime/loader/linuxrc.s390 $MBD_DIR /sbin/init
- instbin $IMGPATH /usr/lib/anaconda-runtime/loader/lsznet.raw $MBD_DIR /sbin/lsznet
- instbin $IMGPATH /usr/lib/anaconda-runtime/loader/controlunits.sh $MBD_DIR /sbin/controlunits
- instbin $IMGPATH /usr/sbin/dasdfmt $MBD_DIR /sbin/dasdfmt
- fi
-
- if [ "$BUILDARCH" != "s390" -a "$BUILDARCH" != "s390x" ]; then
- install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz
- install -m 644 $SCREENFONT $MBD_DIR/etc/screenfont.gz
- fi
-
- install -m 644 $MYLANGTABLE $MBD_DIR/etc/lang-table
- install -m 644 $IMGPATH/etc/passwd $MBD_DIR/etc/passwd
- install -m 644 $IMGPATH/etc/group $MBD_DIR/etc/group
- install -m 644 $IMGPATH/etc/nsswitch.conf $MBD_DIR/etc/nsswitch.conf
- install -m 644 $IMGPATH/etc/hosts $MBD_DIR/etc/hosts
- mkdir -p $MBD_DIR/usr/lib/locale
- localedef -c -i en_US -f UTF-8 --prefix $MBD_DIR en_US
-
- instbin $IMGPATH /usr/bin/mount $MBD_DIR /sbin/mount
- for mountcmd in $IMGPATH/usr/sbin/mount.* ; do
- cmd="$(basename $mountcmd)"
- instbin $IMGPATH /usr/sbin/$cmd $MBD_DIR /sbin/$cmd
- done
- instbin $IMGPATH /usr/bin/umount $MBD_DIR /sbin/umount
- for umountcmd in $IMGPATH/usr/sbin/umount.* ; do
- cmd="$(basename $umountcmd)"
- instbin $IMGPATH /usr/sbin/$cmd $MBD_DIR /sbin/$cmd
- done
-
- instbin $IMGPATH /usr/sbin/udevd $MBD_DIR /sbin/udevd
- instbin $IMGPATH /usr/sbin/udevadm $MBD_DIR /sbin/udevadm
- instbin $IMGPATH /usr/bin/udevinfo $MBD_DIR /sbin/udevinfo
- instbin $IMGPATH /usr/sbin/udevsettle $MBD_DIR /sbin/udevsettle
-
- instbin $IMGPATH /usr/bin/bash $MBD_DIR /sbin/bash
- ( cd $MBD_DIR/sbin ; ln -sf bash sh )
- instbin $IMGPATH /usr/sbin/consoletype $MBD_DIR /sbin/consoletype
- instbin $IMGPATH /usr/bin/logger $MBD_DIR /sbin/logger
-
- ( cd $IMGPATH/etc/rc.d/init.d
- cp -a functions $MBD_DIR/etc/rc.d/init.d
- )
-
- ( cd $IMGPATH/etc/sysconfig/network-scripts
- cp -a network-functions $MBD_DIR/etc/sysconfig/network-scripts
- cp -a network-functions-ipv6 $MBD_DIR/etc/sysconfig/network-scripts
- )
-
- ( cd $MBD_DIR/etc ; ln -sf /etc/rc.d/init.d init.d )
-
- # DHCP and DHCPv6 client daemons and support programs
- instbin $IMGPATH /usr/sbin/dhclient $MBD_DIR /sbin/dhclient
- cp -a $IMGPATH/usr/sbin/dhclient-script $MBD_DIR/sbin/dhclient-script
- chmod 0755 $MBD_DIR/sbin/dhclient-script
- instbin $IMGPATH /usr/sbin/dhcp6c $MBD_DIR /sbin/dhcp6c
- instbin $IMGPATH /usr/sbin/arping $MBD_DIR /sbin/arping
- instbin $IMGPATH /usr/sbin/ifconfig $MBD_DIR /sbin/ifconfig
- instbin $IMGPATH /usr/sbin/ip $MBD_DIR /sbin/ip
- instbin $IMGPATH /usr/bin/ipcalc $MBD_DIR /sbin/ipcalc
- instbin $IMGPATH /usr/bin/hostname $MBD_DIR /sbin/hostname
- instbin $IMGPATH /usr/sbin/ethtool $MBD_DIR /sbin/ethtool
- instbin $IMGPATH /usr/sbin/route $MBD_DIR /sbin/route
- touch $MBD_DIR/etc/resolv.conf
-
- # hwdata
- cp -a $IMGPATH/usr/share/hwdata/pci.ids $MBD_DIR/usr/share/hwdata/pci.ids
- cp -a $IMGPATH/usr/share/hwdata/usb.ids $MBD_DIR/usr/share/hwdata/usb.ids
-
- # hal
- instbin $IMGPATH /usr/sbin/hald $MBD_DIR /sbin/hald
- ( cd $IMGPATH/usr/libexec
- for f in hald-runner hald-generate-fdi-cache hal*storage* ; do
- instbin $IMGPATH /usr/libexec/$f $MBD_DIR /usr/libexec/$f
- done
- )
- touch $MBD_DIR/var/run/hald.acl-list
- cp -a $IMGPATH/usr/share/hal/fdi/* $MBD_DIR/usr/share/hal/fdi
- cp -a $IMGPATH/etc/hal/fdi/* $MBD_DIR/etc/hal/fdi
- cp -a $IMGPATH/etc/dbus-1/system.d/hal.conf $MBD_DIR/etc/dbus-1/system.d
-
- # PolicyKit
- ( cd $IMGPATH/etc/PolicyKit
- cp -a PolicyKit.conf $MBD_DIR/etc/PolicyKit
- )
- ( cd $IMGPATH/usr/share/dbus-1/system-services
- cp -a org.freedesktop.PolicyKit.service $MBD_DIR/usr/share/dbus-1/system-services
- )
- ( cd $IMGPATH/usr/share/PolicyKit/policy
- cp -a org.freedesktop.policykit.policy $MBD_DIR/usr/share/PolicyKit/policy
- )
- ( cd $IMGPATH/var/lib/misc
- cp -a PolicyKit.reload $MBD_DIR/var/lib/misc
- )
-
- # dbus
- instbin $IMGPATH /usr/bin/dbus-uuidgen $MBD_DIR /sbin/dbus-uuidgen
- instbin $IMGPATH /usr/bin/dbus-daemon $MBD_DIR /sbin/dbus-daemon
- cp -a $IMGPATH/etc/dbus-1/system.conf $MBD_DIR/etc/dbus-1/system.conf
- cp -a $IMGPATH/$LIBDIR/dbus-1/dbus-daemon-launch-helper $MBD_DIR/$LIBDIR/dbus-1
- chown root:dbus $MBD_DIR/$LIBDIR/dbus-1/dbus-daemon-launch-helper
- chmod 04750 $MBD_DIR/$LIBDIR/dbus-1/dbus-daemon-launch-helper
-
- # wpa_supplicant
- instbin $IMGPATH /usr/sbin/wpa_passphrase $MBD_DIR /usr/sbin/wpa_passphrase
- instbin $IMGPATH /usr/sbin/wpa_supplicant $MBD_DIR /usr/sbin/wpa_supplicant
- cp -a $IMGPATH/etc/dbus-1/system.d/wpa_supplicant.conf $MBD_DIR/etc/dbus-1/system.d
- cp -a $IMGPATH/etc/wpa_supplicant/wpa_supplicant.conf $MBD_DIR/etc/wpa_supplicant
- ( cd $IMGPATH/usr/share/dbus-1/system-services
- cp -a fi.epitest.hostap.WPASupplicant.service $MBD_DIR/usr/share/dbus-1/system-services
- )
-
- # NetworkManager
- instbin $IMGPATH /usr/sbin/NetworkManager $MBD_DIR /usr/sbin/NetworkManager
- instbin $IMGPATH /usr/sbin/nm-system-settings $MBD_DIR /usr/sbin/nm-system-settings
- cp -a $IMGPATH/etc/dbus-1/system.d/nm-*.conf $MBD_DIR/etc/dbus-1/system.d
- cp -a $IMGPATH/etc/dbus-1/system.d/NetworkManager.conf $MBD_DIR/etc/dbus-1/system.d
- cp -a $IMGPATH/etc/NetworkManager/nm-system-settings.conf $MBD_DIR/etc/NetworkManager
- ( cd $IMGPATH/usr/$LIBDIR/NetworkManager
- for f in *.so ; do
- instbin $IMGPATH /usr/$LIBDIR/NetworkManager/$f $MBD_DIR /usr/$LIBDIR/NetworkManager/$f
- done
- )
- ( cd $IMGPATH/usr/libexec
- for f in nm-* ; do
- instbin $IMGPATH /usr/libexec/$f $MBD_DIR /usr/libexec/$f
- done
- )
- ( cd $IMGPATH/usr/share/dbus-1/system-services
- cp -a org.freedesktop.NetworkManagerSystemSettings.service $MBD_DIR/usr/share/dbus-1/system-services
- cp -a org.freedesktop.nm_dispatcher.service $MBD_DIR/usr/share/dbus-1/system-services
- )
-
- # Misc
- instbin $IMGPATH /usr/bin/awk $MBD_DIR /sbin/awk
- instbin $IMGPATH /usr/bin/egrep $MBD_DIR /sbin/egrep
- instbin $IMGPATH /usr/bin/fgrep $MBD_DIR /sbin/fgrep
- instbin $IMGPATH /usr/bin/gawk $MBD_DIR /sbin/gawk
- instbin $IMGPATH /usr/bin/grep $MBD_DIR /sbin/grep
- instbin $IMGPATH /usr/bin/kill $MBD_DIR /sbin/kill
- instbin $IMGPATH /usr/bin/ln $MBD_DIR /sbin/ln
- instbin $IMGPATH /usr/bin/readlink $MBD_DIR /sbin/readlink
- instbin $IMGPATH /usr/bin/rm $MBD_DIR /sbin/rm
- instbin $IMGPATH /usr/bin/rmdir $MBD_DIR /sbin/rmdir
- instbin $IMGPATH /usr/bin/sed $MBD_DIR /sbin/sed
- instbin $IMGPATH /usr/bin/sleep $MBD_DIR /sbin/sleep
- instbin $IMGPATH /usr/bin/touch $MBD_DIR /sbin/touch
-
- # Indirect dependencies
- install -m 755 $IMGPATH/$LIBDIR/libfreebl3.so $MBD_DIR/$LIBDIR/
- install -m 755 $IMGPATH/$LIBDIR/libsoftokn3.so $MBD_DIR/$LIBDIR/
- install -m 755 $IMGPATH/usr/$LIBDIR/libsqlite3.so.0 $MBD_DIR/usr/$LIBDIR/
- install -m 755 $IMGPATH/$LIBDIR/libnss_dns.so.2 $MBD_DIR/$LIBDIR/
- install -m 755 $IMGPATH/$LIBDIR/libnss_files.so.2 $MBD_DIR/$LIBDIR/
- install -m 755 $IMGPATH/$LIBDIR/libgcc_s.so.1 $MBD_DIR/$LIBDIR/
-
- install -m 644 $IMGPATH/etc/udev/udev.conf $MBD_DIR/etc/udev/udev.conf
- for i in $IMGPATH/lib/udev/rules.d/*.rules ; do
- install -m 644 $i $MBD_DIR/lib/udev/rules.d/${i##*/}
- done
- for i in $IMGPATH/etc/udev/rules.d/*.rules ; do
- install -m 644 $i $MBD_DIR/etc/udev/rules.d/${i##*/}
- done
- for i in $IMGPATH/lib/udev/*; do
- if [ -f $i ]; then install -m 755 $i $MBD_DIR/lib/udev/${i##*/}; fi
- done
- rm -f $MBD_DIR/lib/udev/rules.d/*persistent*
- rm -f $MBD_DIR/lib/udev/rules.d/*generator*
-
- install -m 644 $LOADERBINDIR/$MYLOADERTR $MBD_DIR/etc/loader.tr
- for i in a/ansi d/dumb l/linux s/screen v/vt100 v/vt100-nav v/vt102 x/xterm x/xterm-color g/gnome ; do
- [ -f $IMGPATH/usr/share/terminfo/$i ] && \
- install -m 644 $IMGPATH/usr/share/terminfo/$i $MBD_DIR/etc/terminfo/$i
- done
-
- makeproductfile $MBD_DIR
-
- for n in insmod rmmod modprobe; do
- instbin $IMGPATH /usr/sbin/$n $MBD_DIR /sbin/$n
- done
-
- ln -s /sbin/init $MBD_DIR/init
- ln -s /proc/mounts $MBD_DIR/etc/mtab
- ln -s sbin $MBD_DIR/bin
- mkdir -p $MBD_DIR/var/lib
- ln -s ../../tmp $MBD_DIR/var/lib/xkb
-
- # s390/s390x need sshd setup
- if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then
- setupShellEnvironment
- fi
-
-cat > $MBD_DIR/.profile < $MBD_FSIMAGE
-
- size=$(du $MBD_FSIMAGE | awk '{ print $1 }')
-
- echo "Wrote $MBD_FSIMAGE (${size}k compressed)"
-
- if [ -n "$EXTRAINITRDPATH" ]; then
- mkdir -p `dirname $EXTRAINITRDPATH`
- cp -a $MBD_FSIMAGE $EXTRAINITRDPATH
- fi
-
- if [ -z "$KEEP" ]; then
- rm -rf $MBD_FSIMAGE $MBD_BOOTTREE
- fi
-}
-
-makeinstimage () {
- imagename=$1
- type=$2
- tmp=$TMPDIR/instimage.dir.$$
-
- rm -rf $tmpimage $tmp
- mkdir -p $mntpoint $tmp
-
- mkdir -p $tmp
- (cd $IMGPATH; find . | cpio --quiet -p $tmp)
- makeproductfile $tmp
-
- if [ -z "$type" -o "$type" = "cramfs" ]; then
- echo "Running mkcramfs $CRAMBS $tmp $INSTIMGPATH/${imagename}2.img"
- mkfs.cramfs $CRAMBS $tmp $TMPDIR/${imagename}2.img.$$
- elif [ "$type" = "squashfs" ]; then
- echo "Running mksquashfs $tmp $TMPDIR/${imagename}2.img -all-root -no-fragments -no-progress"
- mksquashfs $tmp $TMPDIR/${imagename}2.img.$$ -all-root -no-fragments -no-progress
- chmod 0644 $TMPDIR/${imagename}2.img.$$
- fi
- cp $TMPDIR/${imagename}2.img.$$ $INSTIMGPATH/${imagename}2.img
- size=$(ls -l $INSTIMGPATH/${imagename}2.img | awk '{print $5}')
- size=$(expr $size / 1024)
- echo "Wrote $INSTIMGPATH/${imagename}2.img (${size}k)..."
- relpath=${INSTIMGPATH#$TOPDESTPATH/}
- echo "instimage = ${relpath}/${imagename}2.img" >> $TOPDESTPATH/.treeinfo
- rm -rf $tmp
-}
-
-makemainimage () {
- imagename=$1
- type=$2
- mmi_tmpimage=$TMPDIR/instimage.img.$$
- mmi_mntpoint=$TMPDIR/instimage.mnt.$$
-
- rm -rf $mmi_tmpimage $mmi_mntpoint
- mkdir $mmi_mntpoint
-
- if [ $type = "ext2" ]; then
- SIZE=$(du -sk $IMGPATH | awk '{ print int($1 * 1.1) }')
- if [ -d $IMGPATH/usr/lib/anaconda-runtime ]; then
- ERROR=$(du -sk $IMGPATH/usr/lib/anaconda-runtime | awk '{ print $1 }')
- SIZE=$(expr $SIZE - $ERROR)
- fi
- if [ -d $IMGPATH/usr/share/syslinux ]; then
- ERROR=$(du -sk $IMGPATH/usr/share/syslinux | awk '{ print $1 }')
- SIZE=$(expr $SIZE - $ERROR)
- fi
- dd if=/dev/zero bs=1k count=${SIZE} of=$mmi_tmpimage 2>/dev/null
- mke2fs -q -F $mmi_tmpimage > /dev/null
- tune2fs -c0 -i0 $mmi_tmpimage >/dev/null
- mount -o loop $mmi_tmpimage $mmi_mntpoint
-
- (cd $IMGPATH; find . |
- fgrep -v "./usr/lib/anaconda-runtime" |
- fgrep -v "./usr/share/syslinux"
- cpio -H crc -o) | (cd $mmi_mntpoint; cpio -iumd)
- makeproductfile $mmi_mntpoint
- umount $mmi_mntpoint
- rmdir $mmi_mntpoint
- elif [ $type = "squashfs" ]; then
- makeproductfile $IMGPATH
- echo "Running mksquashfs $IMGPATH $mmi_tmpimage -all-root -no-fragments -no-progress"
- mksquashfs $IMGPATH $mmi_tmpimage -all-root -no-fragments -no-progress
- chmod 0644 $mmi_tmpimage
- SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024)
- elif [ $type = "cramfs" ]; then
- makeproductfile $IMGPATH
- echo "Running mkcramfs $CRAMBS $IMGPATH $mmi_tmpimage"
- mkfs.cramfs $CRAMBS $IMGPATH $mmi_tmpimage
- SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024)
- fi
-
- cp $mmi_tmpimage $INSTIMGPATH/${imagename}.img
- chmod 644 $INSTIMGPATH/${imagename}.img
-
- echo "Wrote $INSTIMGPATH/${imagename}.img (${SIZE}k)"
- relpath=${INSTIMGPATH#$TOPDESTPATH/}
- echo "mainimage = ${relpath}/${imagename}.img" >> $TOPDESTPATH/.treeinfo
-
- rm $mmi_tmpimage
-}
-
-makeSecondStage() {
- echo "[stage2]" >> $TOPDESTPATH/.treeinfo
- echo "Building install.img"
- makemainimage "install" "squashfs"
- [ $? = 0 ] || exit 1
-}
-
-doPostImages() {
- /bin/true
-}
-
-# this gets overloaded if we're on an EFI-capable arch (... with grub)
-makeEfiImages()
-{
- echo "Not on an EFI capable machine; skipping EFI images."
- /bin/true
-}
-
-# source the architecture specific mk-images file so we can call functions
-# in it
-if [ ${BUILDARCH} = s390x ]; then
- # FIXME: this is a bad hack for s390, but better than copying for now
- source $TOPDIR/mk-images.s390
-elif [ ${BUILDARCH} = ppc64 ]; then
- # ... and similar for ppc64
- source $TOPDIR/mk-images.ppc
-elif [ ${BUILDARCH} = "x86_64" -o ${BUILDARCH} = "i386" ]; then
- source $TOPDIR/mk-images.x86
- source $TOPDIR/mk-images.efi
-else
- source $TOPDIR/mk-images.${BUILDARCH}
-fi
-
-# Find the kernel, unpack it, and verify it
-kerneltags="kernel"
-efiarch=""
-arches="$BUILDARCH"
-if [ "$BUILDARCH" = "ppc" ]; then
- arches="ppc64 ppc"
-elif [ "$BUILDARCH" = "i386" ]; then
- arches="i586"
- efiarch="ia32"
- kerneltags="kernel kernel-PAE"
- kernelxen="kernel-PAE"
-elif [ "$BUILDARCH" = "x86_64" ]; then
- kerneltags="kernel"
- efiarch="x64"
-elif [ "$BUILDARCH" = "ia64" ]; then
- kerneltags="kernel"
- efiarch="ia64"
-fi
-
-foundakernel=""
-for KERNELARCH in $arches; do
- for kernelvers in $kerneltags; do
- kpackage=$(findPackage $kernelvers)
- if [ "$KERNELARCH" = "i586" -a -z "$kpackage" ]; then
- echo "No i586 kernel, trying i686..."
- KERNELARCH="i686"
- kpackage=$(findPackage $kernelvers)
- fi
-
- if [ -z "$kpackage" ]; then
- echo "Unable to find kernel package $kernelvers"
- continue
- fi
-
- yumdownloader -c $yumconf --archlist=$KERNELARCH $kpackage
- kpackage="$kpackage.rpm"
- if [ ! -f "$kpackage" ]; then
- echo "kernel ($kernelvers) doesn't exist for $KERNELARCH. skipping"
- continue
- fi
-
- KERNELROOT=$KERNELBASE/$KERNELARCH
- mkdir -p $KERNELROOT
-
- foundakernel="yes"
-
- if [ "$BUILDARCH" = "ia64" ]; then
- vmlinuz=$(rpm --nodigest --nosignature -qpl $kpackage |grep ^/boot/efi/EFI/redhat/vmlinuz | head -n 1)
- version=${vmlinuz##/boot/efi/EFI/redhat/vmlinuz-}
- else
- vmlinuz=$(rpm --nodigest --nosignature -qpl $kpackage |grep ^/boot/vmlinuz | head -n 1)
- version=${vmlinuz##/boot/vmlinuz-}
- fi
- arch=$(rpm --nodigest --nosignature --qf '%{ARCH}\n' -qp $kpackage)
-
- rpm2cpio $kpackage | (cd $KERNELROOT; cpio --quiet -iumd)
- rm -f $kpackage
- # expand out any available firmware too
- for p in $(repoquery -c $yumconf '*firmware*') ; do
- yumdownloader -c $yumconf $p
- rpm2cpio *firmware*.rpm | (cd $KERNELROOT; cpio --quiet -iumd)
- rm -f *firmware*.rpm
- done
-
- if [ ! -d "$KERNELROOT/lib/modules/$version" ]; then
- echo "$KERNELROOT/lib/modules/$version is not a valid modules directory" 2>&1
- exit 1
- fi
-
- if [ ! -f "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version" ]; then
- echo "$KERNELROOT/$KERNELDIR/${KERNELNAME}-$version does not exist"
- exit 1
- fi
-
- allmods=$(find $KERNELROOT/lib/modules/$version -name *.ko)
-
- rundepmod $KERNELROOT
- $GENMODINFO $KERNELROOT/lib/modules/$version > $MODINFO
-
- # make the boot images
- makeBootImages
-
- makeEfiImages $yumconf
- done
-done
-
-if [ -n "$foundakernel" ]; then
- makeSecondStage
- rm -rf $KERNELBASE
-fi
-
-doPostImages
-
-cd $TOPDIR
diff --git a/rewrite/mk-images.alpha b/rewrite/mk-images.alpha
deleted file mode 100644
index fb2ad60a..00000000
--- a/rewrite/mk-images.alpha
+++ /dev/null
@@ -1,131 +0,0 @@
-#
-# mk-images.alpha
-#
-# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-INITRDMODS="tgafb crc32 $INITRDMODS"
-
-###FSMODS="msdos vfat ext3 reiserfs jfs xfs"
-###IDEMODS="cdrom ide-cd"
-###SCSIMODS="cdrom scsi_mod sd_mod sg sr_mod st"
-###USBMODS="ohci-hcd uhci-hcd hid usb-storage sd_mod sr_mod"
-###LATEUSBMODS="mousedev usb-storage"
-###SECSTAGE="md raid0 raid1 raid5 dm-mod srm_env $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS"
-NETMODULES="e100 tulip 8139too tulip 3c509 3c59x dl2k eepro epic100 ewrk3 hamachi natsemi ne2k-pci ns83820 starfire yellowfin de4x5 depca acenic tg3"
-
-SCSIMODULES="$SCSIMODS qlogicisp DAC960 cpqfc BusLogic 3w-xxxx dmx3191d dpt_i2o megaraid ncr53c8xx sym53c8xx qlogicfc qla2x00 qla1280 cciss cpqarray aic7xxx aha1740 megaraid"
-
-###ISOMODULES="ehci-hcd ieee1394 ohci1394 sbp2"
-
-prepareBootImage() {
- echo "ALPHA: prepareBootImage() is called"
- dd if=/dev/zero of=$MBD_TMPIMAGE bs=1k count=$BOOTDISKSIZE 2>/dev/null
- echo y | /sbin/mke2fs -b 1024 -r 0 -O none $MBD_TMPIMAGE > /dev/null 2>/dev/null
- LODEV=`findloopdevice $MBD_TMPIMAGE`
- e2writeboot $LODEV $BOOTDISKDIR/bootlx
- mount $LODEV -t ext2 $MBD_BOOTTREE
- mkdir -p $MBD_BOOTTREE/etc
- cat > $MBD_BOOTTREE/etc/aboot.conf < $MBD_BOOTTREE/etc/milo.conf < $MBD_BOOTTREE/vmlinux.gz
- umount $LODEV
- losetup -d $LODEV
- mount -o loop -t ext2 $MBD_TMPIMAGE $MBD_BOOTTREE
-}
-
-makeBootImages() {
- echo "Building boot images for kernel $kernelvers"
-
- mkdir -p $TOPDESTPATH/boot
- cp $BOOTDISKDIR/bootlx $TOPDESTPATH/boot
-
- mkdir -p $TOPDESTPATH/etc
- cat > $TOPDESTPATH/etc/aboot.conf <.
-#
-
-#makebootdisk required for EFI bootloader dosfs image
-makebootdisk() {
- EXTRAKERNELPATH=""
- INITRDFLAGS=""
- MBD_FILENAME=""
- INITRDFILE=""
- MBD_TMPIMAGE=${TMPDIR:-/tmp}/makebootdisk.image.$$
- MBD_BOOTTREE=${TMPDIR:-/tmp}/makebootdisk.tree.$$
- MBD_BOOTTREE_TMP=$MBD_BOOTTREE'_tmp'
- while [ x$(echo $1 | cut -c1-2) = x"--" ]; do
- if [ $1 = "--kernelto" ]; then
- EXTRAKERNELPATH=$2
- shift; shift
- continue
- elif [ $1 = "--initrdflags" ]; then
- INITRDFLAGS=$2
- shift; shift
- continue
- elif [ $1 = "--initrd" ]; then
- INITRDFILE=$2
- shift; shift
- continue
- elif [ $1 = "--imagename" ]; then
- MBD_FILENAME=$IMAGEPATH/$2
- shift; shift
- continue
- fi
- echo "Unknown option passed to makebootdisk"
- exit 1
- done
-
- if [ -z "$MBD_FILENAME" ]; then
- echo "No imagename passed"
- exit 1
- fi
-
- if [ -n "$INITRDFILE" ]; then
- MBD_FSIMAGE="$INITRDFILE"
- elif [ -n "$INITRDFLAGS" ]; then
- eval makeinitrd --keep $INITRDFLAGS
- fi
-
- mkdir -p $MBD_BOOTTREE
- mkdir -p $MBD_BOOTTREE_TMP
- rm -rf $MBD_BOOTTREE_TMP
- mkdir -p $MBD_TMPIMAGE
-
- # provided by the mk-image.$ARCH file
- prepareBootImage
-
- left=$(df $MBD_BOOTTREE | tail -n1)
- left=$(echo $left | awk '{print $4'})
-
- umount $MBD_BOOTTREE
-
- if [ -n "$EXTRAKERNELPATH" ]; then
- mkdir -p `dirname $EXTRAKERNELPATH`
- cp -f $KERNELROOT/$KERNELDIR/${KERNELNAME}-* $EXTRAKERNELPATH
- fi
-
- mkdir -p `dirname $MBD_FILENAME`
- rm -rf $MBD_TMPIMAGE $MBD_MNTPOINT $MBD_BOOTTREE
- if [ -z "$INITRDFILE" ]; then
- rm -f $MBD_FSIMAGE
- fi
-
- echo "Wrote $MBD_FILENAME (${left}k free)"
-}
-
-prepareBootImage() {
-
- prepareBootTree
-
- # dynamically calculate the size of the dosfs
- BOOTDISKSIZE=$(du -kcs $MBD_BOOTTREE_TMP | tail -n1 | awk '{print $1}')
- BOOTDISKSIZE=$(expr $BOOTDISKSIZE + 100)
- echo "The size of the boot.img dosfs is $BOOTDISKSIZE"
- mkdosfs -n ANACONDA -C $MBD_FILENAME $BOOTDISKSIZE >/dev/null
- mount -o loop -t vfat $MBD_FILENAME $MBD_BOOTTREE
- cp -R $MBD_BOOTTREE_TMP/* $MBD_BOOTTREE
-}
-
-prepareBootTree() {
- mkdir -p $MBD_BOOTTREE_TMP/EFI/boot
- cp $MBD_FSIMAGE $MBD_BOOTTREE_TMP/EFI/boot/initrd.img
-
- cp -a $BOOTDISKDIR/* $MBD_BOOTTREE_TMP/EFI/boot/
- cp $KERNELROOT/boot/efi/EFI/redhat/vmlinuz-* $MBD_BOOTTREE_TMP/EFI/boot/vmlinuz
-
- cp $MBD_BOOTTREE_TMP/EFI/boot/elilo.efi $MBD_BOOTTREE_TMP/EFI/boot/bootia64.efi
- cat > $MBD_BOOTTREE_TMP/EFI/boot/elilo.conf << EOF
-prompt
-timeout=50
-relocatable
-
-image=vmlinuz
- label=linux
- read-only
- initrd=initrd.img
-EOF
-
- # make a copy in the root of the image
- cp $MBD_BOOTTREE_TMP/EFI/boot/* $MBD_BOOTTREE_TMP
-}
-
-makeBootImages() {
- # Because ia64 boxes use EFI there needs to be a boot.img dosfs.
- echo "making boot.img for EFI bootloader"
- makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \
- --imagename boot.img \
- --initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \
- --initrdsize 12288 \
- --loaderbin loader \
- --modules "$INITRDMODS sgiioc4" '
-
-
- mkdir -p $TOPDESTPATH/images/pxeboot
- makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
- --initrdsize 12288 \
- --loaderbin loader \
- --modules "$INITRDMODS sgiioc4"
- [ $? = 0 ] || exit 1
- mv $TOPDESTPATH/kernels/vmlinuz $TOPDESTPATH/images/pxeboot/vmlinuz
- rmdir $TOPDESTPATH/kernels
-
- # make a pxe dir with kernel + initrd
- cat > $TOPDESTPATH/images/pxeboot/README <> $TOPDESTPATH/.treeinfo
-[images-$KERNELARCH]
-kernel = images/pxeboot/vmlinuz
-initrd = images/pxeboot/initrd.img
-boot.img = images/boot.img
-
-[images-xen]
-kernel = images/pxeboot/vmlinuz
-initrd = images/pxeboot/initrd.img
-
-__EOT__
-}
-
-doPostImages() {
- if [ -n "$BOOTISO" ]; then
- mkisofs -quiet -o $TOPDESTPATH/images/$BOOTISO -b boot.img -no-emul-boot -R -J -V "$PRODUCT" -T -graft-points boot.img=$TOPDESTPATH/images/boot.img images/install.img=$TOPDESTPATH/images/install.img
- implantisomd5 $TOPDESTPATH/images/$BOOTISO
- fi
-}
diff --git a/rewrite/mk-images.ppc b/rewrite/mk-images.ppc
deleted file mode 100644
index b90865b6..00000000
--- a/rewrite/mk-images.ppc
+++ /dev/null
@@ -1,171 +0,0 @@
-#
-# mk-images.ppc
-#
-# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-makeBootImages() {
- echo "Building boot images for kernel $kernelvers"
- FAKEARCH=""
-
- if [ "$KERNELARCH" = "ppc64" ]; then
- mkdir -p $TOPDESTPATH/ppc/ppc64
- echo "Building $KERNELARCH initrd"
- makeinitrd --initrdto $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz \
- --initrdsize 8192 \
- --loaderbin loader \
- --modules "$INITRDMODS spufs viocd gpio_mdio"
-
- cp $KERNELROOT/boot/vmlinuz-* $TOPDESTPATH/ppc/ppc64/vmlinuz
- sed -e "s/%BITS%/64/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \
- $BOOTDISKDIR/yaboot.conf.in > $TOPDESTPATH/ppc/ppc64/yaboot.conf
-
- cat << __EOT__ >> $TOPDESTPATH/.treeinfo
-[images-$KERNELARCH]
-kernel = ppc/ppc64/vmlinuz
-initrd = ppc/ppc64/ramdisk.image.gz
-__EOT__
-
- if [ -x $IMGPATH/usr/bin/mkzimage -a -r $IMGPATH/usr/share/ppc64-utils/zImage.stub ]; then
- mkdir -p $TOPDESTPATH/images/netboot
- pushd $TOPDESTPATH/ppc/ppc64
- cp $IMGPATH/usr/share/ppc64-utils/zImage.lds $TOPDESTPATH/ppc/ppc64/zImage.lds
- $IMGPATH/usr/bin/mkzimage $TOPDESTPATH/ppc/ppc64/vmlinuz no no $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz $IMGPATH/usr/share/ppc64-utils/zImage.stub $TOPDESTPATH/images/netboot/ppc64.img
- rmdir $TOPDESTPATH/images/netboot || :
- rm -f $TOPDESTPATH/ppc/ppc64/zImage.lds
- popd
- echo "zimage = images/netboot/ppc64.img" >> $TOPDESTPATH/.treeinfo
- elif [ -x $IMGPATH/usr/sbin/wrapper -a -r $IMGPATH/usr/lib/kernel-wrapper/wrapper.a ]; then
- mkdir -p $TOPDESTPATH/images/netboot
- $IMGPATH/usr/sbin/wrapper -o $TOPDESTPATH/images/netboot/ppc64.img \
- -i $TOPDESTPATH/ppc/ppc64/ramdisk.image.gz \
- -D $IMGPATH/usr/lib/kernel-wrapper \
- $TOPDESTPATH/ppc/ppc64/vmlinuz
- rmdir $TOPDESTPATH/images/netboot || :
- echo "zimage = images/netboot/ppc64.img" >> $TOPDESTPATH/.treeinfo
- fi
-
- echo >> $TOPDESTPATH/.treeinfo
-
-
- elif [ "$KERNELARCH" = "ppc" ]; then
- FAKEARCH="ppc"
- mkdir -p $TOPDESTPATH/ppc/ppc32
- mkdir -p $TOPDESTPATH/ppc/mac
-
- echo "Building ppc initrd"
- makeinitrd --initrdto $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz \
- --initrdsize 8192 \
- --loaderbin loader \
- --modules "$INITRDMODS"
-
- cp $KERNELROOT/boot/vmlinuz-* $TOPDESTPATH/ppc/ppc32/vmlinuz
- sed -e "s/%BITS%/32/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \
- $BOOTDISKDIR/yaboot.conf.in > $TOPDESTPATH/ppc/ppc32/yaboot.conf
-
- cat << __EOT__ >> $TOPDESTPATH/.treeinfo
-[images-$KERNELARCH]
-kernel = ppc/ppc32/vmlinuz
-initrd = ppc/ppc32/ramdisk.image.gz
-__EOT__
- if [ -x $IMGPATH/usr/bin/mkzimage -a -r $IMGPATH/usr/share/ppc64-utils/zImage.stub ]; then
- mkdir -p $TOPDESTPATH/images/netboot
- pushd $TOPDESTPATH/ppc/ppc32
- cp $IMGPATH/usr/share/ppc64-utils/zImage.lds $TOPDESTPATH/ppc/ppc32/zImage.lds
- $IMGPATH/usr/bin/mkzimage $TOPDESTPATH/ppc/ppc32/vmlinuz no no $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz $IMGPATH/usr/share/ppc64-utils/zImage.stub $TOPDESTPATH/images/netboot/ppc32.img
- rmdir $TOPDESTPATH/images/netboot || :
- rm -f $TOPDESTPATH/ppc/ppc32/zImage.lds
- popd
- echo "zimage = images/netboot/ppc32.img" >> $TOPDESTPATH/.treeinfo
- elif [ -x $IMGPATH/usr/sbin/wrapper -a -r $IMGPATH/usr/lib/kernel-wrapper/wrapper.a ]; then
- $IMGPATH/usr/sbin/wrapper -o $TOPDESTPATH/images/netboot/ppc32.img \
- -i $TOPDESTPATH/ppc/ppc32/ramdisk.image.gz \
- -D $IMGPATH/usr/lib/kernel-wrapper \
- $TOPDESTPATH/ppc/ppc32/vmlinuz
- rmdir $TOPDESTPATH/images/netboot || :
- popd
- echo "zimage = images/netboot/ppc32.img" >> $TOPDESTPATH/.treeinfo
- fi
- echo >> $TOPDESTPATH/.treeinfo
-
- else
- echo "Unknown kernel arch: $KERNELARCH"
- fi
-}
-
-doPostImages() {
- mkdir -p $TOPDESTPATH/etc
- mkdir -p $TOPDESTPATH/ppc/chrp
-
- # Create ofboot.b and bootinfo.txt files, and yaboot binaries for Mac and CHRP
- cp $BOOTDISKDIR/bootinfo.txt $TOPDESTPATH/ppc/bootinfo.txt
- cp $IMGPATH/usr/lib/anaconda-runtime/boot/efika.forth $TOPDESTPATH/ppc/efika.forth
-
- if [ -d $TOPDESTPATH/ppc/mac ]; then
- cp $BOOTDISKDIR/ofboot.b $TOPDESTPATH/ppc/mac/ofboot.b
- cp $IMGPATH/usr/lib/yaboot/yaboot $TOPDESTPATH/ppc/mac/yaboot
- fi
-
- if [ -d $TOPDESTPATH/ppc/chrp ]; then
- cp $IMGPATH/usr/lib/yaboot/yaboot $TOPDESTPATH/ppc/chrp/yaboot
- $IMGPATH/usr/lib/yaboot/addnote $TOPDESTPATH/ppc/chrp/yaboot
- fi
-
- # IBM firmware can't handle boot scripts properly, so for biarch installs
- # we use a yaboot.conf which asks the user to select 32-bit or 64-bit kernel.
- if [ -r $TOPDESTPATH/ppc/ppc32/yaboot.conf -a -r $TOPDESTPATH/ppc/ppc64/yaboot.conf ]; then
- # Both kernels exist. Copy the biarch yaboot.conf into place.
- sed -e "s/%BITS%/32/" -e "s/%PRODUCT%/$PRODUCT/" -e "s/%VERSION%/$VERSION/" \
- $BOOTDISKDIR/yaboot.conf.3264 > $TOPDESTPATH/etc/yaboot.conf
- else
- # Copy the one that exists, assuming one does exist
- cp $TOPDESTPATH/ppc/ppc??/yaboot.conf $TOPDESTPATH/etc
- fi
-
- if [ -z "$BOOTISO" ]; then
- return
- fi
-
- # Copy it all into the isopath for the boot CD
- mkdir -p $TOPDESTPATH/isopath
- cp -r $TOPDESTPATH/{ppc,etc} $TOPDESTPATH/isopath
-
- # We want the ppc32 prep image in the boot.iso too.
- if [ -d $TOPDESTPATH/images/netboot ]; then
- mkdir -p $TOPDESTPATH/isopath/images
- cp -r $TOPDESTPATH/images/netboot $TOPDESTPATH/isopath/images
- rm -f $TOPDESTPATH/isopath/images/ppc64.img
- fi
-
- if [ -r $TOPDESTPATH/isopath/images/netboot/ppc32.img ]; then
- PREPBOOT="-prep-boot images/netboot/ppc32.img"
- fi
-
- if [ -d $TOPDESTPATH/isopath/ppc/mac ]; then
- MACBOOT="-hfs-volid $VERSION -hfs-bless $TOPDESTPATH/isopath/ppc/mac"
- fi
-
- # Create the boot.iso
- mkisofs -o $TOPDESTPATH/images/$BOOTISO -chrp-boot -U $PREPBOOT \
- -part -hfs -T -r -l -J -A "$PRODUCT $VERSION" -sysid PPC \
- -V "PBOOT" -volset "$VERSION" -volset-size 1 -volset-seqno 1 \
- $MACBOOT \
- -map $BOOTDISKDIR/mapping -magic $BOOTDISKDIR/magic \
- -no-desktop -allow-multidot -graft-points $TOPDESTPATH/isopath \
- images/install.img=$TOPDESTPATH/images/install.img
- implantisomd5 $TOPDESTPATH/images/$BOOTISO
- rm -rf $TOPDESTPATH/isopath
-}
diff --git a/rewrite/mk-images.s390 b/rewrite/mk-images.s390
deleted file mode 100644
index b3e9db1a..00000000
--- a/rewrite/mk-images.s390
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# mk-images.s390
-#
-# Copyright (C) 2007 Red Hat, Inc. All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-
-S390SCSIMODS="zfcp tape390"
-S390DASDMODS=" dasd_diag_mod dasd_eckd_mod dasd_fba_mod dasd_mod"
-S390NETMODS="ctc netiucv smsgiucv lcs qdio qeth ccwgroup crypto_api xfrm_nalgo"
-S390MODS="$S390SCSIMODS $S390DASDMODS $S390NETMODS"
-
-makeBootImages() {
- makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \
- --initrdsize 20000 \
- --loaderbin loader \
- --modules "$INITRDMODS $S390MODS"
- sz=$(ls -l $TOPDESTPATH/images/initrd.img | awk '{print $5}')
- $GENINITRDSZ $sz $TOPDESTPATH/images/initrd.size
- cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img
-
- cp -v $BOOTDISKDIR/redhat.exec $TOPDESTPATH/images/redhat.exec
- cp -v $BOOTDISKDIR/generic.prm $TOPDESTPATH/images/generic.prm
- cp -v $BOOTDISKDIR/generic.ins $TOPDESTPATH/generic.ins
-
- $MKS390CDBOOT \
- -i $TOPDESTPATH/images/kernel.img \
- -r $TOPDESTPATH/images/initrd.img \
- -p $TOPDESTPATH/images/generic.prm \
- -o $TOPDESTPATH/images/cdboot.img
-
- cat << __EOT__ >> $TOPDESTPATH/.treeinfo
-[images-$KERNELARCH]
-kernel = images/kernel.img
-initrd = images/initrd.img
-initrd.size = images/initrd.size
-generic.prm = images/generic.prm
-generic.ins = generic.ins
-cdboot.img = images/cdboot.img
-
-__EOT__
-}
diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index ca6d9e09..46eb7459 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -240,8 +240,10 @@ class Lorax(object):
kernel_path, initrd_path = initrd.create()
# copy the kernel and initrd images to the pxeboot directory
- shutil.copy2(kernel_path, self.conf.pxebootdir)
- shutil.copy2(initrd_path, self.conf.pxebootdir)
+ if kernel_path is not None:
+ shutil.copy2(kernel_path, self.conf.pxebootdir)
+ if kernel_path is not None:
+ shutil.copy2(initrd_path, self.conf.pxebootdir)
# if this is a PAE kernel, skip the EFI part
if kernel_path.endswith("PAE"):
@@ -279,8 +281,12 @@ class Lorax(object):
shutil.copy2(installimg, self.conf.imagesdir)
# create the boot iso
- self.output.info(":: creating the boot iso")
- bootiso = self.create_boot_iso()
+ if self.conf.arch in ("i386", "i586", "i686", "x86_64"):
+ self.output.info(":: creating the boot iso")
+ bootiso = self.create_boot_iso_x86()
+ elif self.conf.arch in ("ppc", "ppc64"):
+ self.output.info(":: creating the boot iso")
+ bootiso = self.create_boot_iso_ppc()
if bootiso is None:
self.output.critical("unable to create boot iso")
@@ -473,9 +479,6 @@ class Lorax(object):
dst = os.path.join(isolinuxdir, "grub.conf")
shutil.copy2(self.paths.GRUBCONF, dst)
- utils.replace(dst, "@PRODUCT@", self.conf.product)
- utils.replace(dst, "@VERSION@", self.conf.version)
-
# copy the splash files
if os.path.isfile(self.paths.VESASPLASH):
shutil.copy2(self.paths.VESASPLASH,
@@ -522,7 +525,7 @@ class Lorax(object):
return True
- def create_boot_iso(self):
+ def create_boot_iso_x86(self):
bootiso = os.path.join(self.conf.tempdir, "boot.iso")
if os.path.exists(bootiso):
@@ -567,6 +570,99 @@ class Lorax(object):
return bootiso
+ def create_boot_iso_ppc(self):
+ bootiso = os.path.join(self.conf.tempdir, "boot.iso")
+
+ if os.path.exists(bootiso):
+ os.unlink(bootiso)
+
+ etcdir = os.path.join(self.conf.outputdir, "etc")
+ ppcdir = os.path.join(self.conf.outputdir, "ppc")
+ macdir = os.path.join(ppcdir, "mac")
+ chrpdir = os.path.join(ppcdir, "chrp")
+
+ utils.makedirs(etcdir)
+ utils.makedirs(chrpdir)
+
+ shutil.copy2(self.paths.BOOTINFO, ppcdir)
+ shutil.copy2(self.paths.EFIKA_FORTH, ppcdir)
+
+ if os.path.isdir(macdir):
+ shutil.copy2(self.paths.OFBOOT, macdir)
+ shutil.copy2(self.paths.YABOOT, macdir)
+
+ if os.path.isdir(chrpdir):
+ shutil.copy2(self.paths.YABOOT, chrpdir)
+ cmd = "%s %s" % (self.paths.ADD_NOTE,
+ os.path.join(chrpdir, "yaboot"))
+
+ # IBM firmware can't handle boot scripts properly,
+ # so for biarch installs we use a yaboot.conf,
+ # which asks the user to select 32-bit or 64-bit kernel
+ yaboot32 = os.path.join(ppcdir, "ppc32", "yaboot.conf")
+ yaboot64 = os.path.join(ppcdir, "ppc64", "yaboot.conf")
+ if os.path.isfile(yaboot32) and os.path.isfile(yaboot64):
+ # both kernels exist, copy the biarch yaboot.conf into place
+ yaboot = os.path.join(etcdir, "yaboot.conf")
+ shutil.copy2(self.paths.BIARCH_YABOOT, yaboot)
+ utils.replace(yaboot, "%BITS%", "32")
+ utils.replace(yaboot, "%PRODUCT%", self.conf.product)
+ utils.replace(yaboot, "%VERSION%", self.conf.version)
+ else:
+ if os.path.isfile(yaboot32):
+ shutil.copy2(yaboot32, etcdir)
+ if os.path.isfile(yaboot64):
+ shutil.copy2(yaboot64, etcdir)
+
+ isopath = os.path.join(self.conf.outputdir, "isopath")
+ utils.mkdir(isopath)
+
+ utils.scopy(ppcdir, isopath)
+ utils.scopy(etcdir, isopath)
+
+ netbootdir = os.path.join(self.conf.outputdir, "images", "netboot")
+ if os.path.isdir(netbootdir):
+ imagesdir = os.path.join(isopath, "images")
+ utils.mkdir(imagesdir)
+
+ utils.scopy(netbootdir, imagesdir)
+ utils.remove(os.path.join(imagesdir, "ppc64.img"))
+
+ ppc32img = os.path.join(netbootdir, "ppc32.img")
+ if os.path.isfile(pcp32img):
+ prepboot = "-prep-boot images/netboot/ppc32.img"
+
+ isomacdir = os.path.join(isopath, "ppc", "mac")
+ if os.path.isdir(isomacdir):
+ macboot = "-hfs-volid %s -hfs-bless %s" % (self.conf.version,
+ isomacdir)
+
+ installimg = os.path.join(self.conf.imagesdir, "install.img")
+ cmd = '%s -o %s -chrp-boot -U %s -part -hfs -T -r -l -J -A "%s %s"' \
+ ' -sysid PPC -V "PBOOT" -volset %s -volset-size 1' \
+ ' -volset-seqno 1 %s -map %s/mapping -magic %s/magic' \
+ ' -no-desktop' \
+ ' -allow-multidot -graft-points %s images/install.img=%s' % \
+ (self.paths.MKISOFS, bootiso, prepboot, self.conf.product,
+ self.conf.version, self.conf.version, macboot,
+ self.paths.ANACONDA_BOOT, self.paths.ANACONDA_BOOT,
+ isopath, installimg)
+
+ err, output = commands.getstatusoutput(cmd)
+ if err:
+ self.output.warning(output)
+ return None
+
+ cmd = "%s %s" % (self.paths.IMPLANTISO, bootiso)
+ err, output = commands.getstatusoutput(cmd)
+ if err:
+ self.output.warning(output)
+ return None
+
+ utils.remove(isopath)
+
+ return bootiso
+
def cleanup(self):
if self.conf.cleanup:
shutil.rmtree(self.conf.tempdir)
diff --git a/src/pylorax/config.py b/src/pylorax/config.py
index c683bad3..c929c775 100644
--- a/src/pylorax/config.py
+++ b/src/pylorax/config.py
@@ -207,3 +207,57 @@ class LoraxPaths(singleton.Singleton):
def FEDORAKMODCONF(self):
return os.path.join(self.installtree, "etc", "yum", "pluginconf.d",
"fedorakmod.conf")
+
+ @property
+ def MKZIMAGE(self):
+ return os.path.join(self.installtree, "usr", "bin", "mkzimage")
+
+ @property
+ def ZIMAGE_STUB(self):
+ return os.path.join(self.installtree, "usr", "share", "ppc64-utils",
+ "zImage.stub")
+
+ @property
+ def ZIMAGE_LDS(self):
+ return os.path.join(self.installtree, "usr", "share", "ppc64-utils",
+ "zImage.lds")
+
+ @property
+ def WRAPPER(self):
+ return os.path.join(self.installtree, "usr", "sbin", "wrapper")
+
+ @property
+ def WRAPPER_A_DIR(self):
+ return os.path.join(self.installtree, "usr", "lib", "kernel-wrapper")
+
+ @property
+ def WRAPPER_A(self):
+ return os.path.join(self.WRAPPER_A_DIR, "wrapper.a")
+
+ @property
+ def BOOTINFO(self):
+ return os.path.join(self.ANACONDA_BOOT, "bootinfo.txt")
+
+ @property
+ def EFIKA_FORTH(self):
+ return os.path.join(self.ANACONDA_BOOT, "efika.forth")
+
+ @property
+ def OFBOOT(self):
+ return os.path.join(self.ANACONDA_BOOT, "ofboot.b")
+
+ @property
+ def YABOOT(self):
+ return os.path.join(self.installtree, "usr", "lib", "yaboot", "yaboot")
+
+ @property
+ def ADD_NOTE(self):
+ return os.path.join(self.installtree, "usr", "lib", "yaboot", "addnote")
+
+ @property
+ def BIARCH_YABOOT(self):
+ return os.path.join(self.ANACONDA_BOOT, "yaboot.conf.3264")
+
+ @property
+ def IMPLANTISO(self):
+ return "/usr/bin/implantisomd5"
diff --git a/src/pylorax/efi.py b/src/pylorax/efi.py
index a635f702..3e94ed8b 100644
--- a/src/pylorax/efi.py
+++ b/src/pylorax/efi.py
@@ -139,10 +139,11 @@ class EFI(object):
self.output.warning(output)
pass
- # copy the conf files to the output directory
+ # copy the conf files and splash.xpm.gz to the output directory
if not kernel and not initrd:
utils.scopy(src_root=efitreedir, src_path="*.conf",
dst_root=self.conf.efibootdir, dst_path="")
+ shutil.copy2(self.paths.SPLASHXPM, self.conf.efibootdir)
return efiboot
diff --git a/src/pylorax/install.py b/src/pylorax/install.py
index f1ae5a39..d429d765 100644
--- a/src/pylorax/install.py
+++ b/src/pylorax/install.py
@@ -161,109 +161,110 @@ class InstallImage(object):
# XXX this saves 2 MB
def remove_gtk_stuff(self):
- # figure out the gtk+ theme to keep
- gtkrc = os.path.join(self.conf.installtree, "etc", "gtk-2.0", "gtkrc")
-
- gtk_theme_name = None
- gtk_engine = None
- gtk_icon_themes = []
-
- if os.path.isfile(gtkrc):
- f = open(gtkrc, "r")
- lines = f.readlines()
- f.close()
-
- for line in lines:
- line = line.strip()
- if line.startswith("gtk-theme-name"):
- gtk_theme_name = line[line.find("=") + 1:]
- gtk_theme_name = gtk_theme_name.replace('"', "").strip()
-
- # find the engine for this theme
- gtkrc = os.path.join(self.conf.installtree, "usr", "share",
- "themes", gtk_theme_name, "gtk-2.0", "gtkrc")
- if os.path.isfile(gtkrc):
- f = open(gtkrc, "r")
- engine_lines = f.readlines()
- f.close()
-
- for engine_l in engine_lines:
- engine_l = engine_l.strip()
- if engine_l.find("engine") != -1:
- gtk_engine = engine_l[engine_l.find('"') + 1:]
- gtk_engine = gtk_engine.replace('"', "").strip()
- break
-
- elif line.startswith("gtk-icon-theme-name"):
- icon_theme = line[line.find("=") + 1:]
- icon_theme = icon_theme.replace('"', "").strip()
- gtk_icon_themes.append(icon_theme)
-
- # bring in all inherited themes
- while True:
- icon_theme_index = os.path.join(self.conf.installtree,
- "usr", "share", "icons", icon_theme,
- "index.theme")
-
- if os.path.isfile(icon_theme_index):
- inherits = False
- f = open(icon_theme_index, "r")
- icon_lines = f.readlines()
- f.close()
-
- for icon_l in icon_lines:
- icon_l = icon_l.strip()
- if icon_l.startswith("Inherits="):
- inherits = True
- icon_theme = icon_l[icon_l.find("=") + 1:]
- icon_theme = \
- icon_theme.replace('"', "").strip()
-
- gtk_icon_themes.append(icon_theme)
- break
-
- if not inherits:
- break
- else:
- break
-
- # remove themes we don't need
- theme_path = os.path.join(self.conf.installtree, "usr", "share",
- "themes")
-
- if os.path.isdir(theme_path):
- for theme in filter(lambda theme: theme != gtk_theme_name,
- os.listdir(theme_path)):
-
- theme = os.path.join(theme_path, theme)
- shutil.rmtree(theme, ignore_errors=True)
-
- # remove icons we don't need
- icon_path = os.path.join(self.conf.installtree, "usr", "share",
- "icons")
-
- if os.path.isdir(icon_path):
- for icon in filter(lambda icon: icon not in gtk_icon_themes,
- os.listdir(icon_path)):
-
- icon = os.path.join(icon_path, icon)
- shutil.rmtree(icon, ignore_errors=True)
-
- # remove engines we don't need
- tmp_path = os.path.join(self.conf.installtree, "usr",
- self.conf.libdir, "gtk-2.0")
-
- if os.path.isdir(tmp_path):
- fnames = map(lambda fname: os.path.join(tmp_path, fname,
- "engines"), os.listdir(tmp_path))
-
- dnames = filter(lambda fname: os.path.isdir(fname), fnames)
- for dir in dnames:
- engines = filter(lambda e: e.find(gtk_engine) == -1,
- os.listdir(dir))
- for engine in engines:
- engine = os.path.join(dir, engine)
- os.unlink(engine)
+ pass
+# # figure out the gtk+ theme to keep
+# gtkrc = os.path.join(self.conf.installtree, "etc", "gtk-2.0", "gtkrc")
+#
+# gtk_theme_name = None
+# gtk_engine = None
+# gtk_icon_themes = []
+#
+# if os.path.isfile(gtkrc):
+# f = open(gtkrc, "r")
+# lines = f.readlines()
+# f.close()
+#
+# for line in lines:
+# line = line.strip()
+# if line.startswith("gtk-theme-name"):
+# gtk_theme_name = line[line.find("=") + 1:]
+# gtk_theme_name = gtk_theme_name.replace('"', "").strip()
+#
+# # find the engine for this theme
+# gtkrc = os.path.join(self.conf.installtree, "usr", "share",
+# "themes", gtk_theme_name, "gtk-2.0", "gtkrc")
+# if os.path.isfile(gtkrc):
+# f = open(gtkrc, "r")
+# engine_lines = f.readlines()
+# f.close()
+#
+# for engine_l in engine_lines:
+# engine_l = engine_l.strip()
+# if engine_l.find("engine") != -1:
+# gtk_engine = engine_l[engine_l.find('"') + 1:]
+# gtk_engine = gtk_engine.replace('"', "").strip()
+# break
+#
+# elif line.startswith("gtk-icon-theme-name"):
+# icon_theme = line[line.find("=") + 1:]
+# icon_theme = icon_theme.replace('"', "").strip()
+# gtk_icon_themes.append(icon_theme)
+#
+# # bring in all inherited themes
+# while True:
+# icon_theme_index = os.path.join(self.conf.installtree,
+# "usr", "share", "icons", icon_theme,
+# "index.theme")
+#
+# if os.path.isfile(icon_theme_index):
+# inherits = False
+# f = open(icon_theme_index, "r")
+# icon_lines = f.readlines()
+# f.close()
+#
+# for icon_l in icon_lines:
+# icon_l = icon_l.strip()
+# if icon_l.startswith("Inherits="):
+# inherits = True
+# icon_theme = icon_l[icon_l.find("=") + 1:]
+# icon_theme = \
+# icon_theme.replace('"', "").strip()
+#
+# gtk_icon_themes.append(icon_theme)
+# break
+#
+# if not inherits:
+# break
+# else:
+# break
+#
+# # remove themes we don't need
+# theme_path = os.path.join(self.conf.installtree, "usr", "share",
+# "themes")
+#
+# if os.path.isdir(theme_path):
+# for theme in filter(lambda theme: theme != gtk_theme_name,
+# os.listdir(theme_path)):
+#
+# theme = os.path.join(theme_path, theme)
+# shutil.rmtree(theme, ignore_errors=True)
+#
+# # remove icons we don't need
+# icon_path = os.path.join(self.conf.installtree, "usr", "share",
+# "icons")
+#
+# if os.path.isdir(icon_path):
+# for icon in filter(lambda icon: icon not in gtk_icon_themes,
+# os.listdir(icon_path)):
+#
+# icon = os.path.join(icon_path, icon)
+# shutil.rmtree(icon, ignore_errors=True)
+#
+# # remove engines we don't need
+# tmp_path = os.path.join(self.conf.installtree, "usr",
+# self.conf.libdir, "gtk-2.0")
+#
+# if os.path.isdir(tmp_path):
+# fnames = map(lambda fname: os.path.join(tmp_path, fname,
+# "engines"), os.listdir(tmp_path))
+#
+# dnames = filter(lambda fname: os.path.isdir(fname), fnames)
+# for dir in dnames:
+# engines = filter(lambda e: e.find(gtk_engine) == -1,
+# os.listdir(dir))
+# for engine in engines:
+# engine = os.path.join(dir, engine)
+# os.unlink(engine)
# XXX this saves 5 MB
def remove_locales(self):
diff --git a/src/pylorax/ramdisk.py b/src/pylorax/ramdisk.py
index 9eefc8c5..c17b0af3 100644
--- a/src/pylorax/ramdisk.py
+++ b/src/pylorax/ramdisk.py
@@ -394,7 +394,7 @@ initrd = images/pxeboot/initrd-PAE.img
def create_x86_64(self):
return self.create_i386()
- def run_s390(self):
+ def create_s390(self):
initrd_filename = os.path.join(self.conf.tempdir, "initrd.img")
self.compress(initrd_filename)
@@ -414,7 +414,7 @@ initrd = images/pxeboot/initrd-PAE.img
shutil.copy2(filename, self.conf.outputdir)
cmd = "%s -i %s -r %s -p %s -o %s" % (
- MKS390CD, kernel_filename, initrd_filename,
+ self.paths.MKS390CD, kernel_filename, initrd_filename,
self.paths.GENERIC_PRM,
os.path.join(self.conf.imagesdir, "cdboot.img"))
@@ -436,18 +436,85 @@ cdboot.img = images/cdboot.img
return kernel_filename, initrd_filename
- def run_s390x(self):
- return self.run_s390()
+ def create_s390x(self):
+ return self.create_s390()
# XXX this should be removed
- def run_alpha(self):
+ def create_alpha(self):
raise NotImplementedError
- def run_ia64(self):
+ def create_ia64(self):
raise NotImplementedError
- def run_ppc(self):
- raise NotImplementedError
+ def create_ppc(self):
+ if self.conf.arch == "ppc":
+ bits = "32"
+ elif self.conf.arch == "ppc64":
+ bits = "64"
- def run_ppc64(self):
- raise NotImplementedError
+ ppc_dir = os.path.join(self.conf.outputdir, "ppc", "ppc%s" % bits)
+ utils.makedirs(ppc_dir)
+
+ if self.conf.arch == "ppc":
+ mac_dir = os.path.join(self.conf.outputdir, "ppc", "mac")
+ utils.makedirs(mac_dir)
+
+ initrd_filename = os.path.join(ppc_dir, "ramdisk.image.gz")
+ self.compress(initrd_filename)
+
+ kernel_filename = os.path.join(ppc_dir, "vmlinuz")
+ shutil.copy2(self.conf.kernelfile, kernel_filename)
+
+ yaboot_src = os.path.join(self.paths.ANACONDA_BOOT, "yaboot.conf.in")
+ yaboot_dst = os.path.join(ppc_dir, "yaboot.conf")
+ shutil.copy2(yaboot_src, yaboot_dst)
+
+ utils.replace(yaboot_dst, "%BITS%", bits)
+ utils.replace(yaboot_dst, "%PRODUCT%", self.conf.product)
+ utils.replace(yaboot_dst, "%VERSION%", self.conf.version)
+
+ text = """[images-%s]
+kernel = ppc/ppc%s/vmlinuz
+initrd = ppc/ppc%s/ramdisk.image.gz
+
+""" % (self.conf.arch, bits, bits)
+
+ utils.edit(self.conf.treeinfo, append=True, text=text)
+
+ netboot_dir = os.path.join(self.conf.imagesdir, "netboot")
+ utils.makedirs(netboot_dir)
+
+ ppc_img = os.path.join(netboot_dir, "ppc%s.img" % bits)
+
+ if os.path.exists(self.paths.MKZIMAGE) and \
+ os.path.exists(self.paths.ZIMAGE_STUB):
+ shutil.copy2(self.paths.ZIMAGE_LDS, ppc_dir)
+
+ cmd = "%s %s no no %s %s %s" % \
+ (self.paths.MKZIMAGE, kernel_filename, initrd_filename,
+ self.paths.ZIMAGE_STUB, ppc_img)
+ err, output = commands.getstatusoutput(cmd)
+ if err:
+ self.output.warning(output)
+
+ utils.remove(os.path.join(ppc_dir, "zImage.lds"))
+
+ elif os.path.exists(self.paths.WRAPPER) and \
+ os.path.exists(self.paths.WRAPPER_A):
+ cmd = "%s -o %s -i %s -D %s %s" % \
+ (self.paths.WRAPPER, ppc_img, initrd_filename,
+ self.paths.WRAPPER_A_DIR, kernel_filename)
+ err, output = commands.getstatusoutput(cmd)
+ if err:
+ self.output.warning(output)
+
+ if os.path.exists(ppc_img):
+ text = "zimage = images/netboot/ppc%s.img" % bits
+ utils.edit(self.conf.treeinfo, append=True, text=text)
+ else:
+ utils.remove(netboot_dir)
+
+ return None, None
+
+ def create_ppc64(self):
+ return create_ppc()