[Yum] PPC "support"

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

 



--=-zE6rw8RzZgxT3Hvbx+bT
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Attached is an extremely trivial patch that we use in YDL 3 for yum.
The bootloader bits are handled via grubby, etc.. so very small changes
have to actually be made to yum itself. This patch is against yum 1.0.

-Dan

--=-zE6rw8RzZgxT3Hvbx+bT
Content-Disposition: attachment; filename=yum-1.0-ydl.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=yum-1.0-ydl.patch; charset=ISO-8859-1

diff -uNr yum-1.0.orig/checkbootloader.py yum-1.0/checkbootloader.py
--- yum-1.0.orig/checkbootloader.py	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/checkbootloader.py	2003-03-13 21:59:26.000000000 -0700
@@ -19,11 +19,13 @@
=20
 grubConfigFile =3D "/boot/grub/grub.conf"
 liloConfigFile =3D "/etc/lilo.conf"
+yabootConfigFile =3D "/etc/yaboot.conf"
=20
=20
 def whichBootLoader():
     haveGrubConf =3D 1
     haveLiloConf =3D 1
+    haveYabootConf =3D 1
    =20
     bootDev =3D None
    =20
@@ -33,6 +35,8 @@
         haveGrubConf =3D 0
     if not os.access(liloConfigFile, os.R_OK):
         haveLiloConf =3D 0
+    if not os.access(yabootConfigFile, os.R_OK):
+        haveYabootConf =3D 0
=20
     if haveGrubConf:
         f =3D open(grubConfigFile, "r")
@@ -66,6 +70,13 @@
         if block[6:10] =3D=3D "LILO":
             return "LILO"
=20
+    if haveYabootConf:
+        f =3D open(yabootConfigFile, "r")
+        lines =3D f.readlines()
+        for line in lines:
+            if line[0:5] =3D=3D "boot=3D":
+                bootDev =3D line[5:-1]
+            	return "YABOOT"
=20
 if __name__ =3D=3D "__main__":
     bootloader =3D whichBootLoader()
diff -uNr yum-1.0.orig/etc/yum.init yum-1.0/etc/yum.init
--- yum-1.0.orig/etc/yum.init	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/etc/yum.init	2003-03-13 21:59:26.000000000 -0700
@@ -4,7 +4,7 @@
 #
 # Author:       Seth Vidal <skvidal@xxxxxxxxxxxx>
 #
-# chkconfig:	345 50 01
+# chkconfig:	- 50 01
 #
 # description:  Enable daily run of yum, a program updater
 #
diff -uNr yum-1.0.orig/grubcfg.py yum-1.0/grubcfg.py
--- yum-1.0.orig/grubcfg.py	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/grubcfg.py	2003-03-14 01:51:00.000000000 -0700
@@ -35,8 +35,13 @@
     return ret
=20
 def setDefault(newImage):
+    if iutil.getArch() =3D=3D "ppc":
+	kernName =3D "vmlinux"
+    else:
+	kernName =3D "vmlinuz"
+
     try:
-        ret =3D iutil.execWithRedirect("/sbin/grubby", ["grubby", "--set-d=
efault", "/boot/vmlinuz-%s" % newImage])
+        ret =3D iutil.execWithRedirect("/sbin/grubby", ["grubby", "--set-d=
efault", "/boot/%s-%s" %(kernName, newImage)])
     except RuntimeError, command:
         raise GrubbyRuntimeError("unable to run grubby. Not running as roo=
t?")
=20
diff -uNr yum-1.0.orig/lilocfg.py yum-1.0/lilocfg.py
--- yum-1.0.orig/lilocfg.py	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/lilocfg.py	2003-03-13 21:59:26.000000000 -0700
@@ -63,7 +63,7 @@
=20
 class LiloConfParseError(Error):
     def __repr__(self):
-        msg =3D _("lilo options that are not supported by up2date are used=
 in the default lilo.conf. This file will not be modified. The options incl=
ude:\n") + self.errmsg
+        msg =3D _("lilo options that are not supported by yum are used in =
the default lilo.conf. This file will not be modified. The options include:=
\n") + self.errmsg
         return msg
=20
=20
@@ -345,7 +345,7 @@
             config.addEntry("default", label)
        =20
     # the default "backupname"
-    backupfile =3D filename + ".up2date-" + repr(time.time())
+    backupfile =3D filename + ".yum-" + repr(time.time())
     # first, see if there are existing backup files
     # if so, choose-another
     while os.access(backupfile, os.F_OK):
diff -uNr yum-1.0.orig/pkgaction.py yum-1.0/pkgaction.py
--- yum-1.0.orig/pkgaction.py	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/pkgaction.py	2003-03-13 23:56:07.000000000 -0700
@@ -274,7 +274,8 @@
     for (name,arch) in tsnevral.NAkeys():
         s =3D tsnevral.state(name,arch)
         if s in ['i','u','ud','iu']:
-            if name in ['kernel','kernel-smp','kernel-enterprise','kernel-=
bigmem','kernel-BOOT']:
+            if name in ['kernel','kernel-smp','kernel-enterprise','kernel-=
bigmem','kernel-BOOT',
+			'kernel-ans', 'kernel-briq', 'kernel-pseries', 'kernel-iseries', 'kerne=
l-teron']:
                 hdr=3Dtsnevral.getHeader(name,arch)
                 if "kernel-smp" in hdr[rpm.RPMTAG_PROVIDES]:
                     extraInfo =3D "kernel-smp"
@@ -284,6 +285,16 @@
                     extraInfo =3D "kernel-bigmem"
                 elif "kernel-BOOT" in hdr[rpm.RPMTAG_PROVIDES]:
                     extraInfo =3D "kernel-BOOT"   =20
+                elif "kernel-ans" in hdr[rpm.RPMTAG_PROVIDES]:
+                    extraInfo =3D "kernel-ans"
+                elif "kernel-briq" in hdr[rpm.RPMTAG_PROVIDES]:
+                    extraInfo =3D "kernel-briq"
+                elif "kernel-pseries" in hdr[rpm.RPMTAG_PROVIDES]:
+                    extraInfo =3D "kernel-pseries"
+                elif "kernel-iseries" in hdr[rpm.RPMTAG_PROVIDES]:
+                    extraInfo =3D "kernel-iseries"
+                elif "kernel-teron" in hdr[rpm.RPMTAG_PROVIDES]:
+                    extraInfo =3D "kernel-teron"
                 else:
                     extraInfo =3D "kernel"
=20
@@ -300,6 +311,16 @@
                     infoString =3D "bigmem" =20
                 elif extraInfo =3D=3D "kernel-smp":
                     infoString =3D "smp"
+                elif extraInfo =3D=3D "kernel-ans":
+                    infoString =3D "ans"
+                elif extraInfo =3D=3D "kernel-briq":
+                    infoString =3D "briq"
+                elif extraInfo =3D=3D "kernel-pseries":
+                    infoString =3D "pseries"
+                elif extraInfo =3D=3D "kernel-iseries":
+                    infoString =3D "iseries"
+                elif extraInfo =3D=3D "kernel-teron":
+                    infoString =3D "teron"
                 else:
                     infoString =3D ""
                 verRel =3D "%s-%s%s" % (hdr[rpm.RPMTAG_VERSION], hdr[rpm.R=
PMTAG_RELEASE],infoString)
@@ -321,6 +342,9 @@
             #to put the kernels in the right order
             log(2,'Grub found - making this kernel the default')
             up2datetheft.install_grub(kernel_list)
+        elif bootloader =3D=3D "YABOOT":
+            log(2, 'Yaboot found - adding kernel to yaboot and making it t=
he default')
+            up2datetheft.install_grub(kernel_list)
         else:
             errorlog(1, 'No bootloader found, Cannot configure kernel, con=
tinuing.')
             filelog(1, 'No bootloader found, Cannot configure kernel.')
diff -uNr yum-1.0.orig/translate.py yum-1.0/translate.py
--- yum-1.0.orig/translate.py	2003-03-10 23:38:19.000000000 -0700
+++ yum-1.0/translate.py	2003-03-13 21:59:26.000000000 -0700
@@ -4,6 +4,7 @@
 # $Id: translate.py,v 1.2 2002/06/30 06:53:39 skvidal Exp $
=20
 import os, string
+from iutil import getArch
=20
 prefix =3D '/usr'
 localedir =3D prefix + '/share/locale'
@@ -241,20 +242,10 @@
                 lang.append(nl)
     return lang
=20
-def getArch ():
-    arch =3D os.uname ()[4]
-    if (len (arch) =3D=3D 4 and arch[0] =3D=3D 'i' and arch[2:4] =3D=3D "8=
6"):
-        arch =3D "i386"
-
-    if arch =3D=3D "sparc64":
-        arch =3D "sparc"
-
-    return arch
-
 ###################################################################
 # Now the real module code
=20
-if getArch() =3D=3D 'sparc':
+if getArch() =3D=3D 'sparc' or getArch() =3D=3D 'ppc':
     _gettext_byteorder =3D 'msb'
 else:
     _gettext_byteorder =3D 'lsb'
@@ -262,14 +253,14 @@
 class i18n:
     def __init__(self):
         self.langs =3D lang
-        self.cat =3D Catalog("up2date")
+        self.cat =3D Catalog("yum")
=20
     def getlangs(self):
         return self.langs
=20
     def setlangs(self, langs):
         self.langs =3D setlangs(langs)
-        self.cat =3D Catalog("up2date")
+        self.cat =3D Catalog("yum")
=20
     def gettext(self, string):
         return self.cat.gettext(string)

--=-zE6rw8RzZgxT3Hvbx+bT--


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux