From 521a687a1f0708379d6b7d9761c24a52af54afa8 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Thu, 13 Oct 2005 19:01:21 +0000 Subject: [PATCH] Application of Kumbas patches for MIPS support git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@863 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 7 +- targets/support/bootloader-setup.sh | 60 ++++++++++++- targets/support/create-iso.sh | 43 ++++++++- targets/support/mips-arcload_conf.sh | 130 +++++++++++++++++++++++++++ 4 files changed, 235 insertions(+), 5 deletions(-) create mode 100644 targets/support/mips-arcload_conf.sh diff --git a/ChangeLog b/ChangeLog index 2329df5d..917e79ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.355 2005/10/13 17:15:57 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.356 2005/10/13 19:01:21 rocket Exp $ + + 13 Oct 2005; Eric Edgar + targets/support/bootloader-setup.sh, targets/support/create-iso.sh, + +targets/support/mips-arcload_conf.sh: + Application of Kumbas patches for MIPS support 13 Oct 2005; Eric Edgar targets/support/create-iso.sh: Check for the correct arch specific cd building tool diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh index 2f3eab8e..38fcf3c7 100755 --- a/targets/support/bootloader-setup.sh +++ b/targets/support/bootloader-setup.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.12 2005/08/30 15:20:21 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/bootloader-setup.sh,v 1.13 2005/10/13 19:01:21 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh @@ -233,5 +233,63 @@ case ${clst_mainarch} in fi fi ;; + mips) + # Mips is an interesting arch -- where most archs will + # use ${1} as the root of the LiveCD, an SGI LiveCD lacks + # such a root. Instead, we will use ${1} as a scratch + # directory to build the components we need for the + # CD image, and then pass these components to the + # `sgibootcd` tool which outputs a final CD image + scratch="${1}" + mkdir ${scratch}/kernels + mkdir ${scratch}/kernels/misc + mkdir ${scratch}/arcload + echo "" > ${scratch}/arc.cf + + # Move kernel binaries to ${scratch}/kernels, and + # move everything else to ${scratch}/kernels/misc + for x in ${clst_boot_kernel}; do + mv ${1}/boot/${x} ${scratch}/kernels + mv ${1}/boot/${x}.igz ${scratch}/kernels/misc + done + rmdir ${1}/boot + + # Source the bashified arcload config + source ${clst_sharedir}/targets/support/mips-arcload_conf.sh + + # Generate top portions of the config + echo -e "${topofconfig}${s9600}${s38400}${dbg}${cmt1}" >> ${scratch}/arc.cf + + # Next, figure out what kernels were specified in the + # spec file, and generate the appropriate arcload conf + # blocks specific to each system + ip22="$(echo ${clst_boot_kernel} | tr " " "\n" | grep "ip22" | tr "\n" " ")" + ip27="$(echo ${clst_boot_kernel} | tr " " "\n" | grep "ip27" | tr "\n" " ")" + ip28="$(echo ${clst_boot_kernel} | tr " " "\n" | grep "ip28" | tr "\n" " ")" + ip30="$(echo ${clst_boot_kernel} | tr " " "\n" | grep "ip30" | tr "\n" " ")" + ip32="$(echo ${clst_boot_kernel} | tr " " "\n" | grep "ip32" | tr "\n" " ")" + + if [ -n "${ip22}" ]; then + echo -e "${ip22base}" >> ${scratch}/arc.cf + for x in ${ip22}; do echo -e "${!x}" >> ${scratch}/arc.cf; done + echo -e "${ip22vid}${ip22x}" >> ${scratch}/arc.cf + fi + + [ -n "${ip27}" ] && echo -e "${ip27base}" >> ${scratch}/arc.cf + [ -n "${ip28}" ] && echo -e "${ip28base}" >> ${scratch}/arc.cf + [ -n "${ip30}" ] && echo -e "${ip30base}" >> ${scratch}/arc.cf + + if [ -n "${ip32}" ]; then + echo -e "${ip32base}" >> ${scratch}/arc.cf + for x in ${ip32}; do echo -e "${!x}" >> ${scratch}/arc.cf; done + echo -e "${ip32vid}${ip32x}" >> ${scratch}/arc.cf + fi + + # Finish off the config + echo -e "${cmt2}" >> ${scratch}/arc.cf + + # Move the bootloader binaries & config to their destination + mv ${1}/sashARCS ${1}/sash64 ${1}/arc.cf ${scratch}/arcload + ;; esac exit $? diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh index 01a62fb7..f69e1073 100755 --- a/targets/support/create-iso.sh +++ b/targets/support/create-iso.sh @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.11 2005/10/13 17:15:57 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/targets/support/create-iso.sh,v 1.12 2005/10/13 19:01:21 rocket Exp $ . ${clst_sharedir}/targets/support/functions.sh . ${clst_sharedir}/targets/support/filesystem-functions.sh @@ -17,8 +17,6 @@ esac && die "!!! /usr/bin/${cdmaker} is not found. Have you merged ${cdmakerpkg}?" \ && echo && echo - - # If not volume ID is set, make up a sensible default if [ -z "${clst_iso_volume_id}" ] then @@ -197,5 +195,44 @@ case ${clst_mainarch} in esac fi ;; + + mips) + case ${clst_fstype} in + normal) + # Gather up all our bits, and generate a tmp config file + # for sgibootcd + mkdir ${clst_target_path}/loopback ${clst_target_path}/sgibootcd + mv ${clst_target_path}/image.loop ${clst_target_path}/loopback + rm -f ${clst_target_path}/livecd + img="${clst_target_path}/loopback/image.loop" + knl="${clst_target_path}/kernels" + arc="${clst_target_path}/arcload" + cfg="${clst_target_path}/sgibootcd/sgibootcd.cfg" + touch ${cfg} + + # Add the kernels first + for x in ${clst_boot_kernel}; do + echo -e "f=${knl}/${x}@${x}" >> ${cfg} + done + + # Next, the bootloaders + echo -e "f=${arc}/sash64@sash64" >> ${cfg} + echo -e "f=${arc}/sashARCS@sashARCS" >> ${cfg} + echo -e "f=${arc}/arc.cf@arc.cf" >> ${cfg} + + # Next, the Loopback Image + echo -e "p0=${img}" >> ${cfg} + + # Finally, the required SGI Partitions + echo -e "p8=#dvh" >> ${cfg} + echo -e "p10=#volume" >> ${cfg} + + # All done; feed the config to sgibootcd and end up with an image + /usr/bin/sgibootcd c=${cfg} o=${clst_iso} + ;; + + *) die "SGI LiveCDs only support the 'normal' fstype!" ;; + esac + ;; esac exit $? diff --git a/targets/support/mips-arcload_conf.sh b/targets/support/mips-arcload_conf.sh new file mode 100644 index 00000000..07820f65 --- /dev/null +++ b/targets/support/mips-arcload_conf.sh @@ -0,0 +1,130 @@ +#!/bin/bash + + +#// Variables holding the data of the arcload config file, arc.cf +#//----------------------------------------------------------------------------- + +topofconfig="# Gentoo/MIPS LiveCD Prototype\n# ARCLoad Configuration\n\ndetect;\n\n\ +# Global options\ncomment\t\t\"Global Options (not bootable):\\\n\\\r\\\n\\\r\";\n\n" + +s9600="serial=9600 {\n\ +\tdescription\t\"Serial Console - 9600 baud\";\n\ +\timage\t\t\"\";\n\ +\tappend\t\t\"console=ttyS0,9600\";\n}\n\n" + +s38400="serial=38400 {\n\ +\tdescription\t\"Serial Console - 38400 baud\";\n\ +\timage\t\t\"\";\n\ +\tappend\t\t\"console=ttyS0,38400\";\n}\n\n" + +dbg="debug {\n\ +\tdescription\t\"Debug Shell\";\n\ +\timage\t\t\"\";\n\ +\tappend\t\t\"real_root=shell\";\n}\n\n" + +cmt1="comment\t\t\"\\\n\\\n\";\n\ +comment\t\t\"Bootable Images & Options:\\\n\\\r\\\n\\\r\";\n" + +ip22base="# IP22 R4x00 Systems (Indy/Indigo2)\n\ +ip22 {\n\ +\tdescription\t\"SGI Indy/Indigo2\";\n\ +\tappend\t\t\"real_root=/dev/sr0\" \"cdroot=/dev/loop0\" \"looptype=sgimips\" \"nox\" \"nosound\";\n" + +ip22r4k="\tr4000 r4600 r4700 {\n\ +\t\tdescription\t\"\\\tR4x00 CPU\";\n\ +\t\timage system\t\"/ip22r4k\";\n\ +\t}\n" + +ip22r5k="\tr5000 {\n\ +\t\tdescription\t\"\\\tR5000 CPU\";\n\ +\t\timage system\t\"/ip22r5k\";\n\ +\t}\n" + +ip22vid="\tvideo {\n\ +\t\tdescription\t\"\\\tNewport Console\\\n\\\r\";\n\ +\t\tappend\t\t\"console=tty0\";\n\ +\t}\n" + +ip22x="}\n\n\n" + +ip27base="# IP27 Origin 200/2000\n\ +ip27 {\n\ +\tdescription\t\"SGI Origin 200/2000\\\n\\\r\";\n\ +\timage system\t\"/ip27r10k\";\n\ +\tappend\t\t\"real_root=/dev/sr0\" \"cdroot=/dev/loop0\" \"looptype=sgimips\" \"nox\" \"nosound\";\n\ +}\n\n\n" + +ip28base="# IP28 Indigo2 Impact R10000\n\ +ip28 {\n\ +\tdescription\t\"SGI Indigo2 Impact R10000\\\n\\\r\";\n\ +\timage system\t\"/ip28r10k\";\n\ +\tappend\t\t\"real_root=/dev/sr0\" \"cdroot=/dev/loop0\" \"looptype=sgimips\" \"nox\" \"nosound\";\n\ +}\n\n\n" + +ip30base="# IP30 Octane\n\ +ip30 {\n\ +\tdescription\t\"SGI Octane\";\n\ +\timage system\t\"/ip30r10k\";\n\ +\tappend\t\t\"real_root=/dev/sr0\" \"cdroot=/dev/loop0\" \"looptype=sgimips\" \"nox\" \"nosound\";\n\n\ +\tnosmp {\n\ +\t\tdescription\t\"\\\tUniprocessor Mode\";\n\ +\t\tappend\t\t\"nosmp\";\n\ +\t}\n\n\ +\tvideo {\n\ +\t\tdescription\t\"\\\tImpactSR/VPro Console\\\n\\\r\";\n\ +\t\tappend\t\t\"console=tty0\";\n\ +\t}\n\ +}\n\n\n" + +ip32base="# IP32 O2\n\ +ip32 {\n\ +\tdescription\t\"SGI O2\";\n\ +\tappend\t\t\"real_root=/dev/sr0\" \"cdroot=/dev/loop0\" \"looptype=sgimips\" \"nox\" \"nosound\";\n" + +ip32r5k="\tr5000 rm5200 {\n\ +\t\tdescription\t\"\\\tR5000/RM5200 CPU\";\n\ +\t\timage system\t\"/ip32r5k\";\n\ +\t}\n" + +ip32rm7k="\trm7000 {\n\ +\t\tdescription\t\"\\\tRM7000 CPU\";\n\ +\t\timage system\t\"/ip32rm7k\";\n\ +\t}\n" + +ip32r10k="\tr10000 r12000 {\n\ +\t\tdescription\t\"\\\tR10000/R12000 CPU\";\n\ +\t\timage system\t\"/ip32r10k\";\n\ +\t}\n" + +ip32vid="\tvideo=640x480 {\n\ +\t\tdescription\t\"\\\tGBEFB Console 640x480 16bpp/75Hz\";\n\ +\t\tappend\t\t\"console=tty0 video=gbefb:640x480-16@75\";\n\ +\t}\n\n\ +\tvideo=800x600 {\n\ +\t\tdescription\t\"\\\tGBEFB Console 800x600 16bpp/75Hz\";\n\ +\t\tappend\t\t\"console=tty0 video=gbefb:800x600-16@75\";\n\ +\t}\n\n\ +\tvideo=1024x768 {\n\ +\t\tdescription\t\"\\\tGBEFB Console 1024x768 16bpp/75Hz\";\n\ +\t\tappend\t\t\"console=tty0 video=gbefb:1024x768-16@75\";\n\ +\t}\n\n\ +\tvideo=1280x1024 {\n\ +\t\tdescription\t\"\\\tGBEFB Console 1280x1024 16bpp/75Hz\\\n\\\r\\\n\\\r\\\n\\\r\";\n\ +\t\tappend\t\t\"console=tty0 video=gbefb:1280x1024-16@75\";\n\ +\t}\n" + +ip32x="}\n\n\n" + +cmt2="comment\t\t\"To boot an image, set \`OSLoadFilename\` to the to following sequence\";\n\ +comment\t\t\"depending on your desired options (examples):\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"IP32 R5000 w/ 38400 serial:\\\n\\\r\";\n\ +comment\t\t\"setenv OSLoadFilename ip32(r5000,serial-h)\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"IP32 RM5200 w/ GBEFB Console @ 800x600:\\\n\\\r\";\n\ +comment\t\t\"setenv OSloadFilename ip32(rm5200,video=800x600)\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"IP30 w/ no SMP and video:\\\n\\\r\";\n\ +comment\t\t\"setenv OSLoadFilename ip30(nosmp,video)\\\n\\\r\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"Once \`OSLoadFilename\` is set, execute:\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"\`sashARCS\` for IP22/IP32\\\n\\\r\\\n\\\r\";\n\ +comment\t\t\"\`sash64\` for IP27/IP28/IP30\\\n\\\r\\\n\\\r\";\n\n" + +#//----------------------------------------------------------------------------- -- 2.26.2