Added code for creating s390 images

This commit is contained in:
Martin Gracik 2009-09-30 13:02:40 +02:00
parent d58f206122
commit 56de80c38a
8 changed files with 1630 additions and 0 deletions

15
etc/modules/modules.s390 Normal file
View File

@ -0,0 +1,15 @@
zfcp
tape390
dasd_diag_mod
dasd_eckd_mod
dasd_fba_mod
dasd_mod
ctc
netiucv
smsgiucv
lcs
qdio
qeth
ccwgroup
crypto_api
xfrm_nalgo

1
etc/modules/modules.s390x Symbolic link
View File

@ -0,0 +1 @@
modules.s390

1019
rewrite/mk-images Executable file

File diff suppressed because it is too large Load Diff

131
rewrite/mk-images.alpha Normal file
View File

@ -0,0 +1,131 @@
#
# 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 <http://www.gnu.org/licenses/>.
#
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 <<EOF
#
# Fedora Linux aboot configuration options:
#
# 0 - Boot the Fedora Linux installer using a 2.6 kernel
# 1 - Boot the Fedora Linux installer in non graphical mode
# 2 - Boot the Fedora Linux installer in text only mode on ttyS0
# for installation control via the serial port
# 3 - Boot in rescue mode
#
0:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0 root=/dev/fd0
1:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0 text root=/dev/fd0
2:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=ttyS0 text root=/dev/fd0
3:vmlinux.gz load_ramdisk=1 prompt_ramdisk=1 console=tty0 rescue root=/dev/fd0
EOF
cat > $MBD_BOOTTREE/etc/milo.conf <<EOF
image=/vmlinux.gz
label=linux
root=/dev/fd0
append="load_ramdisk=1 prompt_ramdisk=1"
EOF
zcat $KERNELROOT/boot/vmlinuz-* | gzip -9 > $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 <<EOF
#
# Fedora Linux aboot configuration options:
#
# 0 - Boot the Fedora Linux installer using a 2.6 kernel
# 1 - Boot the Fedora Linux installer with kernel messages sent to ttyS0
# 2 - Boot the Fedora Linux installer in text only mode
# 3 - Boot the Fedora Linux installer in text only rescue mode
#
0:/kernels/vmlinux.gz initrd=/images/initrd.img
1:/kernels/vmlinux.gz initrd=/images/initrd.img console=ttyS0
2:/kernels/vmlinux.gz initrd=/images/initrd.img text
3:/kernels/vmlinux.gz initrd=/images/initrd.img rescue
EOF
mkdir -p $TOPDESTPATH/kernels
cp $KERNELROOT/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinux.gz
makeinitrd --initrdto $TOPDESTPATH/images/ramdisk.img \
--initrdsize 8192 \
--loaderbin loader \
--modules "$NETMODULES $SCSIMODULES"
echo "List of init modules: $INITRDMODS"
makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \
--initrdsize 8192 \
--loaderbin loader \
--modules "$INITRDMODS"
# makebootdisk --bootdisksize 4096 --kernelto $TOPDESTPATH/kernels/vmlinux.gz \
# --imagename generic.img
if [ -f $KERNELPATH/kernel-jensen-*.rpm ]; then
KJ_PKG=$KERNELPATH/kernel-jensen-*.rpm
KJ_DIR=/tmp/kernelj.dir.$$
mkdir -p $KJ_DIR
rpm2cpio $KJ_PKG | (cd $KJ_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
cp $KJ_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.j
rm -rf $KJ_DIR
fi
# makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "$SCSIMODULES $EXTRASCSI +scsi"
# makedriverdisk --padsize 1440 "Supplemental Network Device Drivers" "drvnet" "$NETMODULES $EXTRANET +net"
}
#makeSecondStage() {
# makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODS =scsi"
# makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODS =net"
# makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODS =scsi =net"
# makemainimage "install" "cramfs"
#}

172
rewrite/mk-images.ia64 Normal file
View File

@ -0,0 +1,172 @@
#
# mk-images.ia64
#
# 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 <http://www.gnu.org/licenses/>.
#
#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 <<EOF
The files in this directory are useful for booting a machine via PXE.
The following files are available:
vmlinuz - the kernel used for the installer
initrd.img - an initrd with support for all install methods and
drivers supported for installation of $PRODUCT
EOF
cat << __EOT__ >> $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
}

171
rewrite/mk-images.ppc Normal file
View File

@ -0,0 +1,171 @@
#
# 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 <http://www.gnu.org/licenses/>.
#
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
}

54
rewrite/mk-images.s390 Normal file
View File

@ -0,0 +1,54 @@
#
# 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 <http://www.gnu.org/licenses/>.
#
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__
}

View File

@ -492,6 +492,11 @@ class InitRD(object):
self.so.info("Creating locales") self.so.info("Creating locales")
self.create_locales() self.create_locales()
f = getattr(self, "run_%s" % (self.conf.buildarch,), None)
if f:
f()
def run_i386(self):
initrd_filename = "initrd.img" initrd_filename = "initrd.img"
kernel_filename = "vmlinuz" kernel_filename = "vmlinuz"
@ -526,6 +531,68 @@ class InitRD(object):
kernelpath="/images/pxeboot/vmlinuz", kernelpath="/images/pxeboot/vmlinuz",
initrdpath="/images/pxeboot/initrd.img") initrdpath="/images/pxeboot/initrd.img")
def run_x86_64(self):
self.run_i386()
def run_s390(self):
initrd_filename = "initrd.img"
kernel_filename = "kernel.img"
self.so.info("Compressing the image file '%s'" % (initrd_filename,))
self.create(os.path.join(self.conf.imagesdir, initrd_filename))
cmd = "ls -l %s | awk '{print $5}'" % \
(os.path.join(self.conf.imagesdir, initrd_filename),)
self.so.debug(cmd)
err, size = commands.getstatusoutput(cmd)
if err:
self.se.debug(size)
geninitrdsz = os.path.join(self.conf.treedir, "usr", "lib",
"anaconda-runtime", "geninitrdsz")
cmd = "%s %s %s" % (geninitrdsz, size,
os.path.join(self.conf.imagesdir, "initrd.size"))
self.so.debug(cmd)
err, output = commands.getstatusoutput(cmd)
if err:
self.se.debug(output)
# copy the kernel file
shutil.copy2(self.conf.kernelfile,
os.path.join(self.conf.imagesdir, kernel_filename))
for filename in ("redhat.exec", "generic.prm"):
shutil.copy2(os.path.join(self.conf.bootdiskdir, filename),
self.conf.imagesdir)
shutil.copy2(os.path.join(self.conf.bootdiskdir, filename),
self.conf.outdir)
mks390cdboot = os.path.join(self.conf.treedir, "usr", "lib",
"anaconda-runtime", "mk-s390-cdboot")
cmd = "%s -i %s -r %s -p %s -o %s" % (mks390cdboot,
os.path.join(self.conf.imagesdir, kernel_filename),
os.path.join(self.conf.imagesdir, initrd_filename),
os.path.join(self.conf.imagesdir, "generic.prm"),
os.path.join(self.conf.imagesdir, "cdboot.img"))
err, output = commands.getstatusoutput(cmd)
if err:
self.se.debug(output)
text = "[images-%s" % (self.conf.buildarch,)
text += "kernel = images/kernel.img"
text += "initrd = images/initrd.img"
text += "initrd.size = images/initrd.size"
text += "generic.prm = images/generic.prm"
text += "generic.ins = generic.ins"
text += "cdboot.img = images/cdboot.img"
edit(os.path.join(self.conf.outdir, ".treeinfo"),
append=True, text=text)
def run_s390x(self):
self.run_s390()
class EFI(object): class EFI(object):