diff options
45 files changed, 1090 insertions, 131 deletions
@@ -1,6 +1,6 @@ include Makefile.inc -VERSION = 7.2.91 +VERSION = 7.3.90 RELEASE = 0 SNAPRELEASE = $(RELEASE)$(shell date "+.%Y%m%d%H%M") @@ -21,7 +21,10 @@ CATALOGS = po/anaconda.pot PYFILES = $(wildcard *.py) -all: subdirs _xkb.so xmouse.so $(CATALOGS) lang-table lang-names +all: subdirs _xkb.so xmouse.so $(CATALOGS) lang-table lang-names product.py + +product.py: product.py.in Makefile.inc + sed -e 's/@@PRODUCTNAME@@/$(PRODUCTNAME)/g' < product.py.in > product.py lang-names: lang-table PYTHONPATH="iconvmodule:." $(PYTHON) scripts/getlangnames.py > lang-names @@ -93,7 +93,7 @@ try: 'testpath=', 'mountfs', 'traceonly', 'kickstart=', 'lang=', 'keymap=', 'module=', 'class=', 'expert', 'serial', 'lowres', 'nofb', 'rescue', 'nomount', - 'autostep']) + 'autostep', 'resolution=']) except TypeError, msg: sys.stderr.write("Error %s\n:" % msg) sys.exit(-1) @@ -191,6 +191,10 @@ for n in args: overhead = int(arg) elif (str == '--rescue'): progmode = 'rescue' + elif (str == '--resolution'): + # run native X server at specified resolution, ignore fb + runres = arg + nofb = 1 elif (str == "--autostep"): flags.autostep = 1 elif (str == '-r' or str == '--rootpath'): @@ -244,12 +248,13 @@ if (debug): import pdb pdb.set_trace() -# don't let folks do anything stupid on !s390 -if (not flags.test and os.getpid() > 90 and flags.setupFilesystems and - not iutil.getArch() == "s390"): - sys.stderr.write( - "You're running me on a live system! that's incredibly stupid.\n") - sys.exit(1) +# let people be stupid +## # don't let folks do anything stupid on !s390 +## if (not flags.test and os.getpid() > 90 and flags.setupFilesystems and +## not iutil.getArch() == "s390"): +## sys.stderr.write( +## "You're running me on a live system! that's incredibly stupid.\n") +## sys.exit(1) import isys import instdata @@ -281,6 +286,7 @@ if traceOnly: import xserver import configFileData import kickstart + import whiteout installclass.availableClasses() @@ -397,7 +403,8 @@ if 1: if (display_mode != 't' and method and method.startswith('ftp://') or method.startswith('http://') or - method.startswith('hd://')): + method.startswith('hd://') or + method.startswith('oldhd://')): print _("Graphical installation not available for %s installs. " "Starting text mode.") % (string.split(method, ':')[0],) display_mode = 't' @@ -429,7 +436,6 @@ else: # s390 checks # startXServer = 0 - if display_mode == 'g': import xf86config @@ -588,10 +594,6 @@ if method: floppyDevice = floppy.probeFloppyDevice() -# create device nodes for detected devices if we're not running in test mode -if not flags.test and flags.setupFilesystems: - iutil.makeDriveDeviceNodes() - id = instClass.installDataClass(extraModules, floppyDevice, configFileData) #id = instClass.installDataClass(extraModules, floppyDevice) diff --git a/anaconda.spec.in b/anaconda.spec.in index c520a7a6e..e58bd4915 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -51,6 +51,9 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING %doc docs/command-line.txt %doc docs/install-methods.txt +%doc docs/kickstart-docs.txt +%doc docs/kickstart-docs.html +%doc docs/anaconda-release-notes.txt /usr/sbin/anaconda /usr/share/anaconda /usr/share/locale/*/*/* @@ -66,6 +69,9 @@ rm -rf $RPM_BUILD_ROOT * %{date} Anaconda team <bugzilla@redhat.com> - built new version from CVS +* Tue Apr 02 2002 Michael Fulbright <msf@redhat.com> +- added some more docs + * Fri Feb 22 2002 Jeremy Katz <katzj@redhat.com> - buildrequire kernel-pcmcia-cs as we've sucked the libs the loader needs to there now diff --git a/autopart.py b/autopart.py index 10f6e72d3..d058374e4 100644 --- a/autopart.py +++ b/autopart.py @@ -24,6 +24,7 @@ import partRequests from constants import * from translate import _, N_ from partErrors import * +from log import log PARTITION_FAIL = -1 PARTITION_SUCCESS = 0 @@ -262,7 +263,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): largestPart = (0, None) drives = getDriveList(request, diskset) -# print "Trying drives to find best free space out of", free +# log("Trying drives to find best free space out of", free) for drive in drives: # this request is bootable and we've found a large enough # partition already, so we don't need to keep trying other @@ -271,11 +272,24 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): break # print "Trying drive", drive disk = diskset.disks[drive] + numPrimary = len(partedUtils.get_primary_partitions(disk)) + + # if there is an extended partition add it in + if disk.extended_partition: + numPrimary = numPrimary + 1 + + maxPrimary = disk.max_primary_partition_count for part in free[drive]: -# print "Trying partition", printFreespaceitem(part) + # if this is a free space outside extended partition + # make sure we have free primary partition slots + if not part.type & parted.PARTITION_LOGICAL: + if numPrimary == maxPrimary: + continue + +# log( "Trying partition %s" % (printFreespaceitem(part),)) partSize = partedUtils.getPartSizeMB(part) -# print "partSize %s request %s" % (partSize, request.requestSize) +# log("partSize %s request %s" % (partSize, request.requestSize)) if partSize >= request.requestSize and partSize > largestPart[0]: if not request.primary or (not part.type & parted.PARTITION_LOGICAL): largestPart = (partSize, part) @@ -286,7 +300,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): return PARTITION_FAIL # raise PartitioningError, "Can't fulfill request for partition: \n%s" %(request) -# print "largestPart is",largestPart +# log( "largestPart is %s" % (largestPart,)) freespace = largestPart[1] freeStartSec = freespace.geom.start freeEndSec = freespace.geom.end @@ -348,7 +362,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None): raise PartitioningError, "Impossible partition to create" fsType = request.fstype.getPartedFileSystemType() -# print "creating newp with start=%s, end=%s, len=%s" % (startSec, endSec, endSec - startSec) +# log("creating newp with start=%s, end=%s, len=%s" % (startSec, endSec, endSec - startSec)) newp = disk.partition_new (partType, fsType, startSec, endSec) constraint = disk.constraint_any () @@ -754,7 +768,6 @@ def doPartitioning(diskset, requests, doRefresh = 1): if ret == PARTITION_FAIL: raise PartitioningError, "Partitioning failed: %s" %(msg) - ret = growParts(diskset, requests, newParts) newParts.reset() @@ -894,7 +907,6 @@ def doAutoPartition(dir, diskset, partitions, intf, instClass, dispatch): # XXX only do this if we're dirty ## id.diskset.refreshDevices() ## id.partrequests = PartitionRequests(id.diskset) - doClearPartAction(partitions, diskset) # XXX clearpartdrives is overloaded as drives we want to use for linux diff --git a/constants.py b/constants.py index d527cb630..0fb4591be 100644 --- a/constants.py +++ b/constants.py @@ -41,3 +41,7 @@ CLEARPART_TYPE_NONE = 3 CHECK_DEPS = 0 IGNORE_DEPS = 1 RESOLVE_DEPS = 2 + +# common string needs to be easy to change +import product +productName = product.productName diff --git a/dispatch.py b/dispatch.py index 23b2ff9b7..07cf3861e 100644 --- a/dispatch.py +++ b/dispatch.py @@ -121,7 +121,7 @@ installSteps = [ ("dopostaction", doPostAction, ("id", "instPath")), ("bootdisk", ("dir", "dispatch", "id.fsset")), ("makebootdisk", makeBootdisk, ("intf", "id.floppyDevice", - "id.hdList", "instPath")), + "id.hdList", "instPath", "id.bootloader")), ("videocard", ("dispatch", "id.xconfig", "id.videocard", "intf")), ("monitor", ("id.xconfig", "id.monitor")), ("xcustom", ("id.xconfig", "id.monitor", "id.videocard", diff --git a/exception.py b/exception.py index a787ce331..083464b2d 100644 --- a/exception.py +++ b/exception.py @@ -143,8 +143,8 @@ def dumpException(out, text, tb, dispatch): traceback.print_exc(None, out) for file in ("/tmp/syslog", "/tmp/netinfo", - dispatch.instPath + "/tmp/install.log", - dispatch.instPath + "/tmp/upgrade.log"): + dispatch.instPath + "/root/install.log", + dispatch.instPath + "/root/upgrade.log"): try: f = open(file, 'r') line = "\n\n%s:\n" % (file,) @@ -48,7 +48,7 @@ def probeFloppyDevice(): log("anaconda floppy device is %s", fdDevice) return fdDevice -def makeBootdisk (intf, floppyDevice, hdList, instPath): +def makeBootdisk (intf, floppyDevice, hdList, instPath, bootloader): if flags.test: return DISPATCH_NOOP @@ -70,9 +70,15 @@ def makeBootdisk (intf, floppyDevice, hdList, instPath): kernelTag = "-%s-%s" % (kernel[rpm.RPMTAG_VERSION], kernel[rpm.RPMTAG_RELEASE]) + if bootloader.args.get(): + args = bootloader.args.get() + else: + args = "" + w = intf.waitWindow (_("Creating"), _("Creating boot disk...")) rc = iutil.execWithRedirect("/sbin/mkbootdisk", [ "/sbin/mkbootdisk", + "--kernelargs", args, "--noprompt", "--device", "/dev/" + floppyDevice, @@ -26,6 +26,7 @@ from language import expandLangs from splashscreen import splashScreenPop from log import log from flags import flags +from constants import * StayOnScreen = "stayOnScreen" mainWindow = None @@ -353,7 +354,8 @@ class InstallInterface: self.dispatch = dispatch - if flags.setupFilesystems: + # XXX users complain when the keypad doesn't work for input. + if 0 and flags.setupFilesystems: try: kb.setMouseKeys (1) except SystemError: @@ -525,14 +527,17 @@ class InstallControlWindow: def loadReleaseNotes(self): langList = self.langSearchPath + [ "" ] sourcepath = self.dispatch.method.getSourcePath() + suffixList = [] for lang in langList: if lang: - langpart = '.%s' % (lang,) + suffixList.append("-%s.html" % (lang,)) + suffixList.append(".%s" % (lang,)) else: - langpart = '' + suffixList.append(".html") + suffixList.append("") - for suffix in ('.html', ''): - fn = '%s/RELEASE-NOTES%s%s' % (sourcepath, langpart, suffix) + for suffix in suffixList: + fn = "%s/RELEASE-NOTES%s" % (sourcepath, suffix) if os.access(fn, os.R_OK): file = open(fn, "r") if suffix == '.html': @@ -752,7 +757,7 @@ class InstallControlWindow: self.window.set_border_width (10) - title = _("Red Hat Linux Installer") + title = _("%s Installer") % (productName,) if os.environ["DISPLAY"][:1] != ':': # from gnome.zvt import * # zvtwin = gtk.Window () @@ -767,7 +772,7 @@ class InstallControlWindow: for line in lines: netinf = string.splitfields (line, '=') if netinf[0] == "HOSTNAME": - title = _("Red Hat Linux Installer on %s") % string.strip (netinf[1]) + title = _("%s Installer on %s") % (productName, string.strip (netinf[1])) # shtitle = _("Red Hat Linux Install Shell on %s") % string.strip (netinf[1]) break @@ -113,6 +113,9 @@ class CdromInstallMethod(ImageInstallMethod): if done: break + if done: + break + if not done: isys.ejectCdrom(self.device) @@ -133,6 +136,8 @@ class CdromInstallMethod(ImageInstallMethod): f.close() if newStamp == timestamp: done = 1 + # make /tmp/cdrom again so cd gets ejected + isys.makeDevInode(self.device, "/tmp/cdrom") if not done: self.messageWindow(_("Wrong CDROM"), @@ -174,8 +179,6 @@ def findIsoImages(path, messageWindow): arch = iutil.getArch() discImages = {} - print "need to look at", files - for file in files: what = path + '/' + file if not isys.isIsoImage(what): continue @@ -262,7 +265,6 @@ class NfsIsoInstallMethod(NfsInstallMethod): # images the same way -- we use loop3 for everything self.discImages = findIsoImages(tree, messageWindow) - print "found", self.discImages, "in tree", tree self.mountImage(1) ImageInstallMethod.__init__(self, self.mntPoint) diff --git a/instdata.py b/instdata.py index 83c46e23b..7553320ff 100644 --- a/instdata.py +++ b/instdata.py @@ -119,7 +119,7 @@ class InstallData: self.langSupport.writeKS(f) self.keyboard.writeKS(f) self.mouse.writeKS(f) - self.xconfig.writeKS(f) + self.xconfig.writeKS(f, self.desktop) self.network.writeKS(f) self.rootPassword.writeKS(f, self.auth) self.firewall.writeKS(f) @@ -298,7 +298,11 @@ def findtz(basepath, relpath): def rmrf (path): # this is only the very simple case. - files = os.listdir (path) + if os.path.isdir(path): + files = os.listdir (path) + else: + os.unlink(path) + return for file in files: if os.path.isdir(path + '/' + file): rmrf (path + '/' + file) @@ -35,6 +35,7 @@ class Keyboard (SimpleConfigFile): ("dk" , ('pc102', 'dk', '')), ("dk-latin1" , ('pc102', 'dk', '')), ("es" , ('pc102', 'es', '')), + ("et" , ('pc105', 'ee', '')), ("fi" , ('pc102', 'fi', '')), ("fi-latin1" , ('pc102', 'fi', '')), ("fr" , ('pc102', 'fr', '')), @@ -92,7 +93,7 @@ class Keyboard (SimpleConfigFile): x2console = {} for (console, (map, layout, variant)) in console2xlist: - + if not x2console.has_key((map, layout, variant)): x2console [(map, layout, variant)] = console diff --git a/kickstart.py b/kickstart.py index 6d7abd7ff..012bf90b9 100644 --- a/kickstart.py +++ b/kickstart.py @@ -109,7 +109,7 @@ class KickstartBase(BaseInstallClass): trusts.append(arg) elif str == '--port': if ports: - ports = '%s %s' % (ports, arg) + ports = '%s,%s' % (ports, arg) else: ports = arg @@ -220,7 +220,8 @@ class KickstartBase(BaseInstallClass): def doBootloader (self, id, args, useLilo = 0): (args, extra) = isys.getopt(args, '', [ 'append=', 'location=', 'useLilo', 'lba32', - 'password=', 'md5pass=', 'linear', 'nolinear']) + 'password=', 'md5pass=', 'linear', 'nolinear', + 'upgrade']) validLocations = [ "mbr", "partition", "none" ] appendLine = "" @@ -229,6 +230,7 @@ class KickstartBase(BaseInstallClass): md5pass = None forceLBA = 0 linear = 1 + upgrade = 0 for n in args: (str, arg) = n @@ -248,6 +250,8 @@ class KickstartBase(BaseInstallClass): password = arg elif str == '--md5pass': md5pass = arg + elif str == '--upgrade': + upgrade = 1 if location not in validLocations: raise ValueError, "mbr, partition, or none expected for bootloader command" @@ -255,9 +259,19 @@ class KickstartBase(BaseInstallClass): location = None else: location = validLocations.index(location) + + # FIXME: upgrade mode not implemented yet on HEAD + if upgrade and not id.upgrade.get(): + raise RuntimeError, "Selected upgrade mode for bootloader but not doing an upgrade" + + if upgrade: + id.bootloader.kickstart = 1 + id.bootloader.doUpgradeOnly = 1 self.setBootloader(id, useLilo, location, linear, forceLBA, password, md5pass, appendLine) + # FIXME: uncomment when upgrade boot loader stuff is merged +# self.skipSteps.append("upgbootloader") self.skipSteps.append("bootloader") self.skipSteps.append("bootloaderadvanced") @@ -652,6 +666,7 @@ class KickstartBase(BaseInstallClass): raidDev = arg if raidDev[0:2] == "md": raidDev = raidDev[2:] + raidDev = int(raidDev) elif str == "--spares": spares = int(arg) elif str == "--noformat": diff --git a/lang-table b/lang-table index e6f11d7f0..f8d088adb 100644 --- a/lang-table +++ b/lang-table @@ -1,4 +1,6 @@ -Czech cs lat3-sun16 iso02 cs_CZ cz-lat2 Europe/Prague +Chinese(Simplified) zh_CN.GB18030 None None zh_CN.GB18030 us Asia/Shanghai +Chinese(Traditional) zh_TW.Big5 None None zh_TW.Big5 us Asia/Taipei +Czech cs lat2-sun16 iso02 cs_CZ cz-lat2 Europe/Prague Danish da lat0-sun16 iso15 da_DK us Europe/Copenhagen English en default8x16 iso01 en_US us America/New_York French fr lat0-sun16 iso15 fr_FR fr-latin1 Europe/Paris @@ -8,7 +10,8 @@ Italian it lat0-sun16 iso15 it_IT it Europe/Rome Japanese ja Kon None ja_JP.eucJP jp106 Asia/Tokyo Korean ko None None ko_KR.eucKR us Asia/Seoul Norwegian no lat0-sun16 iso15 no_NO no-latin1 Europe/Oslo -Portugese pt_BR lat0-sun16 iso15 pt_PT pt-latin1 Europe/Lisbon +Portuguese pt lat0-sun16 iso15 pt_PT@euro pt-latin1 Europe/Lisbon +Romanian ro lat2-sun16 iso02 ro_RO ro Europe/Bucharest Russian ru cyr-sun16 koi8-r ru_RU.koi8r ru Europe/Moscow Slovenian sl lat2-sun16 iso02 sl_SI slovene Europe/Ljubljana Spanish es lat0-sun16 iso15 es_ES es Europe/Madrid diff --git a/language.py b/language.py index 82e09f446..3361743fa 100644 --- a/language.py +++ b/language.py @@ -252,6 +252,9 @@ class Language (SimpleConfigFile): self.info['LANG'] = lang self.info['SYSFONT'] = font self.info['SYSFONTACM'] = map + # XXX hack - because of exceptional cases on the var - zh_CN.GB2312 + if lang == "zh_CN.GB18030": + self.info['LANGUAGE'] = "zh_CN.GB18030:zh_CN.GB2312:zh_CN" def setSupported (self, langlist): if len(langlist) == len(self.allSupportedLangs): @@ -48,7 +48,7 @@ class Mouse (SimpleConfigFile): N_("Genius - NetScroll (PS/2)"): ("netmouse", "NetScrollPS/2", "psaux", 1, "geniusscrollps/2"), N_("Genius - NetScroll+ (PS/2)") : - ("netmouse", "NetMousePS/2", "psaux", 1, "geniusscrollps/2+"), + ("netmouse", "NetMousePS/2", "psaux", 1, "geniusscrollps/2+"), N_("Kensington - Thinking Mouse (serial)"): ("Microsoft", "ThinkingMouse", "ttyS", 1, "thinking"), N_("Kensington - Thinking Mouse (PS/2)"): @@ -219,6 +219,7 @@ class Mouse (SimpleConfigFile): # so leave it alone if (not self.info["XMOUSETYPE"] == "IMPS/2" and not self.info["XMOUSETYPE"] == "IntelliMouse" + and not self.info["XMOUSETYPE"] == "NetMousePS/2" and not self.info["XMOUSETYPE"] == "None" and not self.info["XMOUSETYPE"] == "none"): curmouse[1] = self.info["XMOUSETYPE"] @@ -232,6 +233,8 @@ class Mouse (SimpleConfigFile): pass def write(self, instPath): + if self.info["FULLNAME"] == "None - None": + return f = open(instPath + "/etc/sysconfig/mouse", "w") f.write(str (self)) f.close() diff --git a/network.py b/network.py index dd2cc32f4..977e85aab 100644 --- a/network.py +++ b/network.py @@ -215,7 +215,7 @@ class Network: fn = "%s/etc/sysconfig/network-scripts/ifcfg-%s" % (instPath, device) f = open(fn, "w") - os.chmod(fn, 0600) + os.chmod(fn, 0644) f.write(str(dev)) f.close() diff --git a/packages.py b/packages.py index 507a54fa9..9511e0363 100644 --- a/packages.py +++ b/packages.py @@ -73,7 +73,7 @@ def writeXConfiguration(id, instPath): xserver = id.videocard.primaryCard().getXServer() if not xserver: return - + log("Writing X configuration") if not flags.test: fn = instPath @@ -249,8 +249,12 @@ class InstallCallback: self.rpmFD = os.open(fn, os.O_RDONLY) # Make sure this package seems valid try: - (h, isSource) = rpm.headerFromPackage(self.rpmFD) + (hdr, isSource) = rpm.headerFromPackage(self.rpmFD) os.lseek(self.rpmFD, 0, 0) + + # if we don't have a valid package, throw an error + if not hdr: + raise SystemError except: self.rpmFD = -1 os.close(self.rpmFD) @@ -260,6 +264,8 @@ class InstallCallback: _("The file %s cannot be opened. This is due to " "a missing file, a bad package, or bad media. " "Press <return> to try again.") % fn) + # FIXME: get should probably be inside the loop + fn = self.method.getFilename(h, self.pkgTimer) fn = self.method.unlinkFilename(fn) return self.rpmFD @@ -271,10 +277,26 @@ class InstallCallback: os.close (self.rpmFD) self.progress.completePackage(h, self.pkgTimer) self.progress.processEvents() + elif ((what == rpm.RPMCALLBACK_UNPACK_ERROR) or + (what == rpm.RPMCALLBACK_CPIO_ERROR)): + # we may want to make this error more fine-grained at some + # point + pkg = "%s-%s-%s" % (h[rpm.RPMTAG_NAME], + h[rpm.RPMTAG_VERSION], + h[rpm.RPMTAG_RELEASE]) + self.messageWindow(_("Error Installing Package"), + _("There was an error installing %s. This " + "can indicate media failure, lack of disk " + "space, and/or hardware problems. This is " + "a fatal error and your install will be " + "aborted. Please verify your media and try "+ "your install again.\n\n" + "Press the OK button to reboot " + "your system.") % (pkg,)) + sys.exit(0) else: pass -# self.progress.processEvents() + self.progress.processEvents() def __init__(self, messageWindow, progress, pkgTimer, method, progressWindowClass, instLog, modeText): @@ -381,7 +403,7 @@ def doPreInstall(method, id, intf, instPath, dir): select(id.hdList, 'kernel-tape') else: select(id.hdList, 'kernel') - elif isys.smpAvailable(): + elif isys.smpAvailable() or isys.htavailable(): select(id.hdList, 'kernel-smp') if (id.hdList.has_key('kernel-bigmem')): @@ -456,7 +478,7 @@ def doPreInstall(method, id, intf, instPath, dir): for i in ( '/var', '/var/lib', '/var/lib/rpm', '/tmp', '/dev', '/etc', '/etc/sysconfig', '/etc/sysconfig/network-scripts', - '/etc/X11' ): + '/etc/X11', '/root' ): try: os.mkdir(instPath + i) except os.error, (errno, msg): @@ -481,6 +503,9 @@ def doInstall(method, id, intf, instPath): if flags.test: return + # set up dependency white outs + import whiteout + upgrade = id.upgrade.get() db = rpm.opendb(1, instPath) ts = rpm.TransactionSet(instPath, db) @@ -518,9 +543,9 @@ def doInstall(method, id, intf, instPath): ts.order() if upgrade: - logname = '/tmp/upgrade.log' + logname = '/root/upgrade.log' else: - logname = '/tmp/install.log' + logname = '/root/install.log' instLogName = instPath + logname try: @@ -692,9 +717,9 @@ def doPostInstall(method, id, intf, instPath): arch = iutil.getArch () if upgrade: - logname = '/tmp/upgrade.log' + logname = '/root/upgrade.log' else: - logname = '/tmp/install.log' + logname = '/root/install.log' instLogName = instPath + logname instLog = open(instLogName, "a") @@ -835,12 +860,14 @@ def copyExtraModules(instPath, comps, extraModules): kernelVersions = comps.kernelVersionList() for (path, subdir, name) in extraModules: + if not path: + path = "/modules.cgz" pattern = "" names = "" for (n, tag) in kernelVersions: pattern = pattern + " " + n + "/" + name + ".o" names = names + " " + name + ".o" - command = ("cd %s/lib/modules; gunzip < %s/modules.cgz | " + command = ("cd %s/lib/modules; gunzip < %s | " "%s/bin/cpio --quiet -iumd %s" % (instPath, path, instPath, pattern)) log("running: '%s'" % (command, )) diff --git a/product.py.in b/product.py.in new file mode 100644 index 000000000..7d6a38c21 --- /dev/null +++ b/product.py.in @@ -0,0 +1,13 @@ +# +# product.py: product identification string +# +# Copyright 2002 Red Hat, Inc. +# +# This software may be freely redistributed under the terms of the GNU +# library public license. +# +# You should have received a copy of the GNU Library Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +productName = @@PRODUCTNAME@@ @@ -15,6 +15,7 @@ import upgrade from snack import * +from constants_text import * from text import WaitWindow, OkCancelWindow from translate import _ import sys @@ -32,6 +33,14 @@ class RescueInterface: if type == "ok": ButtonChoiceWindow(self.screen, _(title), _(text), buttons = [ _("OK") ]) + elif type == "yesno": + btnlist = [TEXT_YES_BUTTON, TEXT_NO_BUTTON] + rc = ButtonChoiceWindow(self.screen, _(title), _(text), + buttons=btnlist) + if rc == "yes": + return 1 + else: + return 0 else: return OkCancelWindow(self.screen, _(title), _(text)) @@ -41,20 +50,12 @@ class RescueInterface: # XXX grub-install is stupid and uses df output to figure out # things when installing grub. make /etc/mtab be at least # moderately useful. -def makeMtab(instPath): +def makeMtab(instPath, theFsset): child = os.fork() if (not child): os.chroot(instPath) - f = open("/proc/mounts", "r") - lines = f.readlines() - f.close() f = open("/etc/mtab", "w+") - for line in lines: - # and of course we don't want to reference dev nodes in /tmp - if line[0:5] == "/tmp/": - f.write("/dev/%s" % (line[5:])) - else: - f.write(line) + f.write(theFsset.mtab()) f.close() sys.exit(0) @@ -82,6 +83,11 @@ def runRescue(instPath, mountroot, id): isys.makeDevInode(dev, "/dev/" + dev) + # need loopback devices too + for lpminor in range(8): + dev = "loop%s" % (lpminor,) + isys.makeDevInode(dev, "/dev/" + dev) + screen = SnackScreen() intf = RescueInterface(screen) @@ -92,11 +98,13 @@ def runRescue(instPath, mountroot, id): "Linux installation and mount it under the directory " "%s. You can then make any changes required to your " "system. If you want to proceed with this step choose " - "'Continue'.\n\n" + "'Continue'. You can also choose to mount your filesystems " + "read-only instead of read-write by choosing 'Read-Only'." + "\n\n" "If for some reason this process fails you can choose 'Skip' " "and this step will be skipped and you will go directly to a " "command shell.\n\n" % (instPath,)), - [_("Continue"), _("Skip")] ) + [_("Continue"), _("Read-Only"), _("Skip")] ) if rc == string.lower(_("Skip")): screen.finish() @@ -105,6 +113,10 @@ def runRescue(instPath, mountroot, id): "system will reboot.") print os.execv("/bin/sh", [ "-/bin/sh" ]) + elif rc == string.lower(_("Read-Only")): + readOnly = 1 + else: + readOnly = 0 disks = upgrade.findExistingRoots(intf, id, instPath) @@ -140,16 +152,27 @@ def runRescue(instPath, mountroot, id): if root: try: fs = fsset.FileSystemSet() - upgrade.mountRootPartition(intf, root, fs, instPath, - allowDirty = 1) - ButtonChoiceWindow(screen, _("Rescue"), - _("Your system has been mounted under %s.\n\n" - "Press <return> to get a shell. If you would like to " - "make your system the root environment, run the command:\n\n" - "\tchroot %s\n\nThe system will reboot " - "automatically when you exit from the shell." % (instPath, instPath)), - [_("OK")] ) - rootmounted = 1 + rc = upgrade.mountRootPartition(intf, root, fs, instPath, + allowDirty = 1, warnDirty = 1, + readOnly = readOnly) + + if rc == -1: + ButtonChoiceWindow(screen, _("Rescue"), + _("Your system had dirty filesystems which you chose not " + "to mount. Press return to get a shell from which " + "you can fsck and mount your partitions. The system " + "will reboot automatically when you exit from the " + "shell."), [_("OK")], width = 50) + rootmounted = 0 + else: + ButtonChoiceWindow(screen, _("Rescue"), + _("Your system has been mounted under /mnt/sysimage.\n\n" + "Press <return> to get a shell. If you would like to " + "make your system the root environment, run the command:\n\n" + "\tchroot /mnt/sysimage\n\nThe system will reboot " + "automatically when you exit from the shell."), + [_("OK")] ) + rootmounted = 1 except: # This looks horrible, but all it does is catch every exception, # and reraise those in the tuple check. This lets programming @@ -175,8 +198,8 @@ def runRescue(instPath, mountroot, id): screen.finish() print - if rootmounted: - makeMtab(instPath) + if rootmounted and not readOnly: + makeMtab(instPath, fs) print _("Your system is mounted under the %s directory." % (instPath,)) print diff --git a/scripts/genlocalelist b/scripts/genlocalelist index da9082199..b2490ee29 100755 --- a/scripts/genlocalelist +++ b/scripts/genlocalelist @@ -28,16 +28,17 @@ $defaultTerritory{"Vietnamese"} = "Vietnam"; $defaultTerritory{"Turkish"} = "Turkey"; $defaultTerritory{"Thai"} = "Thailand"; -$charMap{"GB2312"} = "iso01"; -$charMap{"BIG5"} = "iso01"; -$charMap{"EUC-JP"} = "iso01"; -$charMap{"EUC-TW"} = "iso01"; -$charMap{"EUC-KR"} = "iso01"; -$charMap{"GB2312"} = "iso01"; -$charMap{"BIG5"} = "iso01"; +$charMap{"GB2312"} = "iso15"; +$charMap{"GB18030"} = "iso15"; +$charMap{"BIG5"} = "iso15"; +$charMap{"EUC-JP"} = "iso15"; +$charMap{"EUC-TW"} = "iso15"; +$charMap{"EUC-KR"} = "iso15"; +$charMap{"GB2312"} = "iso15"; +$charMap{"BIG5"} = "iso15"; $charMap{"KOI8-U"} = "koi8-u"; $charMap{"KOI8-R"} = "koi8-u"; -$charMap{"ISO-8859-1"} = "iso01"; +$charMap{"ISO-8859-1"} = "iso15"; $charMap{"ISO-8859-2"} = "iso02"; $charMap{"ISO-8859-3"} = "iso03"; $charMap{"ISO-8859-5"} = "iso05"; @@ -51,6 +52,7 @@ $charFont{"EUC-JP"} = "lat0-sun16"; $charFont{"EUC-TW"} = "lat0-sun16"; $charFont{"EUC-KR"} = "lat0-sun16"; $charFont{"GB2312"} = "lat0-sun16"; +$charFont{"GB18030"} = "lat0-sun16"; $charFont{"BIG5"} = "lat0-sun16"; $charFont{"KOI8-U"} = "cyr-sun16"; $charFont{"KOI8-R"} = "cyr-sun16"; @@ -77,13 +79,13 @@ while (<FILE>) { $lang=$_; $lang =~ s/eucjp/eucJP/; $lang =~ s/euckr/eucKR/; + $lang =~ s/gb18030/GB18030/; $lang =~ s/^zh_CN$/zh_CN.GB2312/; $lang =~ s/^zh_TW$/zh_TW.Big5/; # someone put nb_NO in locale.alias. yuck. We don't # want to offer that. ("nb_" eq substr($lang, 0, 3)) && next; - ("zh_CN.gb18030" eq $lang) && next; ("zh_TW.euctw" eq $lang) && next; open(INFO, "LANG=$lang locale language territory charmap|"); diff --git a/scripts/mk-images b/scripts/mk-images index acf9167b1..23deaf949 100755 --- a/scripts/mk-images +++ b/scripts/mk-images @@ -1,6 +1,7 @@ #!/bin/bash PATH=$PATH:/sbin:/usr/sbin +IMAGEUUID=$(date +%Y%m%d%H%M) usage () { echo "usage: mk-images <pkgsrc> <toplevel> <template> <buildarch> <version>" @@ -411,6 +412,8 @@ EOF install -m 644 $IMGPATH/usr/share/terminfo/x/xterm $MBD_DIR/etc/terminfo/x/xterm install -m 644 $IMGPATH/usr/share/terminfo/x/xterm-color $MBD_DIR/etc/terminfo/x/xterm-color install -m 644 $IMGPATH/usr/share/terminfo/v/vt100 $MBD_DIR/etc/terminfo/v/vt100 + rm -f $MBD_DIR/.buildstamp + echo $IMAGEUUID > $MBD_DIR/.buildstamp if [ -f $LOADERBINDIR/kon.cfg ]; then mkdir -p $MBD_DIR/etc/terminfo/k @@ -639,6 +642,8 @@ makeinstimage () { cp -f $KERNELROOT/lib/modules/*/kernel/drivers/s390/*/* $KERNELROOT/lib/modules/misc fi makemoduleball $tmpdir/modules "$modlist" + rm -f $tmpdir/.buildstamp + echo $IMAGEUUID > $tmpdir/.buildstamp mkcramfs $tmpdir $INSTIMGPATH/${imagename}1.img size=$(ls -l $INSTIMGPATH/${imagename}1.img | awk '{print $5}') @@ -680,9 +685,13 @@ makemainimage () { (cd $IMGPATH; find . | fgrep -v "./usr/lib/anaconda-runtime" | cpio -H crc -o) | (cd $mmi_mntpoint; cpio -iumd) + rm -f $mmi_mntpoint/.buildstamp + echo $IMAGEUUID > $mmi_mntpoint/.buildstamp umount $mmi_mntpoint rmdir $mmi_mntpoint elif [ $type = "cramfs" ]; then + rm -f $IMGPATH/.buildstamp + echo $IMAGEUUID > $IMGPATH/.buildstamp mkcramfs $IMGPATH $mmi_tmpimage SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024) fi diff --git a/scripts/mk-images.i386 b/scripts/mk-images.i386 index 5e66a4de3..c1229ddeb 100644 --- a/scripts/mk-images.i386 +++ b/scripts/mk-images.i386 @@ -180,8 +180,25 @@ makebootdisk --kernelto $TOPDESTPATH/dosutils/autoboot/vmlinuz \ --imagename ../dosutils/autoboot/cdboot.img \ --initrd $TOPDESTPATH/dosutils/autoboot/initrd.img +makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \ + --pcmcia \ + --initrdsize 4000 \ + --loaderbin loader-pcmcia \ + --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES =scsi =net" + makemainmodules "=scsi =net $SECSTAGE" makeinstimage "netstg" "=scsi $SECSTAGE" makeinstimage "hdstg" "=net $SECSTAGE" makemainimage "stage2" "cramfs" + + +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 BOOT kernel used for the installer +initrd.img - the regular network initrd used by the bootnet images +initrd-everything.img - an initrd with support for all install methods and + drivers supported for installation of Red Hat Linux +EOF diff --git a/scripts/pkgorder b/scripts/pkgorder index 8841c0e27..2decc375c 100755 --- a/scripts/pkgorder +++ b/scripts/pkgorder @@ -6,6 +6,9 @@ import os.path import rpm import string +# set up rpm dependency whiteouts +import whiteout + rpmFD = None import comps diff --git a/scripts/splitdistro b/scripts/splitdistro index 01d0089f4..778f8e4ce 100755 --- a/scripts/splitdistro +++ b/scripts/splitdistro @@ -4,9 +4,9 @@ disc2dirs = [ "preview" ] # These files appear on all binary CDs -jointfiles = [ "COPYING", "RPM-GPG-KEY", "README", "autorun" ] +jointfiles = [ "beta_eula.txt", "RPM-GPG-KEY", "README", "autorun" ] -targetSize = 640 * 1024 * 1024 +targetSize = 640 * 1024.0 * 1024.0 # Leave about 1.2MB of space on the disc fudgeFactor = 1.2 * 1024 * 1024 @@ -40,6 +40,7 @@ def moveFiles(srcDir, destDir, files): def excessFiles(path, fileList, maxSize): total = 0 moveList = [] + found = 0 for fns in fileList: if type(fns) == types.StringType: @@ -54,6 +55,9 @@ def excessFiles(path, fileList, maxSize): total = total + size else: # once we're done, we're done + if found == 0: +# print "straw was %s" % (fns,) + found = 1 total = maxSize moveList.extend(fns) @@ -187,6 +191,7 @@ disc2pkgs = excessFiles(distDir + "/RedHat/RPMS", binPkgList, moveFiles("%s/RedHat/RPMS" % disc1Dir, "%s/RedHat/RPMS" % disc2Dir, disc2pkgs); +disc1Size = spaceUsed(disc1Dir) print "Creating disc3..." stamp(disc3Dir, releasestr, "disc3", arch, startedAt) @@ -200,7 +205,7 @@ for file in jointfiles: print "**** WARNING linking %s to %s: %s" % (src, dest, msg) disc3pkgs = excessFiles(distDir + "/RedHat/RPMS", binPkgList, - targetSize * 2 - disc1used - fudgeFactor) + targetSize + disc1Size - disc1used - fudgeFactor) moveFiles("%s/RedHat/RPMS" % disc2Dir, "%s/RedHat/RPMS" % disc3Dir, @@ -220,10 +225,11 @@ disc2pkgs = excessFiles(srcDir + "/SRPMS", srcPkgList, moveFiles("%s/SRPMS" % disc1SrcDir, "%s/SRPMS" % disc2SrcDir, disc2pkgs); +srcDisc1Size = spaceUsed(disc1SrcDir) print "Dropping remainder of sources on third disc..." disc3pkgs = excessFiles(srcDir + "/SRPMS", srcPkgList, - (targetSize - fudgeFactor) * 2) + srcDisc1Size + targetSize - fudgeFactor) moveFiles("%s/SRPMS" % disc2SrcDir, "%s/SRPMS" % disc3SrcDir, disc3pkgs) diff --git a/scripts/upd-instroot b/scripts/upd-instroot index 70959e575..b102c09fc 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -121,16 +121,17 @@ PACKAGESGR="anaconda XFree86-libs imlib libpng libtiff libjpeg XFree86-S3 XFree86-SVGA XFree86-75dpi-fonts XFree86-ISO8859-2-75dpi-fonts glib2 gtk2 XFree86-ISO8859-9-75dpi-fonts esound audiofile libgnome - XFree86-100dpi-fonts XFree86-ISO8859-2 XFree86-ISO8859-9 + XFree86-100dpi-fonts fonts-ISO8859-2 fonts-ISO8859-9 XFree86-xfs e2fsprogs fileutils glibc glibc-common rsh less ftp readline gzip popt specspo util-linux rpm rpm-devel open grep net-tools traceroute tar procps textutils sed - ncurses bash cpio mt-st iputils sh-utils XFree86-cyrillic-fonts + ncurses bash cpio mt-st iputils sh-utils XFree86 Xconfigurator gnome-python2 pygtk2 gdk-pixbuf XFree86-KOI8-R XFree86-KOI8-R-75dpi-fonts pciutils pam reiserfs-utils atk pango freetype gnome-python2-canvas libgnomecanvas libart_lgpl libzvt gnome-python2-zvt - anaconda-images anaconda-help hdparm XFree86-base-fonts" + anaconda-images anaconda-help hdparm XFree86-base-fonts + ttfonts-ko taipeifonts XFree86-ISO8859-15-75dpi-fonts" if [ -z "$NEEDGR" ]; then PACKAGESGR="bash" @@ -232,6 +233,7 @@ sbin/mkdosfs sbin/mke2fs sbin/busybox.anaconda sbin/mkfs.ext2 +sbin/mkfs.ext3 sbin/mkfs.jfs sbin/mkfs.msdos sbin/mkfs.vfat @@ -246,6 +248,7 @@ sbin/pvdisplay sbin/pvmove sbin/pvscan sbin/probe +sbin/sfdisk sbin/tune2fs sbin/vgcfgbackup sbin/vgcfgrestore @@ -466,8 +469,9 @@ usr/X11R6/lib/X11/fonts/75dpi/cour*ISO8859* usr/X11R6/lib/X11/fonts/75dpi/fonts*ISO8859* usr/X11R6/lib/X11/fonts/75dpi/helv*ISO8859* usr/X11R6/lib/X11/fonts/75dpi/tim*ISO8859* -usr/X11R6/lib/X11/fonts/cyrillic/* usr/X11R6/lib/X11/fonts/encodings/large/big5* +usr/X11R6/lib/X11/fonts/korean/gulim* +usr/X11R6/lib/X11/fonts/korean/font* usr/X11R6/lib/X11/fonts/misc/12x* usr/X11R6/lib/X11/fonts/misc/6x* usr/X11R6/lib/X11/fonts/misc/7x* @@ -476,10 +480,10 @@ usr/X11R6/lib/X11/fonts/misc/9x* usr/X11R6/lib/X11/fonts/misc/cursor* usr/X11R6/lib/X11/fonts/misc/fonts* usr/X11R6/lib/X11/fonts/misc/gb* -usr/X11R6/lib/X11/fonts/misc/hangl* usr/X11R6/lib/X11/fonts/misc/jis* usr/X11R6/lib/X11/fonts/misc/k14* usr/X11R6/lib/X11/fonts/misc/olcursor* +usr/X11R6/lib/X11/fonts/misc/taipei* usr/X11R6/lib/X11/locale/* usr/X11R6/lib/X11/rgb* usr/X11R6/lib/X11/xkb/* @@ -29,6 +29,7 @@ from language import expandLangs from log import log from flags import flags from constants_text import * +from constants import * stepToClasses = { "language" : ("language_text", "LanguageWindow"), @@ -312,7 +313,7 @@ class InstallInterface: return WaitWindow(self.screen, title, text) def drawFrame(self): - self.welcomeText = _("Red Hat Linux (C) 2001 Red Hat, Inc.") + self.welcomeText = _("%s (C) 2002 Red Hat, Inc.") % (productName,) self.screen.drawRootText (0, 0, self.welcomeText) if (os.access("/usr/share/anaconda/help/C/s1-help-screens-lang.txt", os.R_OK)): self.screen.pushHelpLine(_(" <F1> for help | <Tab> between elements | <Space> selects | <F12> next screen")) @@ -368,6 +369,9 @@ class InstallInterface: # draw the frame after setting up the fallback self.drawFrame() + # draw the frame after setting up the fallback + self.drawFrame() + id.fsset.registerMessageWindow(self.messageWindow) id.fsset.registerProgressWindow(self.progressWindow) id.fsset.registerWaitWindow(self.waitWindow) diff --git a/textw/bootdisk_text.py b/textw/bootdisk_text.py index ed0093610..c1961aebc 100644 --- a/textw/bootdisk_text.py +++ b/textw/bootdisk_text.py @@ -73,12 +73,12 @@ class MakeBootDiskWindow: return INSTALL_NOOP text = _("The boot disk allows you to boot " - "your Red Hat Linux system from a " + "your %s system from a " "floppy diskette.\n\n" "Please remove any diskettes from the " "floppy drive and insert a blank " "diskette. All data will be ERASED " - "during creation of the boot disk.") + "during creation of the boot disk.") % (productName,) if fsset.rootOnLoop(): text = text + _("\n\nA boot disk is REQUIRED to boot a " diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py index 7be4d47a0..c4a483d7f 100644 --- a/textw/bootloader_text.py +++ b/textw/bootloader_text.py @@ -214,7 +214,6 @@ class BootloaderImagesWindow: subgrid.setField(device, 1, 0, padding = (1, 0, 0, 0), anchorLeft = 1) subgrid.setField(bootLabel, 0, 1, anchorLeft = 1) subgrid.setField(newLabel, 1, 1, padding = (1, 0, 0, 0), anchorLeft = 1) - g = GridFormHelp(screen, _("Edit Boot Label Please"), "bootlabel", 1, 2) g.add(subgrid, 0, 0, padding = (0, 0, 0, 1)) g.add(buttons, 0, 1, growx = 1) @@ -306,6 +305,8 @@ class BootloaderImagesWindow: g.add(buttons, 0, 3, growx = 1) g.addHotKey("F2") # g.addHotKey(" ") + screen.pushHelpLine(_(" <Space> selects button | <F2> select default boot entry | <F12> next screen>")) + rootdev = fsset.getEntryByMountPoint("/").device.getDevice() # rootdev = "hda2" @@ -349,6 +350,7 @@ class BootloaderImagesWindow: item) listbox.setCurrent(item) + screen.popHelpLine() screen.popWindow() if (result == TEXT_BACK_CHECK): diff --git a/textw/complete_text.py b/textw/complete_text.py index 9da035d16..24f48f8e5 100644 --- a/textw/complete_text.py +++ b/textw/complete_text.py @@ -14,6 +14,7 @@ from snack import * from constants_text import * from translate import _ +from constants import * import iutil @@ -25,8 +26,8 @@ class FinishedWindow: if iutil.getArch() != "ia64": bootstr = _("If you created a boot disk to use to boot your " - "Red Hat Linux system, insert it before you " - "press <Enter> to reboot.\n\n") + "%s system, insert it before you " + "press <Enter> to reboot.\n\n") % (productName,) else: bootstr = "" @@ -40,16 +41,16 @@ class FinishedWindow: rc = ButtonChoiceWindow (screen, _("Complete"), - _("Congratulations, your Red Hat Linux installation is " + _("Congratulations, your %s installation is " "complete.\n\n" "%s" "%s" "For information on errata (updates and bug fixes), visit " "http://www.redhat.com/errata.\n\n" "Information on using your " - "system is available in the Red Hat Linux manuals at " + "system is available in the %s manuals at " "http://www.redhat.com/docs.") % - (floppystr, bootstr), + (productName, floppystr, bootstr, productName), [ _("OK") ], help = "finished", width=60) return INSTALL_OK diff --git a/textw/confirm_text.py b/textw/confirm_text.py index 7a792321e..aff5fea88 100644 --- a/textw/confirm_text.py +++ b/textw/confirm_text.py @@ -19,7 +19,7 @@ class BeginInstallWindow: def __call__ (self, screen): rc = ButtonChoiceWindow (screen, _("Installation to begin"), _("A complete log of your installation will be in " - "/tmp/install.log after rebooting your system. You " + "/root/install.log after rebooting your system. You " "may want to keep this file for later reference."), buttons = [ _("OK"), _("Back") ], help = "begininstall") @@ -31,7 +31,7 @@ class BeginUpgradeWindow: def __call__ (self, screen) : rc = ButtonChoiceWindow (screen, _("Upgrade to begin"), _("A complete log of your upgrade will be in " - "/tmp/upgrade.log after rebooting your system. You " + "/root/upgrade.log after rebooting your system. You " "may want to keep this file for later reference."), buttons = [ _("OK"), _("Back") ], help = "beginupgrade") diff --git a/textw/constants_text.py b/textw/constants_text.py index 6aa4e3114..c75af5267 100644 --- a/textw/constants_text.py +++ b/textw/constants_text.py @@ -17,28 +17,43 @@ INSTALL_OK = 0 INSTALL_BACK = -1 INSTALL_NOOP = -2 +class Translator: + """A simple class to facilitate on-the-fly translation for newt buttons""" + def __init__(self, button, check): + self.button = button + self.check = check + + def __getitem__(self, which): + if which == 0: + return _(self.button) + elif which == 1: + return self.check + raise IndexError + + def __len__(self): + return 2 + TEXT_OK_STR = N_("OK") TEXT_OK_CHECK = "ok" -TEXT_OK_BUTTON = (_(TEXT_OK_STR), TEXT_OK_CHECK) +TEXT_OK_BUTTON = Translator(TEXT_OK_STR, TEXT_OK_CHECK) TEXT_CANCEL_STR = N_("Cancel") TEXT_CANCEL_CHECK = "cancel" -TEXT_CANCEL_BUTTON = (_(TEXT_CANCEL_STR), TEXT_CANCEL_CHECK) +TEXT_CANCEL_BUTTON = Translator(TEXT_CANCEL_STR, TEXT_CANCEL_CHECK) TEXT_BACK_STR = N_("Back") TEXT_BACK_CHECK = "back" -TEXT_BACK_BUTTON = (_(TEXT_BACK_STR), TEXT_BACK_CHECK) +TEXT_BACK_BUTTON = Translator(TEXT_BACK_STR, TEXT_BACK_CHECK) TEXT_YES_STR = N_("Yes") TEXT_YES_CHECK = "yes" -TEXT_YES_BUTTON = (_(TEXT_YES_STR), TEXT_YES_CHECK) +TEXT_YES_BUTTON = Translator(TEXT_YES_STR, TEXT_YES_CHECK) TEXT_NO_STR = N_("No") TEXT_NO_CHECK = "no" -TEXT_NO_BUTTON = (_(TEXT_NO_STR), TEXT_NO_CHECK) +TEXT_NO_BUTTON = Translator(TEXT_NO_STR, TEXT_NO_CHECK) TEXT_F12_CHECK = "F12" - TRUE = 1 FALSE = 0 diff --git a/textw/firewall_text.py b/textw/firewall_text.py index 87ba83ea2..3308cf7c4 100644 --- a/textw/firewall_text.py +++ b/textw/firewall_text.py @@ -205,8 +205,9 @@ class FirewallWindow: screen.popWindow() firewall.trustdevs = [] - for dev in devicelist.getSelection(): - firewall.trustdevs.append(dev) + if devices != []: + for dev in devicelist.getSelection(): + firewall.trustdevs.append(dev) # firewall.portlist = self.other.value() firewall.dhcp = self.dhcp.selected() diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py index 70d15f033..6f9b430f5 100644 --- a/textw/keyboard_text.py +++ b/textw/keyboard_text.py @@ -43,6 +43,9 @@ class KeyboardWindow: kbd.set (keyboards[choice]) kbd.beenset = 1 + if (xconfig != (None, None)) and (xconfig != None): + apply(xconfig.setKeyboard, kbd.getXKB()) + try: isys.loadKeymap(keyboards[choice]) except SystemError, (errno, msg): diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py index 407684fda..a33bfd827 100644 --- a/textw/upgrade_text.py +++ b/textw/upgrade_text.py @@ -21,6 +21,7 @@ from fsset import * from log import log from flags import flags from translate import _ +from constants import * class UpgradeMigrateFSWindow: def __call__ (self, screen, thefsset): @@ -29,12 +30,13 @@ class UpgradeMigrateFSWindow: g = GridFormHelp(screen, _("Migrate Filesystems"), "upmigfs", 1, 4) - text = _("This release of Red Hat Linux supports " + text = _("This release of %s supports " "the ext3 journalling filesystem. It has several " "benefits over the ext2 filesystem traditionally shipped " - "in Red Hat Linux. It is possible to migrate the ext2 " + "in %s. It is possible to migrate the ext2 " "formatted partitions to ext3 without data loss.\n\n" - "Which of these partitions would you like to migrate?") + "Which of these partitions would you like to migrate?" + % (productName, productName)) tb = TextboxReflowed(60, text) g.add(tb, 0, 0, anchorLeft = 1, padding = (0, 0, 0, 1)) @@ -220,9 +222,9 @@ class UpgradeExamineWindow: (drive, fs) = root rc = ButtonChoiceWindow (screen, _("Upgrade Partition"), - _("Upgrading the Red Hat Linux " + _("Upgrading the %s " "installation on partition " - "/dev/%s") % (drive,), + "/dev/%s") % (productName, drive,), buttons = [ TEXT_OK_BUTTON, TEXT_BACK_BUTTON ]) if rc == TEXT_BACK_CHECK: diff --git a/textw/welcome_text.py b/textw/welcome_text.py index 974c74cef..3dd571880 100644 --- a/textw/welcome_text.py +++ b/textw/welcome_text.py @@ -14,19 +14,21 @@ from snack import * from constants_text import * from translate import _ +from constants import * import os class WelcomeWindow: def __call__(self, screen, configFileData): - rc = ButtonChoiceWindow(screen, _("Red Hat Linux"), - _("Welcome to Red Hat Linux!\n\n" + rc = ButtonChoiceWindow(screen, _("%s") % (productName,), + _("Welcome to %s!\n\n" "This installation process is outlined in detail in the " - "Official Red Hat Linux Installation Guide available from " + "Official %s Installation Guide available from " "Red Hat, Inc. If you have access to this manual, you " "should read the installation section before continuing.\n\n" - "If you have purchased Official Red Hat Linux, be sure to " + "If you have purchased Official %s, be sure to " "register your purchase through our web site, " - "http://www.redhat.com/."), + "http://www.redhat.com/.") + % (productName, productName, productName), buttons = [TEXT_OK_BUTTON, TEXT_BACK_BUTTON], width = 50, help = "welcome") diff --git a/textw/xconfig_text.py b/textw/xconfig_text.py index b629c4824..56c4b2a26 100644 --- a/textw/xconfig_text.py +++ b/textw/xconfig_text.py @@ -11,6 +11,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +import copy from monitor import isValidSyncRange from videocard import Videocard_blacklist from constants_text import * @@ -101,8 +102,6 @@ class XCustomWindow: depth_list = [(_("256 Colors (8 Bit)")), (_("High Color (16 Bit)")), (_("True Color (24 Bit)"))] self.bit_depth = ["8", "16", "32"] - self.res_list = ["640x480", "800x600", "1024x768", "1152x864", - "1280x1024", "1400x1050", "1600x1200"] self.available_res_by_depth = self.xconfig.availableModes() availableDepths = [] @@ -114,6 +113,19 @@ class XCustomWindow: self.available_depths = [] for i in availableDepths: self.available_depths.append(depth_list[self.bit_depth.index(i)]) + if not videocard.getSupportedModes(): + self.res_list = ["640x480", "800x600", "1024x768", "1152x864", + "1280x1024", "1400x1050", "1600x1200"] + else: + self.res_list = videocard.getSupportedModes() + + for depth in availableDepths: + tmpavail = copy.copy(self.available_res_by_depth[depth]) + for mode in self.available_res_by_depth[depth]: + if mode not in self.res_list: + tmpavail.remove(mode) + self.available_res_by_depth[depth] = tmpavail + manualmodes = self.xconfig.getManualModes() if manualmodes: self.selectedDepth = manualmodes.keys()[0] diff --git a/upgrade.py b/upgrade.py index 27fb6de1f..87d0a81f6 100644 --- a/upgrade.py +++ b/upgrade.py @@ -42,7 +42,7 @@ def findExistingRoots(intf, id, chroot): diskset.openDevices() win = intf.waitWindow(_("Searching"), - _("Searching for Red Hat Linux installations...")) + _("Searching for %s installations...") % (productName,)) rootparts = diskset.findExistingRootPartitions(intf, chroot) win.pop() @@ -50,7 +50,7 @@ def findExistingRoots(intf, id, chroot): return rootparts def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, - raiseErrors = 0): + raiseErrors = 0, warnDirty = 0, readOnly = 0): (root, rootFs) = rootInfo diskset = partedUtils.DiskSet() @@ -81,9 +81,16 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, "installation, let the filesystems be checked, and " "shut down cleanly to upgrade.")) sys.exit(0) + elif warnDirty and oldfsset.hasDirtyFilesystems(): + rc = intf.messageWindow(_("Dirty Filesystems"), + _("One or more filesystems for your Linux system " + "was not unmounted cleanly. Would you like to mount " + "them anyway?"), type = "yesno") + if rc == 0: + return -1 if flags.setupFilesystems: - oldfsset.mountFilesystems(instPath) + oldfsset.mountFilesystems(instPath, readOnly = readOnly) # XXX we should properly support 'auto' at some point if (not oldfsset.getEntryByMountPoint("/") or @@ -403,6 +410,26 @@ def upgradeFindPackages(intf, method, id, instPath, dir): pass sys.exit(0) + # during upgrade, make sure that we only install %lang colored files + # for the languages selected to be supported. + langs = '' + if os.access(instPath + "/etc/sysconfig/i18n", os.R_OK): + f = open(instPath + "/etc/sysconfig/i18n", 'r') + for line in f.readlines(): + line = string.strip(line) + parts = string.split(line, '=') + if len(parts) < 2: + continue + if string.strip(parts[0]) == 'SUPPORTED': + langs = parts[1] + if len(langs) > 0: + if langs[0] == '"' and langs[-1:] == '"': + langs = langs[1:-1] + break + del f + if langs: + rpm.addMacro("_install_langs", langs) + # check the installed system to see if the packages just # are not newer in this release. if hasX and not hasFileManager: @@ -483,6 +510,35 @@ def upgradeFindPackages(intf, method, id, instPath, dir): log(text) id.hdList["nautilus"].select() + # more hacks! we can't really have anything require rhn-applet without + # causing lots of pain (think systems that don't want rhn crap installed) + # and up2date-gnome is just in the X11 group, so KDE users without GNOME + # get it and we really don't want to change that. so, more ugprade + # hacks it is + if (id.hdList.has_key("rhn-applet") + and not id.hdList["rhn-applet"].isSelected()): + log("Upgrade: rhn-applet is not currently selected to be upgraded") + recs = None + recs2 = None + try: + recs = db.findbyname("gnome-core") + recs2 = db.findbyname("up2date-gnome") + except rpm.error: + pass + if recs and recs2: + recs = None + try: + recs = db.findbyname("rhn-applet") + except rpm.error: + pass + if not recs: + text = ("Upgrade: gnome-core and up2date-gnome are on the " + "system, but rhn-applet isn't. Selecting " + "rhn-applet to be installed") + id.upgradeDeps = "%s%s\n" % (id.upgradeDeps, text) + log(text) + id.hdList["rhn-applet"].select() + del db # new package dependency fixup diff --git a/utils/Makefile b/utils/Makefile index 378b7c09b..66693ee9a 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -33,6 +33,15 @@ moddeps: moddeps.o moduledeps.o -lmodutils -lmodutilobj -lmodutilutil \ -lpopt -lbz2 +md5.o: md5.c md5.h + gcc -c -O -g md5.c + +implantisomd5: implantisomd5.c md5.o + gcc -O -g -o implantisomd5 implantisomd5.c md5.o -lm + +checkisomd5: checkisomd5.c md5.o + gcc -O -g -o checkisomd5 -DTESTING checkisomd5.c md5.o -lm + genhdlist: genhdlist.c hash.c $(CC) $(LDFLAGS) $(CFLAGS) $(RPMCFLAGS) -o genhdlist genhdlist.c hash.c -lrpm -lrpmdb -lrpmio \ -lbz2 -lz -lpopt @@ -48,12 +57,15 @@ install: all install -m755 filtermoddeps $(DESTDIR)/$(RUNTIMEDIR) install -m755 -s modlist $(DESTDIR)/$(RUNTIMEDIR) install -m755 -s checkcards.py $(DESTDIR)/$(RUNTIMEDIR) + install -m755 -s checkisomd5 $(DESTDIR)/$(RUNTIMEDIR) + install -m755 -s implantisomd5 $(DESTDIR)/$(RUNTIMEDIR) # # removed genhdlist from clean line so it will be distributed on CDROM image # clean: rm -f modlist moddeps snarffont genhdlist mapshdr readmap *.o + rm -f implantisomd5 checkisomd5 depend: $(CPP) -M $(CFLAGS) *.c > .depend diff --git a/utils/checkisomd5.c b/utils/checkisomd5.c new file mode 100644 index 000000000..0f427164e --- /dev/null +++ b/utils/checkisomd5.c @@ -0,0 +1,184 @@ +/* simple program to check implanted md5sum in an iso 9660 image */ +/* Copyright 2001 Red Hat, Inc. */ +/* Michael Fulbright msf@redhat.com */ + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "md5.h" + + +/* number of sectors to ignore at end of iso when computing sum */ +#define SKIPSECTORS 150 + +#define APPDATA_OFFSET 883 +#define SIZE_OFFSET 84 + +#define MAX(x, y) ((x > y) ? x : y) +#define MIN(x, y) ((x < y) ? x : y) + + + +/* finds primary volume descriptor and returns info from it */ +/* mediasum must be a preallocated buffer at least 33 bytes long */ +int parsepvd(int isofd, char *mediasum, long long *isosize) { + unsigned char buf[2048]; + long long offset; + unsigned char *p; + + if (lseek(isofd, (off_t)(16L * 2048L), SEEK_SET) == -1) + return ((long long)-1); + + offset = (16L * 2048L); + for (;1;) { + read(isofd, buf, 2048); + if (buf[0] == 1) + /* found primary volume descriptor */ + break; + else if (buf[0] == 255) + /* hit end and didn't find primary volume descriptor */ + return ((long long)-1); + offset += 2048L; + } + + /* read out md5sum */ + memcpy(mediasum, buf + APPDATA_OFFSET + 13, 32); + mediasum[32] = '\0'; + + for (p=mediasum; *p; p++) + if (*p != ' ') + break; + + /* if the md5sum was all spaces, we didn't find md5sum */ + if (!*p) + return -1; + + /* get isosize */ + *isosize = (buf[SIZE_OFFSET]*0x1000000+buf[SIZE_OFFSET+1]*0x10000 + + buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL; + + return offset; +} + +/* returns -1 if no checksum encoded in media, 0 if no match, 1 if match */ +/* mediasum is the sum encoded in media, computedsum is one we compute */ +/* both strings must be pre-allocated at least 33 chars in length */ +int checkmd5sum(int isofd, char *mediasum, char *computedsum) { + int nread; + int i; + int appdata_start_offset, appdata_end_offset; + int nattempt; + unsigned int bufsize = 32768; + unsigned char md5sum[16]; + unsigned int len; + unsigned char *buf; + unsigned long tally_inc, tally; + long long isosize, offset, pvd_offset, apoff; + MD5_CTX md5ctx; + + if ((pvd_offset = parsepvd(isofd, mediasum, &isosize)) < 0) + return -1; + + /* printf("Mediasum = %s\n",mediasum); */ + + /* rewind, compute md5sum */ + lseek(isofd, 0L, SEEK_SET); + + MD5_Init(&md5ctx); + + offset = 0; + apoff = pvd_offset + APPDATA_OFFSET; + + buf = malloc(bufsize * sizeof(unsigned char)); + tally_inc = 50*1000*1000; + tally = 0; + while (offset < isosize - SKIPSECTORS*2048) { + nattempt = MIN(isosize - SKIPSECTORS*2048 - offset, bufsize); + + /* printf("%lld %lld %lld %d\n", offset, isosize, isosize-SKIPSECTORS*2048, nattempt); */ + + nread = read(isofd, buf, nattempt); + if (nread <= 0) + break; + + /* overwrite md5sum we implanted with original data */ + if (offset < apoff && offset+nread >= apoff) { + appdata_start_offset = apoff - offset; + appdata_end_offset = MIN(appdata_start_offset+MIN(nread, 512), + offset + nread - apoff); + len = appdata_end_offset - appdata_start_offset; + memset(buf+appdata_start_offset, ' ', len); + } else if (offset >= apoff && offset+nread < apoff + 512) { + appdata_start_offset = 0; + appdata_end_offset = nread; + len = appdata_end_offset - appdata_start_offset; + memset(buf+appdata_start_offset, ' ', len); + } else if (offset < apoff + 512 && offset+nread >= apoff + 512) { + appdata_start_offset = 0; + appdata_end_offset = apoff + 512 - offset; + len = appdata_end_offset - appdata_start_offset; + memset(buf+appdata_start_offset, ' ', len); + } + + MD5_Update(&md5ctx, buf, nread); + offset = offset + nread; + if (offset >= tally) { + printf("Read %5d MB\n", tally/1000/1000); + tally += tally_inc; + } + } + + sleep(1); + + free(buf); + + MD5_Final(md5sum, &md5ctx); + + *computedsum = '\0'; + for (i=0; i<16; i++) { + char tmpstr[4]; + snprintf (tmpstr, 4, "%02x", md5sum[i]); + strcat(computedsum, tmpstr); + } + + /* printf("mediasum, computedsum = %s %s\n", mediasum, computedsum); */ + + if (strcmp(mediasum, computedsum)) + return 0; + else + return 1; + } + + +int main(int argc, char **argv) { + int isofd; + int rc; + unsigned char mediasum[33], computedsum[33]; + + if (argc < 2) { + printf("Usage: checkisomd5 <isofilename>\n\n"); + exit(1); + } + + isofd = open(argv[1], O_RDONLY); + + if (isofd < 0) { + fprintf(stderr, "Error - Unable to open file %s\n\n", argv[1]); + exit(1); + } + + rc = checkmd5sum(isofd, mediasum, computedsum); + printf("%s\n%s\n", mediasum, computedsum); + if ( rc == 0) + printf("Md5sums differ.\n"); + else if (rc > 0) + printf("Md5sums match.\n"); + else + printf("No checksum information in iso, check skipped.\n"); + + close(isofd); +} + diff --git a/utils/implantisomd5.c b/utils/implantisomd5.c new file mode 100644 index 000000000..a2822495a --- /dev/null +++ b/utils/implantisomd5.c @@ -0,0 +1,182 @@ +/* simple program to insert a md5sum into application data area of */ +/* an iso9660 image */ +/* Copyright 2001 Red Hat, Inc. */ +/* Michael Fulbright msf@redhat.com */ + +#include <stdio.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include "md5.h" + +#define APPDATA_OFFSET 883 +#define SIZE_OFFSET 84 + +/* number of sectors to ignore at end of iso when computing sum */ +#define SKIPSECTORS 150 + +#define MAX(x, y) ((x > y) ? x : y) +#define MIN(x, y) ((x < y) ? x : y) + +/* finds primary volume descriptor and returns info from it */ +/* mediasum must be a preallocated buffer at least 33 bytes long */ +int parsepvd(int isofd, char *mediasum, long long *isosize) { + unsigned char buf[2048]; + long long offset; + unsigned char *p; + + if (lseek(isofd, (off_t)(16L * 2048L), SEEK_SET) == -1) + return ((long long)-1); + + offset = (16L * 2048L); + for (;1;) { + read(isofd, buf, 2048); + if (buf[0] == 1) + /* found primary volume descriptor */ + break; + else if (buf[0] == 255) + /* hit end and didn't find primary volume descriptor */ + return ((long long)-1); + offset += 2048L; + } + + /* read out md5sum */ +#if 0 + memcpy(mediasum, buf + APPDATA_OFFSET + 13, 32); + mediasum[32] = '\0'; + + for (p=mediasum; *p; p++) + if (*p != ' ') + break; + + /* if the md5sum was all spaces, we didn't find md5sum */ + if (!*p) + return -1; +#endif + + /* get isosize */ + *isosize = (buf[SIZE_OFFSET]*0x1000000+buf[SIZE_OFFSET+1]*0x10000 + + buf[SIZE_OFFSET+2]*0x100 + buf[SIZE_OFFSET+3]) * 2048LL; + + return offset; +} + + + +int main(int argc, char **argv) { + int isofd; + int nread; + int i; + int dirty; + int pvd_offset; + int forceit; + long long isosize; + unsigned char md5sum[16]; + unsigned int total; + unsigned char *fname; + unsigned char buf[2048]; + unsigned char orig_appdata[512]; + unsigned char new_appdata[512]; + unsigned char mediasum[33], computedsum[33]; + unsigned long tally_inc, tally; + char md5str[40]; + MD5_CTX md5ctx; + + if (argc < 2) { + printf("Usage: implantisomd5 [-f] <isofilename>\n\n"); + exit(1); + } + + if (!strncmp(argv[1] , "-f", 3)) { + forceit = 1; + fname = argv[2]; + } else { + forceit = 0; + fname = argv[1]; + } + + isofd = open(fname, O_RDWR); + + if (isofd < 0) { + fprintf(stderr, "Error - Unable to open file %s\n\n", fname); + exit(1); + } + + pvd_offset = parsepvd(isofd, mediasum, &isosize); + if (pvd_offset < 0) { + fprintf(stderr, "Could not find primary volumne!\n\n"); + exit(1); + } + + lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET); + nread = read(isofd, orig_appdata, 512); + + if (!forceit) { + dirty = 0; + for (i=0; i < 512; i++) + if (orig_appdata[i] != ' ') + dirty = 1; + + if (dirty) { + fprintf(stderr, "Application data has been used - not implanting md5sum!\n"); + exit(1); + } + } + + + lseek(isofd, 0L, SEEK_SET); + + MD5_Init(&md5ctx); + + total = 0; + /* read up to 15 sectors from end, due to problems reading last few */ + /* sectors on burned CDs */ + tally_inc = 50*1000*1000; + tally = 0; + while (total < isosize - SKIPSECTORS*2048) { + nread = read(isofd, buf, 2048); + if (nread <= 0) + break; + + MD5_Update(&md5ctx, buf, nread); + total = total + nread; + + if (total >= tally) { + printf("Read %5d MB\n", tally/1000/1000); + tally += tally_inc; + } + } + + MD5_Final(md5sum, &md5ctx); + + *md5str = '\0'; + for (i=0; i<16; i++) { + char tmpstr[4]; + snprintf (tmpstr, 4, "%02x", md5sum[i]); + strcat(md5str, tmpstr); + } + + printf("Inserting md5sum into iso image...\n"); + printf("md5 = %s\n", md5str); + /* memcpy(new_appdata, orig_appdata, 512); */ + memset(new_appdata, ' ', 512); + memcpy(new_appdata, "ISO MD5SUM = ", 13); + memcpy(new_appdata+13, md5str, 33); + memcpy(new_appdata+47, "THIS IS NOT THE SAME AS RUNNING MD5SUM ON THIS ISO!!", 51); + + i = lseek(isofd, pvd_offset + APPDATA_OFFSET, SEEK_SET); + if (i<0) + printf("seek failed\n"); + + i = write(isofd, new_appdata, 512); + if (i<0) { + printf("write failed %d\n", i); + perror(""); + } + + close(isofd); + + printf("Done!\n"); +} diff --git a/utils/md5.c b/utils/md5.c new file mode 100644 index 000000000..fe032ebba --- /dev/null +++ b/utils/md5.c @@ -0,0 +1,256 @@ +/* + * $Id$ + * + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to MD5Init, call MD5Update as + * needed on buffers full of bytes, and then call MD5Final, which + * will fill a supplied 16-byte array with the digest. + * + */ + +#include <string.h> +#include "md5.h" + +#ifndef HIGHFIRST +#define byteReverse(buf, len) /* Nothing */ +#else +static void byteReverse(unsigned char *buf, unsigned longs); + +#ifndef ASM_MD5 +/* + * Note: this code is harmless on little-endian machines. + */ +static void byteReverse(unsigned char *buf, unsigned longs) +{ + uint32 t; + do { + t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 | + ((unsigned) buf[1] << 8 | buf[0]); + *(uint32 *) buf = t; + buf += 4; + } while (--longs); +} +#endif +#endif + +/* + * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious + * initialization constants. + */ +void MD5_Init(struct MD5Context *ctx) +{ + ctx->buf[0] = 0x67452301U; + ctx->buf[1] = 0xefcdab89U; + ctx->buf[2] = 0x98badcfeU; + ctx->buf[3] = 0x10325476U; + + ctx->bits[0] = 0; + ctx->bits[1] = 0; +} + +/* + * Update context to reflect the concatenation of another buffer full + * of bytes. + */ +void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len) +{ + uint32 t; + + /* Update bitcount */ + + t = ctx->bits[0]; + if ((ctx->bits[0] = t + ((uint32) len << 3)) < t) + ctx->bits[1]++; /* Carry from low to high */ + ctx->bits[1] += len >> 29; + + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ + + /* Handle any leading odd-sized chunks */ + + if (t) { + unsigned char *p = (unsigned char *) ctx->in + t; + + t = 64 - t; + if (len < t) { + memcpy(p, buf, len); + return; + } + memcpy(p, buf, t); + byteReverse(ctx->in, 16); + MD5_Transform(ctx->buf, (uint32 *) ctx->in); + buf += t; + len -= t; + } + /* Process data in 64-byte chunks */ + + while (len >= 64) { + memcpy(ctx->in, buf, 64); + byteReverse(ctx->in, 16); + MD5_Transform(ctx->buf, (uint32 *) ctx->in); + buf += 64; + len -= 64; + } + + /* Handle any remaining bytes of data. */ + + memcpy(ctx->in, buf, len); +} + +/* + * Final wrapup - pad to 64-byte boundary with the bit pattern + * 1 0* (64-bit count of bits processed, MSB-first) + */ +void MD5_Final(unsigned char digest[16], struct MD5Context *ctx) +{ + unsigned count; + unsigned char *p; + + /* Compute number of bytes mod 64 */ + count = (ctx->bits[0] >> 3) & 0x3F; + + /* Set the first char of padding to 0x80. This is safe since there is + always at least one byte free */ + p = ctx->in + count; + *p++ = 0x80; + + /* Bytes of padding needed to make 64 bytes */ + count = 64 - 1 - count; + + /* Pad out to 56 mod 64 */ + if (count < 8) { + /* Two lots of padding: Pad the first block to 64 bytes */ + memset(p, 0, count); + byteReverse(ctx->in, 16); + MD5_Transform(ctx->buf, (uint32 *) ctx->in); + + /* Now fill the next block with 56 bytes */ + memset(ctx->in, 0, 56); + } else { + /* Pad block to 56 bytes */ + memset(p, 0, count - 8); + } + byteReverse(ctx->in, 14); + + /* Append length in bits and transform */ + ((uint32 *) ctx->in)[14] = ctx->bits[0]; + ((uint32 *) ctx->in)[15] = ctx->bits[1]; + + MD5_Transform(ctx->buf, (uint32 *) ctx->in); + byteReverse((unsigned char *) ctx->buf, 4); + memcpy(digest, ctx->buf, 16); + memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ +} + +#ifndef ASM_MD5 + +/* The four core functions - F1 is optimized somewhat */ + +/* #define F1(x, y, z) (x & y | ~x & z) */ +#define F1(x, y, z) (z ^ (x & (y ^ z))) +#define F2(x, y, z) F1(z, x, y) +#define F3(x, y, z) (x ^ y ^ z) +#define F4(x, y, z) (y ^ (x | ~z)) + +/* This is the central step in the MD5 algorithm. */ +#define MD5STEP(f, w, x, y, z, data, s) \ + ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) + +/* + * The core of the MD5 algorithm, this alters an existing MD5 hash to + * reflect the addition of 16 longwords of new data. MD5Update blocks + * the data and converts bytes into longwords for this routine. + */ +void MD5_Transform(uint32 buf[4], uint32 const in[16]) +{ + register uint32 a, b, c, d; + + a = buf[0]; + b = buf[1]; + c = buf[2]; + d = buf[3]; + + MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478U, 7); + MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756U, 12); + MD5STEP(F1, c, d, a, b, in[2] + 0x242070dbU, 17); + MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceeeU, 22); + MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0fafU, 7); + MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62aU, 12); + MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613U, 17); + MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501U, 22); + MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8U, 7); + MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7afU, 12); + MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1U, 17); + MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7beU, 22); + MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122U, 7); + MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193U, 12); + MD5STEP(F1, c, d, a, b, in[14] + 0xa679438eU, 17); + MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821U, 22); + + MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562U, 5); + MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340U, 9); + MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51U, 14); + MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aaU, 20); + MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105dU, 5); + MD5STEP(F2, d, a, b, c, in[10] + 0x02441453U, 9); + MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681U, 14); + MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8U, 20); + MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6U, 5); + MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6U, 9); + MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87U, 14); + MD5STEP(F2, b, c, d, a, in[8] + 0x455a14edU, 20); + MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905U, 5); + MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8U, 9); + MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9U, 14); + MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8aU, 20); + + MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942U, 4); + MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681U, 11); + MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122U, 16); + MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380cU, 23); + MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44U, 4); + MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9U, 11); + MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60U, 16); + MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70U, 23); + MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6U, 4); + MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127faU, 11); + MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085U, 16); + MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05U, 23); + MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039U, 4); + MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5U, 11); + MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8U, 16); + MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665U, 23); + + MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244U, 6); + MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97U, 10); + MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7U, 15); + MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039U, 21); + MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3U, 6); + MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92U, 10); + MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47dU, 15); + MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1U, 21); + MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4fU, 6); + MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0U, 10); + MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314U, 15); + MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1U, 21); + MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82U, 6); + MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235U, 10); + MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bbU, 15); + MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391U, 21); + + buf[0] += a; + buf[1] += b; + buf[2] += c; + buf[3] += d; +} + +#endif diff --git a/utils/md5.h b/utils/md5.h new file mode 100644 index 000000000..bacfb534a --- /dev/null +++ b/utils/md5.h @@ -0,0 +1,25 @@ + +#ifndef MD5_H +#define MD5_H + +#include <sys/types.h> + +typedef u_int32_t uint32; + +struct MD5Context { + uint32 buf[4]; + uint32 bits[2]; + unsigned char in[64]; +}; + +void MD5_Init(struct MD5Context *); +void MD5_Update(struct MD5Context *, unsigned const char *, unsigned); +void MD5_Final(unsigned char digest[16], struct MD5Context *); + +/* + * This is needed to make RSAREF happy on some MS-DOS compilers. + */ + +typedef struct MD5Context MD5_CTX; + +#endif /* MD5_H */ diff --git a/whiteout.py b/whiteout.py new file mode 100644 index 000000000..7b6cefaad --- /dev/null +++ b/whiteout.py @@ -0,0 +1,29 @@ +# +# whiteout.py - dependency whiteout setup +# +# Copyright 2002 Red Hat, Inc. +# + +import rpm + +whiteout=""" + pango-gtkbeta-devel>pango-gtkbeta\ + XFree86>Mesa \ + compat-glibc>db2 \ + compat-glibc>db1 \ + pam>initscripts \ + initscripts>sysklogd \ + arts>kdelibs-sound \ + libgnomeprint15>gnome-print \ + nautilus>nautilus-mozilla \ + tcl>postgresql-tcl \ + libtermcap>bash \ + modutils>vixie-cron \ + ypbind>yp-tools \ + ghostscript-fonts>ghostscript \ + usermode>util-linux \ + control-center>xscreensaver \ + kdemultimedia-arts>kdemultimedia-libs +""" + +rpm.addMacro("_dependency_whiteout", whiteout) |