summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-07-08 03:00:53 +0000
committerJeremy Katz <katzj@redhat.com>2003-07-08 03:00:53 +0000
commit459119c94529602d08de465b7ebfa4871d328081 (patch)
tree369a7eb643938d6d51ef6f2d0c46561e61dcc0ae /scripts
parent390977d3ee0ebc010168ce04573f63ae15458718 (diff)
downloadanaconda-459119c94529602d08de465b7ebfa4871d328081.tar.gz
anaconda-459119c94529602d08de465b7ebfa4871d328081.tar.xz
anaconda-459119c94529602d08de465b7ebfa4871d328081.zip
massive merge from taroon branch. changes are all over the place, but a
summary of looking through the diff is * clean up warnings, we build with -Wall -Werror here too * product.img stuff * max logical partitions enforcement * 1 TB max fs size * ethtool stuff * autopart in kickstart * driver disk fixes * RHEL upgrade stuff * network driver disks * variant pkgorder/tree splitting
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mk-images.ia641
-rw-r--r--scripts/mk-images.ppc2
-rwxr-xr-xscripts/pkgorder151
-rw-r--r--scripts/splittree.py9
4 files changed, 90 insertions, 73 deletions
diff --git a/scripts/mk-images.ia64 b/scripts/mk-images.ia64
index 87247529f..7ce27aab1 100644
--- a/scripts/mk-images.ia64
+++ b/scripts/mk-images.ia64
@@ -48,6 +48,7 @@ makeBootImages() {
cp -l $TOPDESTPATH/images/boot.img $TOPDESTPATH/images/isopath
mkisofs -o $TOPDESTPATH/images/boot.iso -b boot.img -no-emul-boot -R -J -V -T $TOPDESTPATH/images/isopath
rm -rf $TOPDESTPATH/images/isopath
+ rm -f $TOPDESTPATH/images/ramdisk.img
}
makeSecondStage() {
diff --git a/scripts/mk-images.ppc b/scripts/mk-images.ppc
index f8d14d4e0..25edfaba4 100644
--- a/scripts/mk-images.ppc
+++ b/scripts/mk-images.ppc
@@ -4,7 +4,7 @@ IDEMODS="ide-cd"
SCSIMODS="sd_mod sg sr_mod st"
LATEUSBMODS="mousedev usb-storage"
SECSTAGE="raid0 raid1 raid5 lvm-mod $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS"
-NETMODULES="sungem tg3 ne2k-pci 3c59x 8139too
+NETMODULES="sungem tg3 ne2k-pci 3c59x 8139too olympic
de4x5 acenic pcnet32 tulip natsemi e100 e1000 airport"
SCSIMODULES="$SCSIMODS advansys aic7xxx initio sym53c8xx"
diff --git a/scripts/pkgorder b/scripts/pkgorder
index b4b8574b6..658b79b63 100755
--- a/scripts/pkgorder
+++ b/scripts/pkgorder
@@ -71,13 +71,61 @@ def addIfNeeded(pkg):
pkgHash[pkg.name].append(pkg)
pkgOrder.append(pkg.nevra())
-
+
+outputted = []
+# Now set up rpm to run the transaction deporder
+testpath = '/tmp/pkgorder-' + str (os.getpid ())
+os.system ("mkdir -p " + testpath + "/var/lib/rpm")
+
+def runTsAndOutput(pkglist):
+ global outputted
+
+ # no sense trying with no packages
+ if len(pkglist) == 0:
+ return
+
+ ts = rpm.TransactionSet(testpath)
+ ts.setVSFlags(~(rpm.RPMVSF_NORSA|rpm.RPMVSF_NODSA))
+ ts.setFlags(rpm.RPMTRANS_FLAG_ANACONDA)
+
+ for item in pkglist:
+# print >> sys.stderr, "adding %s" %(item.name,)
+ ts.addInstall(item.hdr, item.hdr, "i")
+
+ ts.check()
+ ts.order()
+
+ theorder = ts.getKeys()
+ if theorder is None: theorder = []
+ # print the results.
+ for p in theorder:
+ def archSort(hdr1, hdr2):
+ h1 = hdlist[hdr1[0]]
+ h2 = hdlist[hdr2[0]]
+
+ if rhpl.arch.score(h1['arch']) > rhpl.arch.score(h2['arch']):
+ return -1
+ elif rhpl.arch.score(h1['arch']) < rhpl.arch.score(h2['arch']):
+ return 1
+ return 0
+
+ if p['name'] in outputted:
+ continue
+ outputted.append(p['name'])
+ pkgs = hdlist.pkgnames[p['name']]
+ pkgs.sort(archSort)
+ for pnevra in pkgs:
+ pkg = hdlist.pkgs[pnevra[0]]
+ print "%s-%s-%s.%s.rpm" % (pkg['name'], pkg['version'],
+ pkg['release'], pkg['arch'])
+
+
# set PKGORDER_DEBUG to get rpm debugging
if os.environ.has_key("PKGORDER_DEBUG"):
rpm.setVerbosity(rpm.RPMLOG_DEBUG)
-if len(sys.argv) != 3:
+if len(sys.argv) < 3:
print "pkgorder <toppath> <arch>"
sys.exit(1)
@@ -111,12 +159,14 @@ pkgOrder = []
pkgHash = {}
# We always want all the kernels-.* in our package list, except for a few
-for package in hdlist.keys():
+for p in hdlist.values():
+ package = p['name']
if (package.startswith("kernel") and
- not package.startswith("kernel-doc") and
- not package.startswith("kernel-source") and
- not package.startswith("kernel-debug")):
+ package in hdrlist.EverythingExclude.keys() and
+ not package.endswith("-unsupported")):
try:
+ # FIXME: since we do unselect all at the end of the loop, these
+ # stay selected for the first time through
hdlist[package].select()
except:
print package
@@ -131,12 +181,18 @@ tier1langs = ("en:en_US:de:de_DE:es:es_ES:fr:fr_FR:it:it_IT:ja:ja_JP:"
grpids = grpset.groups.keys()
grpids.sort()
-
-# FIXME: this is a hack to get things we want to be first on the CDs earlier
-# in a more perfect world, we'd read the installclasses to do this
-complist = ["core", "base", "text-internet", "web-server",
- "smb-server", "printing", "dialup", "server-cfg",
- "admin-tools"]
+
+# allow passing in an initial group list on the command line
+if len(sys.argv) > 3:
+ complist = sys.argv[3:]
+else:
+ complist = []
+# then we add the things we have hard-coded. this is kind of ugly and in
+# a perfect world, we could figure it out automagically, but oh well
+for g in ("core", "base", "text-internet", "web-server",
+ "smb-server", "printing", "dialup", "server-cfg",
+ "admin-tools"):
+ if g not in complist: complist.append(g)
# now let's pull in all of workstation common
if grpset.groups.has_key("workstation-common"):
comp = grpset.groups["workstation-common"]
@@ -145,10 +201,10 @@ if grpset.groups.has_key("workstation-common"):
if name not in complist:
complist.append(name)
# a couple more that make sense to have early
-complist.extend(["gnome-desktop", "emacs", "development-tools",
- "development-libs", "x-software-development",
- "gnome-software-development", "kde-desktop",
- "kde-software-development"])
+for g in ("gnome-desktop", "emacs", "development-tools", "development-libs",
+ "x-software-development", "gnome-software-development",
+ "kde-desktop", "kde-software-development"):
+ if g not in complist: complist.append(g)
latelangs = []
for id in grpids:
@@ -171,7 +227,6 @@ for id in complist:
group = grpset.groups[id]
list = []
- grpset.unselectAll()
group.select()
# append what got turned on to our order.
@@ -179,9 +234,15 @@ for id in complist:
if p.isSelected():
list.append(p)
list.sort(cmpHeaderByName)
+
+# print >> sys.stderr, id
for item in list:
addIfNeeded(item)
+ runTsAndOutput(list)
+ grpset.unselectAll()
+
+
# add all of the packages that haven't been added yet.
list = []
for p in hdlist.pkgs.values():
@@ -192,57 +253,9 @@ for item in list:
if item.nevra() not in pkgOrder:
pkgOrder.append(item.nevra())
-# Now set up rpm to run the transaction deporder
-testpath = '/tmp/pkgorder-' + str (os.getpid ())
-os.system ("mkdir -p " + testpath + "/var/lib/rpm")
-
-ts = rpm.TransactionSet(testpath)
-ts.setVSFlags(~(rpm.RPMVSF_NORSA|rpm.RPMVSF_NODSA))
-ts.setFlags(rpm.RPMTRANS_FLAG_ANACONDA)
-# ts coloring, more hacks to workaround #92285
-if (rhpl.arch.canonArch.startswith("ppc64") or
- rhpl.arch.canonArch in ("s390x", "sparc64", "x86_64")):
- ts.setColor(3)
-
-i = 0
-for h in pkgOrder:
-# sys.stderr.write("%s: %s\n" %(i, h))
- i += 1
- ts.addInstall(hdlist[h].hdr, hdlist[h].hdr, 'i')
-pkgOrder = []
-
-# we have to run ts.check() before ts.order() now to set up the
-# alIndex.
-ts.check()
-ts.order()
-
-# Get the order back out...
-try:
- pkgOrder = ts.getKeys()
-except AttributeError:
- print "you don't have the latest RPM!"
- sys.exit(1)
-
-outputted = []
-# print the results.
+list = []
for p in pkgOrder:
- def archSort(hdr1, hdr2):
- h1 = hdlist[hdr1[0]]
- h2 = hdlist[hdr2[0]]
-
- if rhpl.arch.score(h1['arch']) > rhpl.arch.score(h2['arch']):
- return -1
- elif rhpl.arch.score(h1['arch']) < rhpl.arch.score(h2['arch']):
- return 1
- return 0
-
- if p['name'] in outputted:
- continue
- outputted.append(p['name'])
- pkgs = hdlist.pkgnames[p['name']]
- pkgs.sort(archSort)
- for pnevra in pkgs:
- pkg = hdlist.pkgs[pnevra[0]]
- print "%s-%s-%s.%s.rpm" % (pkg['name'], pkg['version'],
- pkg['release'], pkg['arch'])
+ list.append(hdlist[p])
+
+runTsAndOutput(list)
diff --git a/scripts/splittree.py b/scripts/splittree.py
index 50297615a..29e7348e8 100644
--- a/scripts/splittree.py
+++ b/scripts/splittree.py
@@ -238,7 +238,7 @@ and RPMs. Set to 1 to turn on."""
- def splitRPMS(self):
+ def splitRPMS(self, reportSize = 1):
"""Creates links in the split dirs for the RPMs"""
packages = {}
@@ -280,6 +280,8 @@ and RPMs. Set to 1 to turn on."""
disc = self.bin_list[0]
for rpm_nvr in orderedlist:
+ if not packages.has_key(rpm_nvr):
+ continue
for file_name in packages[rpm_nvr]:
curused = self.getSize("%s-disc%s" % (self.dist_dir, disc), blocksize=1)
filesize = self.getSize("%s/RedHat/RPMS/%s" % (self.dist_dir, file_name), blocksize=1)
@@ -318,8 +320,9 @@ and RPMs. Set to 1 to turn on."""
os.link("%s/RedHat/RPMS/%s" % (self.dist_dir, file_name),
"%s-disc%d/RedHat/RPMS/%s" % (self.dist_dir, disc, file_name))
lastpackage = file_name
-
- self.reportSizes(disc, firstpkg=firstpackage, lastpkg=lastpackage)
+
+ if reportSize == 1:
+ self.reportSizes(disc, firstpkg=firstpackage, lastpkg=lastpackage)