[PATCH 04/10] add mk-images.sparc script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 scripts/mk-images.sparc |  109 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 109 insertions(+), 0 deletions(-)
 create mode 100644 scripts/mk-images.sparc

diff --git a/scripts/mk-images.sparc b/scripts/mk-images.sparc
new file mode 100644
index 0000000..4496828
--- /dev/null
+++ b/scripts/mk-images.sparc
@@ -0,0 +1,109 @@
+#
+# mk-images.sparc
+#
+# Copyright (C) 2008 Tom "spot" Callaway <tcallawa@xxxxxxxxxx>
+#
+# 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/>.
+#
+
+SPARCMODS="openpromfs sermouse qlogicpti pluto fcal soc socal esp fc4 aic7xxx sym53c8xx qlogicisp mptbase mptscsih mptfc mptsas qla2xxx qla2100 qla2200 qla2300"
+TILO=$IMGPATH/usr/bin/tilo
+SILO=$IMGPATH/usr/sbin/silo
+
+maketftp() {
+    while [ x$(echo $1 | cut -c1-2) = x"--" ]; do
+       if [ $1 = "--kernel" ]; then
+           TFTPKERNEL=$2
+           shift; shift
+           continue
+       elif [ $1 = "--initrdfrom" ]; then
+           TFTPINITRD=$2
+           shift; shift
+           continue
+       elif [ $1 = "--imagename" ]; then
+           TFTPIMAGE=$2
+           shift; shift
+           continue
+       elif [ $1 = "--systemmap" ]; then
+           TFTPSYSMAP=$2
+           shift; shift
+           continue
+       fi
+       echo "bad argument $1 passed to maketftp"
+       exit 1
+    done
+
+    echo "Making a $KERNELARCH tftp image: $TFTPIMAGE"
+
+    elftoaout $TFTPKERNEL -o $TFTPIMAGE
+    if [ "$KERNELARCH" = "sparc" ]; then
+       piggyback $TFTPIMAGE $TFTPSYSMAP $TFTPINITRD
+    elif [ "$KERNELARCH" = "sparc64" ]; then
+       piggyback64 $TFTPIMAGE $TFTPSYSMAP $TFTPINITRD
+    fi
+}
+
+prepareBootTree() {
+	echo "sparc: prepareBootTree() is called"
+	(cd $BOOTDISKDIR; find . -maxdepth 1 ! -type d | cpio --quiet -p $MBD_BOOTTREE)
+
+	cp $MBD_FSIMAGE $MBD_BOOTTREE/initrd.img
+	cp $KERNELROOT/boot/vmlinuz-* $MBD_BOOTTREE/vmlinuz
+	cp $KERNELROOT/boot/System.map-* $MBD_BOOTTREE/System.map
+
+}
+
+makeBootImages() {
+    echo "Building boot images for kernel $kernelvers.$KERNELARCH"
+
+    echo "Building initrd.img"
+    makeinitrd --initrdto $TOPDESTPATH/images/initrd.img \
+	--initrdsize 8192 \
+	--loaderbin loader \
+	--modules "$INITRDMODS $SPARCMODS"
+    [ $? = 0 ] || exit 1
+    if [ -f $IMGPATH/usr/lib/anaconda-runtime/boot/second.b ]; then
+	echo "Building boot dir for silo"
+	MBD_BOOTTREE=$TOPDESTPATH/boot
+	MBD_FSIMAGE=$TOPDESTPATH/images/initrd.img
+	mkdir $MBD_BOOTTREE
+	cp $IMGPATH/usr/lib/anaconda-runtime/boot/*.b $MBD_BOOTTREE/
+	
+	prepareBootTree
+
+	maketftp --kernel $MBD_BOOTTREE/vmlinuz \
+		 --imagename $TOPDESTPATH/images/tftp.img \
+		 --systemmap $MBD_BOOTTREE/System.map
+    else
+	echo "I can't find SILO in $IMGPATH/usr/lib/anaconda-runtime/boot ?!?"
+	exit 1
+    fi
+
+}
+
+doPostImages() {
+	if [ -n "$BOOTISO" ]; then
+		echo "Making $BOOTISO"
+		mkisofs -R -J -T \
+			-G /boot/isofs.b \
+			-B ... \
+			-s /boot/silo.conf \
+			-r -V "PBOOT" -A "$PRODUCT $VERSION" \
+			-x Fedora \
+			-x repodata \
+			-sparc-label "$PRODUCT $VERSION Boot Disc" \
+			-o $TOPDESTPATH/images/$BOOTISO -graft-points \
+			boot=$TOPDESTPATH/boot images/stage2.img=$TOPDESTPATH/images/stage2.img
+	fi
+}
-- 
1.6.2.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux