summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-04-24 15:46:31 +0000
committerJeremy Katz <katzj@redhat.com>2003-04-24 15:46:31 +0000
commit0a562126d84c59a113231ae7ab38984f92d62153 (patch)
tree5e87b9094f4ebdc328979e3a0640dee5f1fc40cb
parentdd200d781bd9012f562399c2ee69c23fe60d86b9 (diff)
downloadanaconda-0a562126d84c59a113231ae7ab38984f92d62153.tar.gz
anaconda-0a562126d84c59a113231ae7ab38984f92d62153.tar.xz
anaconda-0a562126d84c59a113231ae7ab38984f92d62153.zip
another taroon merge. tagged before as before-taroon-merge, after as
after-taroon-merge this one adds s390 fixes, basic i/p series platform support, support for multiple kernels and one second stage, cmdline kickstart mode (nice for s390), some warning cleanups.
-rwxr-xr-xanaconda156
-rw-r--r--anaconda_log.py2
-rw-r--r--autopart.py54
-rw-r--r--bootloader.py5
-rw-r--r--cmdline.py160
-rw-r--r--comps.py12
-rw-r--r--fsset.py209
-rw-r--r--installclass.py30
-rw-r--r--instdata.py15
-rw-r--r--isys/Makefile2
-rw-r--r--isys/cpio.c1
-rw-r--r--isys/devnodes.c26
-rw-r--r--isys/isys.c10
-rw-r--r--isys/isys.py7
-rw-r--r--isys/probe.c76
-rw-r--r--isys/probe.h7
-rw-r--r--isys/smp.c3
-rw-r--r--isys/stubs.h1
-rw-r--r--isys/vio.c174
-rw-r--r--iutil.py11
-rw-r--r--iw/account_gui.py44
-rw-r--r--iw/bootloader_main_gui.py3
-rw-r--r--iw/congrats_gui.py14
-rw-r--r--iw/installpath_gui.py8
-rw-r--r--iw/partition_dialog_gui.py7
-rw-r--r--keymaps/Makefile3
-rw-r--r--kickstart.py9
-rw-r--r--loader2/.cvsignore1
-rw-r--r--loader2/Makefile21
-rw-r--r--loader2/devt.h32
-rw-r--r--loader2/driverdisk.c1
-rw-r--r--loader2/driverdisk.h1
-rw-r--r--loader2/hardware.c15
-rw-r--r--loader2/hdinstall.c11
-rw-r--r--loader2/init.c248
-rw-r--r--loader2/kickstart.c9
-rw-r--r--loader2/kickstart.h3
-rw-r--r--loader2/linuxrc.s390187
-rw-r--r--loader2/loader.c52
-rw-r--r--loader2/loader.h8
-rw-r--r--loader2/loadermisc.h2
-rw-r--r--loader2/log.h2
-rw-r--r--loader2/method.c24
-rw-r--r--loader2/module-info24
-rw-r--r--loader2/modules.c4
-rw-r--r--loader2/net.c74
-rw-r--r--loader2/nfsinstall.c5
-rw-r--r--loader2/shutdown.c108
-rw-r--r--loader2/undomounts.c228
-rw-r--r--loader2/urlinstall.c5
-rw-r--r--loader2/usb.c1
-rw-r--r--packages.py19
-rw-r--r--partRequests.py4
-rw-r--r--partedUtils.py31
-rw-r--r--partitioning.py4
-rw-r--r--partitions.py16
-rwxr-xr-xscripts/mk-images84
-rw-r--r--scripts/mk-images.alpha76
-rw-r--r--scripts/mk-images.i386132
-rw-r--r--scripts/mk-images.ia6430
-rw-r--r--scripts/mk-images.ppc77
-rw-r--r--scripts/mk-images.s390122
-rw-r--r--scripts/mk-images.sparc6464
-rw-r--r--scripts/mk-images.x86_6464
-rwxr-xr-xscripts/upd-instroot46
-rw-r--r--syslogd.py5
-rw-r--r--text.py9
-rw-r--r--textw/bootloader_text.py3
-rw-r--r--textw/complete_text.py17
-rw-r--r--textw/partition_text.py6
-rw-r--r--urlinstall.py34
71 files changed, 2020 insertions, 938 deletions
diff --git a/anaconda b/anaconda
index c83e2b207..488b3e0ce 100755
--- a/anaconda
+++ b/anaconda
@@ -42,7 +42,14 @@ def dup_log(format, *args):
def startMiniWM(root='/'):
childpid = os.fork()
if not childpid:
- args = [root + '/usr/bin/mini-wm', '--display', ':1']
+ if os.access("./mini-wm", os.X_OK):
+ cmd = "./mini-wm"
+ elif os.access(root + "/usr/bin/mini-wm", os.X_OK):
+ cmd = root + "/usr/bin/mini-wm"
+ else:
+ return None
+
+ args = [cmd, '--display', ':1']
os.execv(args[0], args)
sys.exit (1)
@@ -125,6 +132,82 @@ def startVNCServer(vncpassword=None, root='/'):
doStartupX11Actions()
+# startup vnc X server
+def startVNCServer(vncpassword=None, root='/'):
+
+ def set_vnc_password(root, passwd, passwd_file):
+ (pid, fd) = os.forkpty()
+
+ if not pid:
+ os.execv(root + "/usr/bin/vncpasswd", [root + "/usr/bin/vncpasswd", passwd_file])
+ sys.exit(1)
+
+ # read password prompt
+ os.read(fd, 1000)
+
+ # write password
+ os.write(fd, passwd + "\n")
+
+ # read challenge again, and newline
+ os.read(fd, 1000)
+ os.read(fd, 1000)
+
+ # write password again
+ os.write(fd, passwd + "\n")
+
+ # read remaining output
+ os.read(fd, 1000)
+
+ # wait for status
+ try:
+ (pid, status) = os.waitpid(pid, 0)
+ except OSError, (errno, msg):
+ print __name__, "waitpid:", msg
+
+ return status
+
+ dup_log(_("Starting VNC..."))
+
+ vncpid = os.fork()
+
+ if not vncpid:
+ args = [ root + "/usr/bin/Xvnc", ":1", "-nevershared",
+ "-depth", "16", "-geometry", "800x600" "-dontdisconnect"]
+
+ # set passwd if necessary
+ if vncpassword is not None:
+ rc = set_vnc_password(root, vncpassword, "/tmp/vncpasswd_file")
+ if rc:
+ dup_log(_("Unable to set vnc password - using no password!"))
+ dup_log(_("Make sure your password is at least 6 characters in length."))
+ else:
+ args = args + ["-rfbauth", "/tmp/vncpasswd_file"]
+
+ tmplogFile = "/tmp/vncserver.log"
+ try:
+ err = os.open(tmplogFile, os.O_RDWR | os.O_CREAT)
+ if err < 0:
+ sys.stderr.write("error opening %s\n", tmplogFile)
+ else:
+ os.dup2(err, 2)
+ os.close(err)
+ except:
+ # oh well
+ pass
+
+ os.execv(args[0], args)
+ sys.exit (1)
+
+ if vncpassword is None:
+ dup_log(_("\n\nWARNING!!! VNC server running with NO PASSWORD!"))
+ dup_log(_("You can use the vncpasswd=<password> boot option"))
+ dup_log(_("if you would like to secure the server.\n\n"))
+
+ dup_log(_("VNC server now running - please connect to install..."))
+
+ os.environ["DISPLAY"]=":1"
+ doStartupX11Actions()
+
# function to handle X startup special issues for anaconda
def doStartupX11Actions():
global miniwm_pid
@@ -249,13 +332,14 @@ if os.environ.has_key("LD_PRELOAD"):
del os.environ["LD_PRELOAD"]
try:
- (args, extra) = isys.getopt(theargs, 'GTRxtdr:fm:',
+ (args, extra) = isys.getopt(theargs, 'CGTRxtdr:fm:',
[ 'graphical', 'text', 'test', 'debug', 'nofallback',
'method=', 'rootpath=', 'pcic=', "overhead=",
'testpath=', 'mountfs', 'traceonly', 'kickstart=',
'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=',
'expert', 'serial', 'lowres', 'nofb', 'rescue', 'nomount',
- 'autostep', 'resolution=', 'skipddc', 'vnc'])
+ 'autostep', 'resolution=', 'skipddc', 'vnc', 'cmdline',
+ 'headless'])
except TypeError, msg:
sys.stderr.write("Error %s\n:" % msg)
sys.exit(-1)
@@ -293,11 +377,11 @@ display_mode = None
# should we ever try to probe for X stuff? this will give us a convenient
# out eventually to circumvent all probing and just fall back to text mode
# on hardware where we break things if we probe
-doXProbe = 1
+isHeadless = 0
# probing for hardware on an s390 seems silly...
if iutil.getArch() == "s390":
- doXProbe = 0
+ isHeadless = 1
#
# xcfg - xserver info (?)
@@ -377,7 +461,6 @@ for n in args:
elif (str == '--traceonly'):
traceOnly = 1
elif (str == '--serial'):
- logFile = "/tmp/install.log"
flags.serial = 1
elif (str == '-t' or str == '--test'):
flags.test = 1
@@ -385,8 +468,12 @@ for n in args:
logFile = "/tmp/anaconda-debug.log"
elif (str == '-T' or str == '--text'):
display_mode = 't'
+ elif (str == "-C" or str == "--cmdline"):
+ display_mode = 'c'
elif (str == '--kbdtype'):
kbdtype = arg
+ elif (str == '--headless'):
+ isHeadless = 1
elif (str == '--vnc'):
flags.usevnc = 1
@@ -401,11 +488,6 @@ for n in args:
pass
-# s390s don't have ttys
-if iutil.getArch() == "s390":
- logFile = "/tmp/anaconda-s390.log"
- #display_mode = 't'
-
#
# must specify install, rescue mode
#
@@ -490,7 +572,7 @@ import isys
import instdata
import floppy
-if doXProbe:
+if not isHeadless:
import xsetup
import rhpl.xhwstate as xhwstate
import rhpl.keyboard as keyboard
@@ -602,7 +684,7 @@ if os.environ.has_key('DISPLAY') and display_mode == 'g':
else:
x_already_set = 0
-if doXProbe:
+if not isHeadless:
#
# Probe what is available for X and setup a hardware state
#
@@ -613,13 +695,21 @@ if doXProbe:
(videohw, monitorhw, mousehw) = xserver.probeHW(skipDDCProbe=skipddcprobe,
skipMouseProbe = skipmouseprobe)
-
- # setup a X hw state for use later with configuration.
- try:
- xcfg = xhwstate.XF86HardwareState(defcard=videohw, defmon=monitorhw)
- except Exception, e:
- print _("Unable to instantiate a X hardware state object.")
- xcfg = None
+ # if the len(videocards) is zero, then let's assume we're isHeadless
+ if len(videohw.videocards) == 0:
+ print _("No video hardware found, assuming headless")
+ videohw = None
+ monitorhw = None
+ mousehw = None
+ isHeadless = 1
+ else:
+ # setup a X hw state for use later with configuration.
+ try:
+ xcfg = xhwstate.XF86HardwareState(defcard=videohw,
+ defmon=monitorhw)
+ except Exception, e:
+ print _("Unable to instantiate a X hardware state object.")
+ xcfg = None
else:
videohw = None
monitorhw = None
@@ -647,10 +737,10 @@ if not flags.test and not os.access("/mnt/runtime/usr/X11R6/bin/XFree86", os.X_O
time.sleep(2)
display_mode = 't'
-if doXProbe:
+if not isHeadless:
# if no mouse we force text mode
mousedev = mousehw.get()
- if display_mode != 't' and mousedev[0] == "No - mouse":
+ if display_mode == 'g' and mousedev[0] == "No - mouse":
# ask for the mouse type
import rhpl.mouse as mouse
@@ -661,8 +751,9 @@ if doXProbe:
time.sleep(2)
else:
dup_log(_("Using mouse type: %s"), mousehw.shortDescription())
-else: # s390 checks
- if display_mode == 'g' and not os.environ.has_key('DISPLAY'):
+else: # s390/iSeries checks
+ if display_mode == 'g' and not (os.environ.has_key('DISPLAY') or
+ flags.usevnc):
dup_log("DISPLAY variable not set. Starting text mode!")
display_mode = 't'
time.sleep(2)
@@ -736,9 +827,11 @@ for i in ( "services", "protocol", "nsswitch.conf", "joe"):
#
if (display_mode == 'g'):
if not flags.test and flags.setupFilesystems:
- for i in ( "imrc", "im_palette.pal", "gtk-2.0", "pango", "fonts"):
+ for i in ( "imrc", "im_palette.pal", "gtk-2.0", "pango", "fonts",
+ "fb.modes"):
try:
- os.symlink ("../mnt/runtime/etc/" + i, "/etc/" + i)
+ if os.path.exists("/mnt/runtime/etc/%s" %(i,)):
+ os.symlink ("../mnt/runtime/etc/" + i, "/etc/" + i)
except:
pass
@@ -768,7 +861,9 @@ if (display_mode == 'g'):
if (display_mode == 't'):
from text import InstallInterface
- from text import stepToClasses
+
+if (display_mode == 'c'):
+ from cmdline import InstallInterface
# go ahead and set up the interface
@@ -843,7 +938,7 @@ if monitorhw:
#
# not sure what to do here - somehow we didnt detect anything
#
-if xcfg is None and doXProbe:
+if xcfg is None and not isHeadless:
try:
xcfg = xhwstate.XF86HardwareState()
except Exception, e:
@@ -869,6 +964,11 @@ if keymap:
dispatch.skipStep("keyboard", permanent = 1)
instClass.setKeyboard(id, keymap)
+# set up the headless case
+if isHeadless == 1:
+ id.setHeadless(isHeadless)
+ instClass.setAsHeadless(dispatch, isHeadless)
+
instClass.setSteps(dispatch)
# We shouldn't need this again
diff --git a/anaconda_log.py b/anaconda_log.py
index 13f4434ed..7f2d12636 100644
--- a/anaconda_log.py
+++ b/anaconda_log.py
@@ -51,7 +51,7 @@ class Anaconda_LogFile:
self.logFile2 = None
def __call__ (self, format, *args):
- if not self.logFile:
+ if not self.logFile and not self.logFile2:
raise RuntimeError, "log file not open yet"
for file in [self.logFile, self.logFile2]:
diff --git a/autopart.py b/autopart.py
index e3a7e8182..1cafef1a4 100644
--- a/autopart.py
+++ b/autopart.py
@@ -35,6 +35,7 @@ BOOT_ABOVE_1024 = -1
BOOTEFI_NOT_VFAT = -2
BOOTALPHA_NOT_BSD = -3
BOOTALPHA_NO_RESERVED_SPACE = -4
+BOOTPSERIES_NOT_PREP = -5
DEBUG_LVM_GROW = 0
@@ -59,6 +60,12 @@ def bootRequestCheck(requests, diskset):
return BOOT_ABOVE_1024
elif iutil.getArch() == "alpha":
return bootAlphaCheckRequirements(part, diskset)
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ # FIXME: does this also have to be at the beginning of the disk
+## if part.native_type != 0x41:
+## return BOOTPSERIES_NOT_PREP
+ log("FIXME: unable to check suitability of boot partition on pseries right now")
return PARTITION_SUCCESS
@@ -985,6 +992,8 @@ def doPartitioning(diskset, requests, doRefresh = 1):
raise PartitioningWarning, _("Boot partition %s doesn't belong to a disk with enough free space at its beginning for the bootloader to live on. Make sure that there's at least 5MB of free space at the beginning of the disk that contains /boot") %(requests.getBootableRequest().mountpoint)
elif ret == BOOTEFI_NOT_VFAT:
raise PartitioningError, _("Boot partition %s isn't a VFAT partition. EFI won't be able to boot from this partition.") %(requests.getBootableRequest().mountpoint,)
+ elif ret == BOOTPSERIES_NOT_PREP:
+ raise PartitioningError, _("Boot partition %s isn't a PPC PReP boot partition. OpenFirmware won't be able to boot from this partition.") %(requests.getBootableRequest().mountpoint,)
elif ret != PARTITION_SUCCESS:
# more specific message?
raise PartitioningWarning, _("Boot partition %s may not meet booting constraints for your architecture. Creation of a boot disk is highly encouraged.") %(requests.getBootableRequest().mountpoint)
@@ -1093,7 +1102,25 @@ def doClearPartAction(partitions, diskset):
break
if request:
partitions.autoPartitionRequests.remove(request)
-
+ # hey, what do you know, pseries is weird too. *grumble*
+ elif (((iutil.getPPCMachine() == "pSeries") or
+ (iutil.getPPCMachine() == "iSeries"))
+ and (linuxOnly == 1)
+ and (not partitions.isKickstart) and
+ part.is_flag_available(parted.PARTITION_BOOT) and
+ (part.native_type == 0x41) and
+ part.get_flag(parted.PARTITION_BOOT)):
+ req = partitions.getRequestByDeviceName(partedUtils.get_partition_name(part))
+ req.mountpoint = None
+ req.format = 0
+ request = None
+ for req in partitions.autoPartitionRequests:
+ if req.fstype == fsset.fileSystemTypeGet("PPC PReP Boot"):
+ request = req
+ break
+ if request:
+ partitions.autoPartitionRequests.remove(request)
+
part = disk.next_partition(part)
# set the diskset up
@@ -1381,6 +1408,9 @@ def getAutopartitionBoot():
"""Return the proper shorthand for the boot dir (arch dependent)."""
if iutil.getArch() == "ia64":
return ("/boot/efi", "vfat", 100, None, 0, 1)
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ return(None, "PPC PReP Boot", 8, None, 0, 1)
else:
return ("/boot", None, 100, None, 0, 1)
@@ -1402,15 +1432,21 @@ def queryAutoPartitionOK(intf, diskset, partitions):
drives = diskset.disks.keys()
drives.sort()
- i = 0
+ width = 44
+ str = ""
+ maxlen = 0
for drive in drives:
- drvstr = drvstr + "%-10s" % ("/dev/"+drive)
-# i = i + 1
-# if i > 3:
-# drvstr = drvstr + "\n "
-# i = 0
-
- drvstr = drvstr +"\n"
+ if (len(drive) > maxlen):
+ maxlen = len(drive)
+ maxlen = maxlen + 8 # 5 for /dev/, 3 for spaces
+ for drive in drives:
+ if (len(str) + maxlen <= width):
+ str = str + "%-*s" % (maxlen, "/dev/"+drive)
+ else:
+ drvstr = drvstr + str + "\n"
+ str = ""
+ str = "%-*s" % (maxlen, "/dev/"+drive)
+ drvstr = drvstr + str + "\n"
rc = intf.messageWindow(_("Warning"), _(msg) % drvstr, type="yesno", default="no", custom_icon ="warning")
diff --git a/bootloader.py b/bootloader.py
index aaa45a285..b9eea2b8e 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -54,6 +54,11 @@ def bootloaderSetupChoices(dispatch, bl, fsset, diskSet, dir):
log("MBR not suitable as boot device; installing to partition")
bl.defaultDevice = "boot"
bl.setDevice(choices[bl.defaultDevice][0])
+ elif choices and choices.has_key("mbr"):
+ bl.setDevice(choices["mbr"][0])
+ elif choices and choices.has_key("boot"):
+ bl.setDevice(choices["boot"][0])
+
bootDev = fsset.getEntryByMountPoint("/")
if not bootDev:
diff --git a/cmdline.py b/cmdline.py
new file mode 100644
index 000000000..ba9e7de32
--- /dev/null
+++ b/cmdline.py
@@ -0,0 +1,160 @@
+#
+# cmdline.py - non-interactive, very very simple frontend to anaconda
+#
+# Jeremy Katz <katzj@redhat.com
+#
+# Copyright 2003 Red Hat, Inc.
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+import sys, os
+import isys, iutil
+import time
+import signal
+import parted, rpm
+from constants import *
+from flags import flags
+
+from rhpl.log import log
+from rhpl.translate import _, cat, N_
+
+stepToClasses = { "install" : "setupProgressDisplay" }
+
+class WaitWindow:
+ def pop(self):
+ pass
+
+ def __init__(self, title, text):
+ print text
+
+class ProgressWindow:
+ def pop(self):
+ print ""
+
+ def set(self, amount):
+ if amount == self.total:
+ print _("Completed"),
+
+ def __init__(self, title, text, total):
+ self.total = total
+ print text
+ print _("In progress... "),
+
+class InstallInterface:
+ def __init__(self):
+# signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGTSTP, signal.SIG_DFL)
+
+ def __del__(self):
+ pass
+
+ def shutdown(self):
+ pass
+
+ def progressWindow(self, title, text, total):
+ return ProgressWindow(title, text, total)
+
+ def messageWindow(self, title, text, type="ok", default = None,
+ custom_icon = None, custom_buttons = []):
+ if type == "ok":
+ print text
+ else:
+ print _("Can't have a question in command line mode!")
+ print title
+ print text
+ print type, custom_buttons
+
+ # don't exit
+ while 1:
+ time.sleep(5)
+
+ def exceptionWindow(self, title, text):
+ print text
+
+ def partedExceptionWindow(self, exc):
+ # if our only option is to cancel, let us handle the exception
+ # in our code and avoid popping up the exception window here.
+ if exc.options == parted.EXCEPTION_CANCEL:
+ return parted.EXCEPTION_UNHANDLED
+
+ print _("Parted exceptions can't be handled in command line mode!")
+ print exc.message
+
+ # don't exit
+ while 1:
+ time.sleep(5)
+
+ def waitWindow(self, title, text):
+ return WaitWindow(title, text)
+
+ def run(self, id, dispatch, configFileData):
+ self.configFileData = configFileData
+
+ id.fsset.registerMessageWindow(self.messageWindow)
+ id.fsset.registerProgressWindow(self.progressWindow)
+ id.fsset.registerWaitWindow(self.waitWindow)
+ parted.exception_set_handler(self.partedExceptionWindow)
+
+ (step, args) = dispatch.currentStep()
+ while step:
+ if stepToClasses.has_key(step):
+ s = "nextWin = %s" %(stepToClasses[step],)
+ exec s
+
+ apply(nextWin, args)
+ else:
+ print "In interactive step %s, can't continue" %(step,)
+ while 1:
+ time.sleep(1)
+
+ dispatch.gotoNext()
+ (step, args) = dispatch.currentStep()
+
+
+class progressDisplay:
+ def __init__(self):
+ pass
+
+ def __del__(self):
+ pass
+
+ def completePackage(self, hdr, timer):
+ self.numComplete = self.numComplete + 1
+ self.sizeComplete = self.sizeComplete + (hdr[rpm.RPMTAG_SIZE] / 1024)
+
+ print _("Done [%d/%d]" %(self.numComplete, self.total))
+
+ def setPackageScale(self, amount, total):
+ pass
+
+ def setPackage(self, hdr):
+ print _("Installing %s-%s-%s... ") %(hdr[rpm.RPMTAG_NAME],
+ hdr[rpm.RPMTAG_VERSION],
+ hdr[rpm.RPMTAG_RELEASE]),
+
+ def processEvents(self):
+ pass
+
+ def setSizes(self, total, totalSize):
+ self.total = total
+ self.totalSize = totalSize
+ self.numComplete = 0
+ self.sizeComplete = 0
+
+
+def setupProgressDisplay(dir, intf, id):
+ if dir == DISPATCH_BACK:
+ id.setInstallProgressClass(None)
+ return DISPATCH_BACK
+ else:
+ id.setInstallProgressClass(progressDisplay())
+
+ return DISPATCH_FORWARD
+
+
diff --git a/comps.py b/comps.py
index 120b5cddf..4b172ed56 100644
--- a/comps.py
+++ b/comps.py
@@ -201,6 +201,14 @@ class HeaderList:
self.hasFullHeaders = 0
for h in hdlist:
name = h[rpm.RPMTAG_NAME]
+
+ # we should only keep kernel-pseries and kernel-iseries on
+ # the appropriate machine
+ if name == "kernel-pseries" and iutil.getPPCMachine() != "pSeries":
+ continue
+ if name == "kernel-iseries" and iutil.getPPCMachine() != "iSeries":
+ continue
+
if noscore:
self.packages[name] = Package(h)
continue
@@ -990,7 +998,9 @@ class ComponentSet:
for (ktag, nick) in [ ('kernel-summit', 'summit'),
('kernel-bigmem', 'bigmem'),
('kernel-smp', 'smp'),
- ('kernel-tape', 'tape') ]:
+ ('kernel-tape', 'tape'),
+ ('kernel-pseries', ''),
+ ('kernel-iseries', '') ]:
tag = split(ktag, '-')[1]
if (self.packages.has_key(ktag) and
self.packages[ktag].selected):
diff --git a/fsset.py b/fsset.py
index c55db5798..3ea917278 100644
--- a/fsset.py
+++ b/fsset.py
@@ -47,10 +47,8 @@ else:
fileSystemTypes = {}
# XXX define availraidlevels and defaultmntpts as arch characteristics
-if iutil.getArch() != "s390":
- availRaidLevels = ['RAID0', 'RAID1', 'RAID5']
-else:
- availRaidLevels = ['RAID0', 'RAID5']
+# FIXME: this should be done dynamically by reading /proc/mdstat
+availRaidLevels = ['RAID0', 'RAID1', 'RAID5']
def fileSystemTypeGetDefault():
if fileSystemTypeGet('ext3').isSupported():
@@ -494,6 +492,7 @@ class extFileSystem(FileSystemType):
devicePath = entry.device.setupDevice(chroot)
devArgs = self.getDeviceArgs(entry.device)
args = [ "/usr/sbin/mke2fs", devicePath]
+
args.extend(devArgs)
args.extend(self.extraFormatArgs)
@@ -707,6 +706,116 @@ class NTFSFileSystem(FileSystemType):
fileSystemTypeRegister(NTFSFileSystem())
+class hfsFileSystem(FileSystemType):
+ def __init__(self):
+ FileSystemType.__init__(self)
+ self.partedFileSystemType = parted.file_system_type_get("hfs")
+ self.formattable = 1
+ self.checked = 0
+ self.name = "hfs"
+ self.supported = 0
+
+ def isMountable(self):
+ return 0
+
+ def formatDevice(self, entry, progress, chroot='/'):
+ devicePath = entry.device.setupDevice(chroot)
+ devArgs = self.getDeviceArgs(entry.device)
+ args = [ "hformat", devicePath ]
+ args.extend(devArgs)
+
+ rc = iutil.execWithRedirect("/usr/bin/hformat", args,
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5")
+ if rc:
+ raise SystemError
+
+fileSystemTypeRegister(hfsFileSystem())
+
+class applebootstrapFileSystem(hfsFileSystem):
+ def __init__(self):
+ hfsFileSystem.__init__(self)
+ self.partedPartitionFlags = [ parted.PARTITION_BOOT ]
+ self.maxSizeMB = 1
+ self.name = "Apple Bootstrap"
+ if iutil.getPPCMacGen() == "NewWorld":
+ self.supported = 1
+ else:
+ self.supported = 0
+
+fileSystemTypeRegister(applebootstrapFileSystem())
+
+class prepbootFileSystem(FileSystemType):
+ def __init__(self):
+ FileSystemType.__init__(self)
+ self.partedFileSystemType = None
+ self.checked = 0
+ self.name = "PPC PReP Boot"
+
+ # supported for use on the pseries
+ if (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ self.supported = 1
+ self.formattable = 1
+ else:
+ self.supported = 0
+ self.formattable = 0
+
+ def formatDevice(self, entry, progress, chroot='/'):
+ # copy and paste job from booty/bootloaderInfo.py...
+ def getDiskPart(dev):
+ cut = len(dev)
+ if (dev.startswith('rd/') or dev.startswith('ida/') or
+ dev.startswith('cciss/')):
+ if dev[-2] == 'p':
+ cut = -1
+ elif dev[-3] == 'p':
+ cut = -2
+ else:
+ if dev[-2] in string.digits:
+ cut = -2
+ elif dev[-1] in string.digits:
+ cut = -1
+
+ name = dev[:cut]
+
+ # hack off the trailing 'p' from /dev/cciss/*, for example
+ if name[-1] == 'p':
+ for letter in name:
+ if letter not in string.letters and letter != "/":
+ name = name[:-1]
+ break
+
+ if cut < 0:
+ partNum = int(dev[cut:])
+ else:
+ partNum = None
+
+ return (name, partNum)
+
+ # FIXME: oh dear is this a hack beyond my wildest imagination.
+ # parted doesn't really know how to do these, so we're going to
+ # exec sfdisk and make it set the partition type. this is bloody
+ # ugly
+ devicePath = entry.device.setupDevice(chroot)
+ (disk, part) = getDiskPart(devicePath)
+ if disk is None or part is None:
+ log("oops, somehow got a bogus device for the PrEP partition "
+ "(%s)" %(devicePath,))
+ return
+
+ args = [ "sfdisk", "--change-id", disk, "%d" %(part,), "41" ]
+ if disk.startswith("/tmp/") and not os.access(disk, os.R_OK):
+ isys.makeDevInode(disk[5:], disk)
+
+ log("going to run %s" %(args,))
+ rc = iutil.execWithRedirect("/usr/sbin/sfdisk", args,
+ stdout = "/dev/tty5", stderr = "/dev/tty5")
+ if rc:
+ raise SystemError
+
+fileSystemTypeRegister(prepbootFileSystem())
+
class ForeignFileSystem(FileSystemType):
def __init__(self):
FileSystemType.__init__(self)
@@ -953,11 +1062,24 @@ class FileSystemSet:
# return the "boot" devicce
def getBootDev(self):
mntDict = {}
+ bootDev = None
for entry in self.entries:
mntDict[entry.mountpoint] = entry.device
- if iutil.getArch() == "ia64" and mntDict.has_key("/boot/efi"):
- bootDev = mntDict['/boot/efi']
+ # FIXME: this ppc stuff feels kind of crufty -- the abstraction
+ # here needs a little bit of work
+ if iutil.getPPCMacGen() == "NewWorld":
+ for entry in self.entries:
+ if entry.fsystem.getName() == "Apple Bootstrap":
+ bootDev = entry.device
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ for entry in self.entries:
+ if entry.fsystem.getName() == "PPC PReP Boot":
+ bootDev = entry.device
+ elif iutil.getArch() == "ia64":
+ if mntDict.has_key("/boot/efi"):
+ bootDev = mntDict['/boot/efi']
elif mntDict.has_key("/boot"):
bootDev = mntDict['/boot']
else:
@@ -969,10 +1091,30 @@ class FileSystemSet:
ret = {}
bootDev = self.getBootDev()
+ if bootDev is None:
+ log("no boot device set")
+ return ret
+
if bootDev.getName() == "RAIDDevice":
ret['boot'] = (bootDev.device, N_("RAID Device"))
return ret
+ if iutil.getPPCMacGen() == "NewWorld":
+ ret['boot'] = (bootDev.device, N_("Apple Bootstrap"))
+ n = 1
+ for entry in self.entries:
+ if ((entry.fsystem.getName() == "Apple Bootstrap") and (
+ entry.device.getDevice() != bootDev.device)):
+ ret['boot%d' %(n,)] = (entry.device.getDevice(),
+ N_("Apple Bootstrap"))
+ n = n + 1
+ return ret
+ # FIXME: is this right?
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ ret['boot'] = (bootDev.device, N_("PPC PReP Boot"))
+ return ret
+
ret['boot'] = (bootDev.device, N_("First sector of boot partition"))
ret['mbr'] = (bl.drivelist[0], N_("Master Boot Record (MBR)"))
return ret
@@ -982,13 +1124,16 @@ class FileSystemSet:
# set either our boot partition or the first partition on the drive active
def setActive(self, diskset):
dev = self.getBootDev()
- if dev.getName() != "LoopbackDevice":
- bootDev = dev.device
- else:
- bootDev = None
- # stupid itanium
- if iutil.getArch() == "ia64":
+ if dev is None:
+ return
+
+ bootDev = dev.device
+
+ # on ia64, *only* /boot/efi should be marked bootable
+ # similarly, on pseries, we really only want the PReP partition active
+ if (iutil.getArch() == "ia64" or iutil.getPPCMachine() == "pSeries"
+ or iutil.getPPCMachine() == "iSeries"):
part = partedUtils.get_partition_by_name(diskset.disks, bootDev)
if part and part.is_flag_available(parted.PARTITION_BOOT):
part.set_flag(parted.PARTITION_BOOT, 1)
@@ -1943,7 +2088,6 @@ def getDevFD(device):
return -1
return fd
-
def isValidExt2(device):
fd = getDevFD(device)
if fd == -1:
@@ -1976,6 +2120,40 @@ def isValidXFS(device):
return 0
+def isValidReiserFS(device):
+ fd = getDevFD(device)
+ if fd == -1:
+ return 0
+
+ '''
+ ** reiserfs 3.5.x super block begins at offset 8K
+ ** reiserfs 3.6.x super block begins at offset 64K
+ All versions have a magic value of "ReIsEr" at
+ offset 0x34 from start of super block
+ '''
+ reiserMagicVal = "ReIsEr"
+ reiserMagicOffset = 0x34
+ reiserSBStart = [64*1024, 8*1024]
+ bufSize = 0x40 # just large enough to include the magic value
+ for SBOffset in reiserSBStart:
+ try:
+ os.lseek(fd, SBOffset, 0)
+ buf = os.read(fd, bufSize)
+ except:
+ buf = ""
+
+ if len(buf) < bufSize:
+ continue
+
+ if (buf[reiserMagicOffset:reiserMagicOffset+len(reiserMagicVal)] ==
+ reiserMagicVal):
+ os.close(fd)
+ return 1
+
+ os.close(fd)
+ return 0
+
+
# this will return a list of types of filesystems which device
# looks like it could be to try mounting as
def getFStoTry(device):
@@ -1984,6 +2162,9 @@ def getFStoTry(device):
if isValidXFS(device):
rc.append("xfs")
+ if isValidReiserFS(device):
+ rc.append("reiserfs")
+
if isValidExt2(device):
if os.access(device, os.O_RDONLY):
create = 0
@@ -1995,7 +2176,7 @@ def getFStoTry(device):
# FIXME: need to check for swap
- # XXX check for reiserfs signature, jfs signature, and others ?
+ # XXX check for, jfs signature, and others ?
return rc
def allocateLoopback(file):
diff --git a/installclass.py b/installclass.py
index e117ad5e3..605d225f8 100644
--- a/installclass.py
+++ b/installclass.py
@@ -147,29 +147,33 @@ class BaseInstallClass:
if not BETANAG:
dispatch.skipStep("betanag")
- # XXX ugh, this badly needs some clean up
- if iutil.getArch() == "x86_64":
+ if iutil.getArch() != "i386":
dispatch.skipStep("bootdisk")
- elif (iutil.getArch() == "alpha" or iutil.getArch() == "ia64" or
+
+ if (iutil.getArch() == "alpha" or iutil.getArch() == "ia64" or
iutil.getArch() == "sparc" or iutil.getArch() == "ppc"):
- dispatch.skipStep("bootdisk")
dispatch.skipStep("bootloader")
- elif iutil.getArch() == "s390":
+
+ # 'noupgrade' can be used on the command line to force not looking
+ # for partitions to upgrade. useful in some cases...
+ cmdline = open("/proc/cmdline", "r").read()
+ if cmdline.find("noupgrade") != -1:
+ dispatch.skipStep("findrootparts")
+
+ # called from anaconda so that we can skip steps in the headless case
+ # in a perfect world, the steps would be able to figure this out
+ # themselves by looking at instdata.headless. but c'est la vie.
+ def setAsHeadless(self, dispatch, isHeadless = 0):
+ if isHeadless == 0:
+ pass
+ else:
dispatch.skipStep("keyboard", permanent = 1)
dispatch.skipStep("mouse", permanent = 1)
- dispatch.skipStep("fdisk", permanent = 1)
dispatch.skipStep("handleX11pkgs", permanent = 1)
dispatch.skipStep("videocard", permanent = 1)
dispatch.skipStep("monitor", permanent = 1)
dispatch.skipStep("xcustom", permanent = 1)
dispatch.skipStep("writexconfig", permanent = 1)
- dispatch.skipStep("bootdisk", permanent = 1)
-
- # 'noupgrade' can be used on the command line to force not looking
- # for partitions to upgrade. useful in some cases...
- cmdline = open("/proc/cmdline", "r").read()
- if cmdline.find("noupgrade") != -1:
- dispatch.skipStep("findrootparts")
# This is called after the hdlist is read in.
def setPackageSelection(self, hdlist, intf):
diff --git a/instdata.py b/instdata.py
index ce9523905..a1c5da156 100644
--- a/instdata.py
+++ b/instdata.py
@@ -102,12 +102,17 @@ class InstallData:
def setXSetup(self, xsetup):
self.xsetup = xsetup
+ # expects 0/1
+ def setHeadless(self, isHeadless):
+ self.isHeadless = isHeadless
+
def write(self, instPath):
self.langSupport.write (instPath)
- if self.mouse is not None:
+
+ if not self.isHeadless:
self.mouse.write(instPath)
+ self.keyboard.write (instPath)
- self.keyboard.write (instPath)
self.network.write (instPath)
self.timezone.write (instPath)
self.auth.write (instPath)
@@ -127,10 +132,9 @@ class InstallData:
self.instLanguage.writeKS(f)
self.langSupport.writeKS(f)
- self.keyboard.writeKS(f)
- if self.mouse is not None:
+ if not self.isHeadless:
+ self.keyboard.writeKS(f)
self.mouse.writeKS(f)
- if self.xsetup is not None:
self.xsetup.writeKS(f, self.desktop)
self.network.writeKS(f)
self.rootPassword.writeKS(f, self.auth)
@@ -227,6 +231,7 @@ class InstallData:
self.monitor = None
self.videocard = None
self.xsetup = None
+ self.isHeadless = 0
self.extraModules = extraModules
self.floppyDevice = floppyDevice
self.fsset = fsset.FileSystemSet()
diff --git a/isys/Makefile b/isys/Makefile
index 673ee934f..b0ae5daf1 100644
--- a/isys/Makefile
+++ b/isys/Makefile
@@ -4,7 +4,7 @@ CFLAGS = -ffunction-sections -I$(PYTHONINCLUDE) -I.. -Wall -Os -g -DHAVE_NFS -D
OBJECTS = nfsmount.o nfsmount_clnt.o nfsmount_xdr.o imount.o \
smp.o devnodes.o cpio.o probe.o uncpio.o \
- lang.o isofs.o dns.o linkdetect.o pdc.o hpt.o silraid.o
+ lang.o isofs.o dns.o linkdetect.o pdc.o hpt.o silraid.o vio.o
SOBJECTS = $(patsubst %.o,%.lo,$(OBJECTS))
SOURCES = $(patsubst %.o,%.c,$(OBJECTS)) isys.c
LOADLIBES = -lresolv -lpci -lpopt -lpump -lext2fs -lz -lbterm -lbogl -lwlite
diff --git a/isys/cpio.c b/isys/cpio.c
index 7aeb16d38..008c6b97c 100644
--- a/isys/cpio.c
+++ b/isys/cpio.c
@@ -1,5 +1,4 @@
#include <fcntl.h>
-#include <newt.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/isys/devnodes.c b/isys/devnodes.c
index c130499e0..83d1fab5b 100644
--- a/isys/devnodes.c
+++ b/isys/devnodes.c
@@ -225,6 +225,32 @@ int devMakeInode(char * devName, char * path) {
{
minor = minor + atoi(devName + 7);
}
+ } else if (!strncmp(devName, "iseries/vcd", 11)) {
+ /* IBM virtual cdrom (iseries) */
+ type = S_IFBLK;
+ major = 113;
+ minor = devName[11] - 'a';
+ } else if (!strncmp(devName, "iseries/vd", 10)) {
+ int drive = 0;
+ char * num = NULL;
+
+ /* IBM virtual disk (iseries) */
+ type = S_IFBLK;
+ major = 112;
+
+ if (devName[11] && isdigit(devName[11])) {
+ drive = devName[10] - 'a';
+ num = devName + 11;
+ } else if (devName[11] && islower(devName[11])) {
+ drive = ((devName[10] - 'a' + 1) * 26) + devName[11] - 'a';
+ num = devName + 12;
+ } else {
+ drive = devName[10] - 'a';
+ }
+
+ minor = (drive * 8);
+ if (num && num[0])
+ minor += (num[0] - '0');
} else {
for (i = 0; i < numDevices; i++) {
if (!strcmp(devices[i].name, devName)) break;
diff --git a/isys/isys.c b/isys/isys.c
index 21bc300d7..872b84654 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -102,6 +102,7 @@ static PyObject * hasIdeRaidMagic(PyObject * s, PyObject * args);
static PyObject * start_bterm(PyObject * s, PyObject * args);
static PyObject * py_getDasdPorts(PyObject * s, PyObject * args);
static PyObject * py_isUsableDasd(PyObject * s, PyObject * args);
+static PyObject * py_isLdlDasd(PyObject * s, PyObject * args);
static PyMethodDef isysModuleMethods[] = {
{ "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL },
@@ -153,6 +154,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "startBterm", (PyCFunction) start_bterm, METH_VARARGS, NULL },
{ "getDasdPorts", (PyCFunction) py_getDasdPorts, METH_VARARGS, NULL},
{ "isUsableDasd", (PyCFunction) py_isUsableDasd, METH_VARARGS, NULL},
+ { "isLdlDasd", (PyCFunction) py_isLdlDasd, METH_VARARGS, NULL},
{ NULL }
} ;
@@ -1386,6 +1388,14 @@ static PyObject * py_isUsableDasd(PyObject * o, PyObject * args) {
return Py_BuildValue("i", isUsableDasd(devname));
}
+static PyObject * py_isLdlDasd(PyObject * o, PyObject * args) {
+ char *devname;
+ if (!PyArg_ParseTuple(args, "s", &devname))
+ return NULL;
+ return Py_BuildValue("i", isLdlDasd(devname));
+}
+
+
static PyObject * printObject (PyObject * o, PyObject * args) {
PyObject * obj;
char buf[256];
diff --git a/isys/isys.py b/isys/isys.py
index 2ddb44e1c..d1e6f6dee 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -14,8 +14,6 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-import kudzu
-import parted
import _isys
import string
import os
@@ -251,6 +249,8 @@ def driveDict(klassArg):
return dict
def hardDriveDict():
+ import parted
+
dict = driveDict("disk")
# this is kind of ugly, but it's much easier to do this from python
@@ -310,6 +310,9 @@ def getDasdPorts():
def isUsableDasd(device):
return _isys.isUsableDasd(device)
+def isLdlDasd(device):
+ return _isys.isLdlDasd(device)
+
def makeDevInode(name, fn=None):
if fn:
_isys.mkdevinode(name, fn)
diff --git a/isys/probe.c b/isys/probe.c
index 4d37e13a8..8da11c9b5 100644
--- a/isys/probe.c
+++ b/isys/probe.c
@@ -21,11 +21,12 @@ static int dac960GetDevices(struct knownDevices * devices);
static int CompaqSmartArrayGetDevices(struct knownDevices * devices);
static int CompaqSmartArray5300GetDevices(struct knownDevices * devices);
static int ataraidGetDevices(struct knownDevices * devices);
-/* Added support for I2O Block devices: Boji Kannanthanam
- <boji.t.Kannanthanam@intel.com> */
+static int viodGetDevices(struct knownDevices * devices);
+/* Added support for I2O Block devices: Boji Kannanthanam
+ <boji.t.Kannanthanam@intel.com> */
static int ProcPartitionsGetDevices(struct knownDevices * devices);
-static int readFD (int fd, char **buf)
+int readFD (int fd, char **buf)
{
char *p;
size_t size = 4096;
@@ -64,7 +65,7 @@ static int sortDevices(const void * a, const void * b) {
return strcmp(one->name, two->name);
}
-static int deviceKnown(struct knownDevices * devices, char * dev) {
+int deviceKnown(struct knownDevices * devices, char * dev) {
int i;
for (i = 0; i < devices->numKnown; i++)
@@ -73,7 +74,7 @@ static int deviceKnown(struct knownDevices * devices, char * dev) {
return 0;
}
-static void addDevice(struct knownDevices * devices, struct kddevice dev) {
+void addDevice(struct knownDevices * devices, struct kddevice dev) {
if (devices->numKnown == devices->numKnownAlloced) {
devices->numKnownAlloced += 5;
devices->known = realloc(devices->known,
@@ -135,13 +136,13 @@ int kdFindNetList(struct knownDevices * devices, int code) {
*end = '\0';
if (strcmp(start, "lo")) {
- if (deviceKnown(devices, start)) continue;
-
- newDevice.name = strdup(start);
- newDevice.model = NULL;
- newDevice.class = CLASS_NETWORK;
- newDevice.code = code;
- addDevice(devices, newDevice);
+ if (!deviceKnown(devices, start)) {
+ newDevice.name = strdup(start);
+ newDevice.model = NULL;
+ newDevice.class = CLASS_NETWORK;
+ newDevice.code = code;
+ addDevice(devices, newDevice);
+ }
}
start = strchr(end + 1, '\n');
@@ -174,27 +175,12 @@ int vtoc_read_volume_label (int fd, unsigned long vlabel_start,
}
int read_vlabel(dasd_information_t *dasd_info, int fd, int blksize, volume_label_t *vlabel) {
- volume_label_t tmp;
unsigned long pos;
- int ret;
pos = dasd_info->label_block * blksize;
memset(vlabel, 0, sizeof(volume_label_t));
- if ((strncmp(dasd_info->type, "ECKD", 4) == 0) &&
- (!dasd_info->FBA_layout)) {
- /* OS/390 and zOS compatible disk layout */
- return vtoc_read_volume_label(fd, pos, vlabel);
- }
- else {
- /* standard LINUX disk layout */
- ret = vtoc_read_volume_label(fd, pos, &tmp);
- if(!ret) {
- memcpy(vlabel->vollbl, &tmp, sizeof(tmp)-4);
- return 0;
- }
- return ret;
- }
+ return vtoc_read_volume_label(fd, pos, vlabel);
}
#endif
@@ -204,8 +190,8 @@ int isUsableDasd(char *device) {
#else
char devname[16];
char label[5], v4_hex[9];
- char v4ebcdic_hex[] = "e5d6d3f1"; /* VOL1 */
char l4ebcdic_hex[] = "d3d5e7f1"; /* LNX1 */
+ char cms1_hex[] = "c3d4e2f1"; /* CMS1 */
int f, ret, blksize;
dasd_information_t dasd_info;
volume_label_t vlabel;
@@ -245,14 +231,20 @@ int isUsableDasd(char *device) {
memset(v4_hex, 0, 9);
strncpy(label, vlabel.volkey, 4);
sprintf(v4_hex, "%02x%02x%02x%02x", label[0], label[1], label[2], label[3]);
- if(!strncmp(v4_hex, v4ebcdic_hex, 9) || !strncmp(v4_hex, l4ebcdic_hex, 9)) {
- /* fprintf(stderr, "Found a usable device: %s\n", devname); */
- return 1;
+ if(!strncmp(v4_hex, cms1_hex, 9)) {
+ return 0;
}
- return 0;
+ if(!strncmp(v4_hex, l4ebcdic_hex, 9)) {
+ return 2;
+ }
+ return 1;
#endif
}
+int isLdlDasd(char * device) {
+ return (isUsableDasd(device) == 2);
+}
+
char *getDasdPorts() {
#if !defined(__s390__) && !defined(__s390x__)
return 0;
@@ -414,6 +406,7 @@ int kdFindScsiList(struct knownDevices * devices, int code) {
dac960GetDevices(devices);
CompaqSmartArrayGetDevices(devices);
CompaqSmartArray5300GetDevices(devices);
+ viodGetDevices(devices);
return 0;
}
@@ -432,6 +425,7 @@ int kdFindScsiList(struct knownDevices * devices, int code) {
dac960GetDevices(devices);
CompaqSmartArrayGetDevices(devices);
CompaqSmartArray5300GetDevices(devices);
+ viodGetDevices(devices);
goto bye;
}
@@ -563,6 +557,7 @@ int kdFindScsiList(struct knownDevices * devices, int code) {
dac960GetDevices(devices);
CompaqSmartArrayGetDevices(devices);
CompaqSmartArray5300GetDevices(devices);
+ viodGetDevices(devices);
/* we can't really sanely do ataraid devs yet (#82848) */
#if 0
ataraidGetDevices(devices);
@@ -896,3 +891,18 @@ static int CompaqSmartArray5300GetDevices(struct knownDevices * devices) {
return 0;
}
+
+static int viodGetDevices(struct knownDevices * devices) {
+ if (access("/proc/iSeries", X_OK))
+ return 0;
+
+ vioGetCdDevs(devices);
+ vioGetDasdDevs(devices);
+
+ return 0;
+}
+
+
+
+
+
diff --git a/isys/probe.h b/isys/probe.h
index f3886f0d7..7f6f013ac 100644
--- a/isys/probe.h
+++ b/isys/probe.h
@@ -86,5 +86,12 @@ void kdFree(struct knownDevices * devices);
void kdAddDevice(struct knownDevices * devices, enum deviceClass devClass,
char * devName, char * devModel);
char *getDasdPorts();
+int isLdlDasd(char * dev);
+int vioGetDasdDevs(struct knownDevices * devices);
+int vioGetCdDevs(struct knownDevices * devices);
+
+int readFD (int fd, char **buf);
+void addDevice(struct knownDevices * devices, struct kddevice dev);
+int deviceKnown(struct knownDevices * devices, char * dev);
#endif
diff --git a/isys/smp.c b/isys/smp.c
index a558491c1..5478e14a6 100644
--- a/isys/smp.c
+++ b/isys/smp.c
@@ -336,7 +336,8 @@ static int groupForSMP(int mode)
if (mode == MODE_SUMMIT_CHECK) {
if (!strncmp(cth.oem_id, "IBM ENSW", 8) &&
(!strncmp(cth.product_id, "NF 6000R", 8) ||
- !strncmp(cth.product_id, "VIGIL SMP", 9)))
+ !strncmp(cth.product_id, "VIGIL SMP", 9) ||
+ !strncmp(cth.product_id, "RUTHLESS", 8)))
return 1;
return 0;
}
diff --git a/isys/stubs.h b/isys/stubs.h
index 040a376ce..9e8ee4ce1 100644
--- a/isys/stubs.h
+++ b/isys/stubs.h
@@ -11,6 +11,7 @@
#include <zlib.h>
#define gunzip_open(x) gzopen(x, "r")
+#define gunzip_dopen gzdopen(x, "r")
#define gunzip_close gzclose
#define gunzip_read gzread
#define gzip_write gzwrite
diff --git a/isys/vio.c b/isys/vio.c
new file mode 100644
index 000000000..a39cf13f2
--- /dev/null
+++ b/isys/vio.c
@@ -0,0 +1,174 @@
+/*
+ * vio.c - probing for vio devices on the iSeries (viocd and viodasd)
+ *
+ * Jeremy Katz <katzj@redhat.com>
+ *
+ * Copyright 2003 Red Hat, Inc.
+ *
+ */
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <kudzu/kudzu.h>
+#include "probe.h"
+
+int vioGetCdDevs(struct knownDevices * devices) {
+#if !defined(__powerpc__)
+ return 0;
+#else
+ int fd, i;
+ char * buf, * start, * end, * chptr, * next, * model, * ptr;
+ int ctlNum = 0;
+ char ctl[64];
+ struct kddevice newDevice;
+
+ if (access("/proc/iSeries/viocd", R_OK))
+ return 0;
+
+ /* Read from /proc/iSeries/viocd */
+ fd = open("/proc/iSeries/viocd", O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "failed to open /proc/iSeries/viocd!\n");
+ return 1;
+ }
+
+ i = readFD(fd, &buf);
+ if (i < 1) {
+ close(fd);
+ free (buf);
+ fprintf(stderr, "error reading /proc/iSeries/viocd!\n");
+ return 1;
+ }
+ close(fd);
+ buf[i] = '\0';
+
+ start = buf;
+ end = start + strlen(start);
+ while (*start && start < end) {
+ /* parse till end of line and store the start of next line. */
+ chptr = start;
+ while (*chptr != '\n') chptr++;
+ *chptr = '\0';
+ next = chptr + 1;
+
+ /* get rid of anything which is not alpha */
+ while (!(isalpha(*start))) start++;
+
+ model = NULL;
+ if (!strncmp("viocd", start, 5))
+ model = "IBM Virtual CDROM";
+
+ if (model) {
+ start += 13;
+ ptr = strchr(start, ' ');
+ *ptr++ = '\0';
+
+ ctlNum = atoi(start);
+
+ chptr = strstr(ptr, "type ") + 5;
+ ptr = strchr(chptr, ',');
+ *ptr = '\0';
+
+ model = alloca((20 + strlen(chptr)) * sizeof(char *));
+ sprintf(model, "IBM Virtual CD-ROM Model %s", chptr);
+ snprintf(ctl, 63, "iseries/vcd%d", ctlNum);
+
+ if (!deviceKnown(devices, ctl)) {
+ newDevice.name = strdup(ctl);
+ newDevice.model = strdup(model);
+ newDevice.class = CLASS_CDROM;
+ addDevice(devices, newDevice);
+ }
+ // printf("model is %s, ctl is %s\n", model, ctl);
+ }
+
+ start = next;
+ end = start + strlen(start);
+ } /* end of while */
+
+ free (buf);
+ return 0;
+#endif
+}
+
+int vioGetDasdDevs(struct knownDevices * devices) {
+#if !defined(__powerpc__)
+ return 0;
+#else
+ int fd, i;
+ char * buf, * start, * end, * chptr, * next, * model, * ptr;
+ int ctlNum = 0;
+ char ctl[64];
+ struct kddevice newDevice;
+
+ if (access("/proc/iSeries/viodasd", R_OK))
+ return 0;
+
+ /* Read from /proc/iSeries/viodasd */
+ fd = open("/proc/iSeries/viodasd", O_RDONLY);
+ if (fd < 0) {
+ fprintf(stderr, "failed to open /proc/iSeries/viodasd!\n");
+ return 1;
+ }
+
+ i = readFD(fd, &buf);
+ if (i < 1) {
+ close(fd);
+ free (buf);
+ fprintf(stderr, "error reading /proc/iSeries/viodasd!\n");
+ return 1;
+ }
+ close(fd);
+ buf[i] = '\0';
+
+ start = buf;
+ end = start + strlen(start);
+ while (*start && start < end) {
+ /* parse till end of line and store the start of next line. */
+ chptr = start;
+ while (*chptr != '\n') chptr++;
+ *chptr = '\0';
+ next = chptr + 1;
+
+ /* get rid of anything which is not alpha */
+ while (!(isalpha(*start))) start++;
+
+ model = NULL;
+ if (!strncmp("DISK ", start, 5))
+ model = "IBM Virtual DASD";
+
+ if (model) {
+ chptr = start += 5;
+ ptr = strchr(chptr, ' ');
+ *ptr = '\0';
+ ctlNum = atoi(chptr);
+
+ if (ctlNum <= 26) {
+ snprintf(ctl, 63, "iseries/vd%c", 'a' + ctlNum);
+ } else {
+ snprintf(ctl, 63, "iseries/vda%c", 'a' + ctlNum - 26);
+ }
+
+ if (!deviceKnown(devices, ctl)) {
+ newDevice.name = strdup(ctl);
+ newDevice.model = strdup(model);
+ newDevice.class = CLASS_HD;
+ addDevice(devices, newDevice);
+ }
+ // printf("model is %s, ctl is %s\n", model, ctl);
+ }
+
+ start = next;
+ end = start + strlen(start);
+ } /* end of while */
+
+ free (buf);
+ return 0;
+#endif
+}
diff --git a/iutil.py b/iutil.py
index a0358b070..0d99a8dd3 100644
--- a/iutil.py
+++ b/iutil.py
@@ -459,17 +459,18 @@ def isUSBDevFSMounted():
def getPPCMachine():
machine = None
# ppc machine hash
- # PPC XXX: add MAI
ppcType = { 'Mac' : 'PMac',
'Book' : 'PMac',
'CHRP IBM' : 'pSeries',
'iSeries' : 'iSeries',
'PReP' : 'PReP',
- 'CHRP' : 'CHRP',
+ 'CHRP' : 'pSeries',
'Amiga' : 'APUS',
'Gemini' : 'Gemini',
'Shiner' : 'ANS',
- 'BRIQ' : 'BRIQ'
+ 'BRIQ' : 'BRIQ',
+ 'Teron' : 'Teron',
+ 'AmigaOne' : 'Teron'
}
if getArch() != "ppc":
@@ -489,7 +490,6 @@ def getPPCMachine():
for type in ppcType.items():
if machine.find(type[0]) != -1:
- log("PowerPC machine type: %s", type[1])
return type[1]
log("Unknown PowerPC machine type: %s" %(machine,))
@@ -511,7 +511,6 @@ def getPPCMacID():
if line.find('machine') != -1:
machine = line.split(':')[1]
machine = machine.strip()
- log("Power Mac machine id: %s", machine)
return machine
log("WARNING: No Power Mac machine id")
@@ -541,7 +540,6 @@ def getPPCMacGen():
for type in pmacGen:
if gen.find(type) != -1:
- log("Power Mac generation: %s", type)
return type
log("Unknown Power Mac generation: %s" %(gen,))
@@ -560,6 +558,5 @@ def getPPCMacBook():
for line in lines:
if not string.find(string.lower(line), 'book') == -1:
- log("PowerBook/iBook: 1")
return 1
return 0
diff --git a/iw/account_gui.py b/iw/account_gui.py
index 31fbe0880..e799f6ab1 100644
--- a/iw/account_gui.py
+++ b/iw/account_gui.py
@@ -29,6 +29,30 @@ class AccountWindow (InstallWindow):
if not self.__dict__.has_key("pw"): return None
pw = self.pw.get_text()
+ confirm = self.confirm.get_text()
+
+ if not pw or not confirm:
+ self.intf.messageWindow(_("Error with Password"),
+ _("You must enter your root password "
+ "and confirm it by typing it a second "
+ "time to continue."),
+ custom_icon="error")
+ raise gui.StayOnScreen
+
+ if pw != confirm:
+ self.intf.messageWindow(_("Error with Password"),
+ _("The passwords you entered were "
+ "different. Please try again."),
+ custom_icon="error")
+ raise gui.StayOnScreen
+
+ if len(pw) < 6:
+ self.intf.messageWindow(_("Error with Password"),
+ _("The root password must be at least "
+ "six characters long."),
+ custom_icon="error")
+ raise gui.StayOnScreen
+
allowed = string.digits + string.ascii_letters + string.punctuation + " "
for letter in pw:
if letter not in allowed:
@@ -42,23 +66,6 @@ class AccountWindow (InstallWindow):
self.rootPw.set (self.pw.get_text ())
return None
- def rootPasswordsMatch (self, *args):
- pw = self.pw.get_text ()
- confirm = self.confirm.get_text ()
-
- if pw == confirm and len (pw) >= 6:
- self.ics.setNextEnabled (gtk.TRUE)
- self.rootStatus.set_text (_("Root password accepted."))
- else:
- if not pw and not confirm:
- self.rootStatus.set_text ("")
- elif len (pw) < 6:
- self.rootStatus.set_text (_("Root password is too short."))
- else:
- self.rootStatus.set_text (_("Root passwords do not match."))
-
- self.ics.setNextEnabled (gtk.FALSE)
-
def setFocus (self, area, data):
self.pw.grab_focus ()
@@ -103,14 +110,12 @@ class AccountWindow (InstallWindow):
pass1.set_mnemonic_widget(self.pw)
self.pw.connect ("activate", self.forward)
- self.pw.connect ("changed", self.rootPasswordsMatch)
self.pw.connect ("map-event", self.setFocus)
self.pw.set_visibility (gtk.FALSE)
self.confirm = gtk.Entry (128)
pass2.set_mnemonic_widget(self.confirm)
self.confirm.connect ("activate", self.forward)
self.confirm.set_visibility (gtk.FALSE)
- self.confirm.connect ("changed", self.rootPasswordsMatch)
table.attach (self.pw, 1, 2, 0, 1, gtk.FILL|gtk.EXPAND, 5)
table.attach (self.confirm, 1, 2, 1, 2, gtk.FILL|gtk.EXPAND, 5)
@@ -120,7 +125,6 @@ class AccountWindow (InstallWindow):
# root password statusbar
self.rootStatus = gtk.Label ("")
- self.rootPasswordsMatch ()
wrapper = gtk.HBox(0, gtk.FALSE)
wrapper.pack_start (self.rootStatus)
box.pack_start (wrapper, gtk.FALSE)
diff --git a/iw/bootloader_main_gui.py b/iw/bootloader_main_gui.py
index de1273372..f0fdd249e 100644
--- a/iw/bootloader_main_gui.py
+++ b/iw/bootloader_main_gui.py
@@ -48,6 +48,9 @@ class MainBootloaderWindow(InstallWindow):
# screen and don't worry about other options
self.dispatch.skipStep("instbootloader", skip = 1)
self.dispatch.skipStep("bootloaderadvanced", skip = 1)
+
+ # kind of a hack...
+ self.bl.defaultDevice = None
return
else:
self.dispatch.skipStep("instbootloader", skip = 0)
diff --git a/iw/congrats_gui.py b/iw/congrats_gui.py
index 319a98b55..a77c7853a 100644
--- a/iw/congrats_gui.py
+++ b/iw/congrats_gui.py
@@ -56,13 +56,19 @@ class CongratulationWindow (InstallWindow):
"rebooting your newly installed system.\n\n") % (productName,)
else:
bootstr = ""
+
+ if iutil.getArch() == "s390":
+ floppystr = ""
+ else:
+ floppystr = _("Remove any installation media (diskettes or "
+ "CD-ROMs) used during the installation process "
+ "and press <Enter> to reboot your system."
+ "\n\n")
label = gui.WrappingLabel(
_("Congratulations, the installation is complete.\n\n"
- "Remove any installation media (diskettes or CD-ROMs) used during the "
- "installation."
- "\n\n"
+ "%s"
"%s"
"For information on Errata (updates and bug fixes), visit:\n"
"\thttp://www.redhat.com/errata/\n\n"
@@ -74,7 +80,7 @@ class CongratulationWindow (InstallWindow):
"\thttp://www.redhat.com/apps/support/\n\n"
"To register the product for support, visit:\n"
"\thttp://www.redhat.com/apps/activate/\n\n"
- "Click 'Exit' to reboot the system.") % (bootstr,))
+ "Click 'Exit' to reboot the system.") % (floppystr, bootstr,))
hbox.pack_start (label, gtk.TRUE, gtk.TRUE)
return hbox
diff --git a/iw/installpath_gui.py b/iw/installpath_gui.py
index a16a3554e..594f48f06 100644
--- a/iw/installpath_gui.py
+++ b/iw/installpath_gui.py
@@ -76,10 +76,10 @@ class InstallPathWindow (InstallWindow):
vbox = gtk.VBox (gtk.FALSE, 10)
vbox.set_border_width (8)
- r = self.createInstallTypeOption()
- b = r.render()
+ self.r = self.createInstallTypeOption()
+ b = self.r.render()
- r.setToggleCallback(self.optionToggled)
+ self.r.setToggleCallback(self.optionToggled)
# figure out current class as well as default
defaultClass = None
@@ -103,7 +103,7 @@ class InstallPathWindow (InstallWindow):
else:
self.currentClassName = currentClass.name
- r.setCurrent(self.currentClassName)
+ self.r.setCurrent(self.currentClassName)
box = gtk.VBox (gtk.FALSE)
box.pack_start(b, gtk.FALSE)
diff --git a/iw/partition_dialog_gui.py b/iw/partition_dialog_gui.py
index 3c78f8176..91490875b 100644
--- a/iw/partition_dialog_gui.py
+++ b/iw/partition_dialog_gui.py
@@ -450,8 +450,11 @@ class PartitionEditor:
self.primonlycheckbutton.set_active(0)
if self.origrequest.primary:
self.primonlycheckbutton.set_active(1)
- maintable.attach(self.primonlycheckbutton, 0, 2, row, row+1)
- row = row + 1
+
+ # only show if we have something other than primary
+ if not self.diskset.onlyPrimaryParts():
+ maintable.attach(self.primonlycheckbutton, 0, 2, row, row+1)
+ row = row + 1
# disable option for badblocks checking
self.badblocks = None
diff --git a/keymaps/Makefile b/keymaps/Makefile
index f7902709d..8eeddf11f 100644
--- a/keymaps/Makefile
+++ b/keymaps/Makefile
@@ -23,3 +23,6 @@ s390:
s390x:
./updkmaps s390
+
+ppc:
+ ./updkmaps ppc
diff --git a/kickstart.py b/kickstart.py
index a06373e72..c8f022851 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -560,6 +560,7 @@ class KickstartBase(BaseInstallClass):
"skipx" : self.doSkipX ,
"text" : None ,
"graphical" : None ,
+ "cmdline" : None ,
"timezone" : self.doTimezone ,
"url" : None ,
"upgrade" : self.doUpgrade ,
@@ -1024,6 +1025,14 @@ class KickstartBase(BaseInstallClass):
if recommended:
(size, maxSize) = iutil.swapSuggestion()
grow = 1
+ # if people want to specify no mountpoint for some reason, let them
+ # this is really needed for pSeries boot partitions :(
+ elif extra[0] == 'None':
+ mountpoint = None
+ if fstype:
+ filesystem = fileSystemTypeGet(fstype)
+ else:
+ filesystem = fileSystemTypeGetDefault()
elif extra[0].startswith("raid."):
filesystem = fileSystemTypeGet("software RAID")
diff --git a/loader2/.cvsignore b/loader2/.cvsignore
index 217ec702a..b3b2b52cf 100644
--- a/loader2/.cvsignore
+++ b/loader2/.cvsignore
@@ -7,3 +7,4 @@ loader.tr
.depend
font.bgf.gz
loader.po
+shutdown
diff --git a/loader2/Makefile b/loader2/Makefile
index 778db6adf..ad2a10d8e 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -14,7 +14,7 @@ ISYSLIB = ../isys/libisys.a
GUNZIP = -lz
MODULELINKAGE :=-lmodutils -lmodutilutil -lmodutilobj
-BINS = init loader
+BINS = loader
HWOBJS = pcmcia.o usb.o firewire.o hardware.o
METHOBJS = method.o cdinstall.o hdinstall.o nfsinstall.o urlinstall.o
@@ -51,8 +51,12 @@ else
OBJS += wcstubs.o
endif
+# linuxrc + shutdown on s390, init everywhere else
ifneq (,$(filter s390 s390x,$(ARCH)))
-BINS += linuxrc.s390
+BINS += linuxrc.s390 shutdown
+SHUTDOWNOPTS = -DAS_SHUTDOWN=1
+else
+BINS += init
endif
# translation stuff
@@ -83,12 +87,21 @@ loader.po: $(wildcard *.c)
linuxrc.s390:
@echo "Nothing to do for $@"
-init: init.o
- $(CC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ init.o
+init: init.o undomounts.o shutdown.o
+ $(CC) $(STATIC) $(COPTS) $(LDFLAGS) -o $@ $^
+
+shutdown: shutdown.o undomounts.o
+ $(CC) $(STATIC) $(COPTS) $(SHUTDOWNOPTS) $(LDFLAGS) -o $@ $^
init.o: init.c
$(CC) $(COPTS) -c -o init.o init.c
+undomounts.o: undomounts.c
+ $(CC) $(COPTS) -c -o undomounts.o undomounts.c
+
+shutdown.o: shutdown.c
+ $(CC) $(COPTS) $(SHUTDOWNOPTS) -c -o shutdown.o shutdown.c
+
mkctype: mkctype.c
$(REALCC) $(COPTS) -o mkctype mkctype.c
diff --git a/loader2/devt.h b/loader2/devt.h
new file mode 100644
index 000000000..03dc4c472
--- /dev/null
+++ b/loader2/devt.h
@@ -0,0 +1,32 @@
+/*
+ * devt.h: handle declaration of dev_t to be sane for loopback purposes
+ *
+ * Copyright 1996 - 2003 Red Hat, Inc.
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * public license.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef DEVT_H
+#define DEVT_H
+
+/* Need to tell loop.h what the actual dev_t type is. */
+#undef dev_t
+#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__))
+#define dev_t unsigned int
+#else
+#if defined(__x86_64__)
+#define dev_t unsigned long
+#else
+#define dev_t unsigned short
+#endif
+#endif
+#include <linux/loop.h>
+#undef dev_t
+#define dev_t dev_t
+
+#endif
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 950dd0c50..8b2442be5 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -32,6 +32,7 @@
#include "moduleinfo.h"
#include "windows.h"
#include "hardware.h"
+#include "driverdisk.h"
#include "../isys/isys.h"
#include "../isys/imount.h"
diff --git a/loader2/driverdisk.h b/loader2/driverdisk.h
index 1e81d9d9e..58d6d72bc 100644
--- a/loader2/driverdisk.h
+++ b/loader2/driverdisk.h
@@ -1,6 +1,7 @@
#ifndef DRIVERDISK_H
#define DRIVERDISK_H
+#include "loader.h"
#include "modules.h"
#include "moduledeps.h"
#include "moduleinfo.h"
diff --git a/loader2/hardware.c b/loader2/hardware.c
index 14ad47525..509fd4cb5 100644
--- a/loader2/hardware.c
+++ b/loader2/hardware.c
@@ -204,6 +204,18 @@ void updateKnownDevices(struct knownDevices * kd) {
kdFindNetList(kd, 0);
}
+int probeiSeries(moduleInfoSet modInfo, moduleList modLoaded,
+ moduleDeps modDeps, struct knownDevices * kd, int flags) {
+ /* this is a hack since we can't really probe on iSeries */
+#ifdef __powerpc__
+ if (!access("/proc/iSeries", X_OK)) {
+ mlLoadModuleSet("veth:viodasd:viocd", modLoaded, modDeps, modInfo, flags);
+ updateKnownDevices(kd);
+ }
+#endif
+ return 0;
+}
+
int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
int justProbe, struct knownDevices * kd, int flags) {
int i;
@@ -215,6 +227,9 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
initializePcmciaController(modLoaded, modDeps, modInfo, flags);
if (FL_NOPROBE(flags)) return 0;
+
+ /* we can't really *probe* on iSeries, but we can pretend */
+ probeiSeries(modInfo, modLoaded, modDeps, kd, flags);
if (canProbeDevices()) {
/* autodetect whatever we can */
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index fc05f21ba..54ccec89f 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -199,6 +199,17 @@ static int loadHDImages(char * prefix, char * dir, int flags,
return 1;
}
+ if (!verifyStamp(mntpoint)) {
+ char * buf;
+ buf = sdupprintf(_("The %s installation tree in that directory does "
+ "not seem to match your boot media."),
+ getProductName());
+
+ newtWinMessage(_("Error"), _("OK"), buf);
+ umountLoopback(mntpoint, device);
+ return 1;
+ }
+
/* handle updates.img now before we copy stage2 over... this allows
* us to keep our ramdisk size as small as possible */
sprintf(path, "%s/%s/RedHat/base/updates.img", prefix, dir ? dir : "");
diff --git a/loader2/init.c b/loader2/init.c
index 9a33cd326..a5341f7fb 100644
--- a/loader2/init.c
+++ b/loader2/init.c
@@ -5,7 +5,7 @@
*
* Erik Troan (ewt@redhat.com)
*
- * Copyright 1996 - 2002 Red Hat Software
+ * Copyright 1996 - 2003 Red Hat, Inc.
*
* This software may be freely redistributed under the terms of the GNU
* public license.
@@ -46,27 +46,11 @@
#include <sys/reboot.h>
#include <termios.h>
-/* Need to tell loop.h what the actual dev_t type is. */
-#undef dev_t
-#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__))
-#define dev_t unsigned int
-#else
-#define dev_t unsigned short
-#endif
-#include <linux/loop.h>
-#undef dev_t
-#define dev_t dev_t
+#include "devt.h"
#define syslog klogctl
#endif
-struct unmountInfo {
- char * name;
- int mounted;
- int loopDevice;
- enum { FS, LOOP } what;
-} ;
-
#include <linux/cdrom.h>
#ifndef MS_REMOUNT
@@ -111,6 +95,8 @@ char * env[] = {
*/
int testing=0;
+void unmountFilesystems(void);
+void disableSwap(void);
int mystrstr(char *str1, char *str2) {
char *p;
@@ -134,7 +120,7 @@ int mystrstr(char *str1, char *str2) {
return rc;
}
-void printstr(char * string) {
+static void printstr(char * string) {
write(1, string, strlen(string));
}
@@ -364,190 +350,6 @@ int setupTerminal(int fd) {
return 0;
}
-void undoLoop(struct unmountInfo * fs, int numFs, int this);
-
-void undoMount(struct unmountInfo * fs, int numFs, int this) {
- int len = strlen(fs[this].name);
- int i;
-
- if (!fs[this].mounted) return;
- fs[this].mounted = 0;
-
- /* unmount everything underneath this */
- for (i = 0; i < numFs; i++) {
- if (fs[i].name && (strlen(fs[i].name) >= len) &&
- (fs[i].name[len] == '/') &&
- !strncmp(fs[this].name, fs[i].name, len)) {
- if (fs[i].what == LOOP)
- undoLoop(fs, numFs, i);
- else
- undoMount(fs, numFs, i);
- }
- }
-
- printf("\t%s", fs[this].name);
- /* don't need to unmount /tmp. it is busy anyway. */
- if (!testing) {
- if (umount2(fs[this].name, 0) < 0) {
- printf(" umount failed (%d)", errno);
- } else {
- printf(" done");
- }
- }
- printf("\n");
-}
-
-void undoLoop(struct unmountInfo * fs, int numFs, int this) {
- int i;
- int fd;
-
- if (!fs[this].mounted) return;
- fs[this].mounted = 0;
-
- /* find the device mount */
- for (i = 0; i < numFs; i++) {
- if (fs[i].what == FS && (fs[i].loopDevice == fs[this].loopDevice))
- break;
- }
-
- if (i < numFs) {
- /* the device is mounted, unmount it (and recursively, anything
- * underneath) */
- undoMount(fs, numFs, i);
- }
-
- unlink("/tmp/loop");
- mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | fs[this].loopDevice);
- printf("\tdisabling /dev/loop%d", fs[this].loopDevice);
- if ((fd = open("/tmp/loop", O_RDONLY, 0)) < 0) {
- printf(" failed to open device: %d", errno);
- } else {
- if (!testing && ioctl(fd, LOOP_CLR_FD, 0))
- printf(" LOOP_CLR_FD failed: %d", errno);
- close(fd);
- }
-
- printf("\n");
-}
-
-void unmountFilesystems(void) {
- int fd, size;
- char buf[65535]; /* this should be big enough */
- char * chptr, * start;
- struct unmountInfo filesystems[500];
- int numFilesystems = 0;
- int i;
- struct loop_info li;
- char * device;
- struct stat sb;
-
- fd = open("/proc/mounts", O_RDONLY, 0);
- if (fd < 1) {
- /* FIXME: was perror */
- printstr("failed to open /proc/mounts");
- sleep(2);
- return;
- }
-
- size = read(fd, buf, sizeof(buf) - 1);
- buf[size] = '\0';
-
- close(fd);
-
- chptr = buf;
- while (*chptr) {
- device = chptr;
- while (*chptr != ' ') chptr++;
- *chptr++ = '\0';
- start = chptr;
- while (*chptr != ' ') chptr++;
- *chptr++ = '\0';
-
- if (strcmp(start, "/") && strcmp(start, "/tmp")) {
- filesystems[numFilesystems].name = strdup(start);
- filesystems[numFilesystems].what = FS;
- filesystems[numFilesystems].mounted = 1;
-
- stat(start, &sb);
- if ((sb.st_dev >> 8) == 7) {
- filesystems[numFilesystems].loopDevice = sb.st_dev & 0xf;
- } else {
- filesystems[numFilesystems].loopDevice = -1;
- }
-
- numFilesystems++;
- }
-
- while (*chptr != '\n') chptr++;
- chptr++;
- }
-
- for (i = 0; i < 7; i++) {
- unlink("/tmp/loop");
- mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | i);
- if ((fd = open("/tmp/loop", O_RDONLY, 0)) >= 0) {
- if (!ioctl(fd, LOOP_GET_STATUS, &li) && li.lo_name[0]) {
- filesystems[numFilesystems].name = strdup(li.lo_name);
- filesystems[numFilesystems].what = LOOP;
- filesystems[numFilesystems].mounted = 1;
- filesystems[numFilesystems].loopDevice = i;
- numFilesystems++;
- }
-
- close(fd);
- }
- }
-
- for (i = 0; i < numFilesystems; i++) {
- if (filesystems[i].what == LOOP) {
- undoLoop(filesystems, numFilesystems, i);
- }
- }
-
- for (i = 0; i < numFilesystems; i++) {
- if ((filesystems[i].mounted) && (filesystems[i].name)) {
- undoMount(filesystems, numFilesystems, i);
- }
- }
-
- for (i = 0; i < numFilesystems; i++)
- free(filesystems[i].name);
-}
-
-void disableSwap(void) {
- int fd;
- char buf[4096];
- int i;
- char * start;
- char * chptr;
-
- if ((fd = open("/proc/swaps", O_RDONLY, 0)) < 0) return;
-
- i = read(fd, buf, sizeof(buf) - 1);
- close(fd);
- if (i < 0) return;
- buf[i] = '\0';
-
- start = buf;
- while (*start) {
- while (*start != '\n' && *start) start++;
- if (!*start) return;
-
- start++;
- if (*start != '/') return;
- chptr = start;
- while (*chptr && *chptr != ' ') chptr++;
- if (!(*chptr)) return;
- *chptr = '\0';
- printf("\t%s", start);
- if (swapoff(start))
- printf(" failed (%d)", errno);
- printf("\n");
-
- start = chptr + 1;
- }
-}
-
void ejectCdrom(void) {
int ejectfd;
struct stat sb;
@@ -831,45 +633,7 @@ int main(int argc, char **argv) {
if (testing)
exit(0);
- sync(); sync();
-
- if (!testing && !noKill) {
- printf("sending termination signals...");
- kill(-1, 15);
- sleep(2);
- printf("done\n");
-
- printf("sending kill signals...");
- kill(-1, 9);
- sleep(2);
- printf("done\n");
- }
-
- printf("disabling swap...\n");
- disableSwap();
-
- printf("unmounting filesystems...\n");
- unmountFilesystems();
-
- if (doReboot) {
- printf("rebooting system\n");
- sleep(2);
-
-#if USE_MINILIBC
- reboot(0xfee1dead, 672274793, 0x1234567);
-#else
-# ifdef __alpha__
- reboot(RB_HALT_SYSTEM);
-# else
- reboot(RB_AUTOBOOT);
-# endif
-#endif
- } else {
- printf("you may safely reboot your system\n");
- while (1);
- }
-
- exit(0);
+ shutDown(noKill, doReboot);
return 0;
}
diff --git a/loader2/kickstart.c b/loader2/kickstart.c
index 34bd2cdfb..47b213d00 100644
--- a/loader2/kickstart.c
+++ b/loader2/kickstart.c
@@ -65,6 +65,8 @@ static void setTextMode(struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr);
static void setGraphicalMode(struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr);
+static void setCmdlineMode(struct loaderData_s * loaderData, int argc,
+ char ** argv, int * flagsPtr);
void loadKickstartModule(struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr);
@@ -80,6 +82,7 @@ struct ksCommandNames ksTable[] = {
{ KS_CMD_LANG, "lang", setKickstartLanguage },
{ KS_CMD_DD, "driverdisk", useKickstartDD },
{ KS_CMD_DEVICE, "device", loadKickstartModule },
+ { KS_CMD_CMDLINE, "cmdline", setCmdlineMode },
{ KS_CMD_NONE, NULL, NULL }
};
@@ -374,6 +377,12 @@ static void setGraphicalMode(struct loaderData_s * loaderData, int argc,
return;
}
+static void setCmdlineMode(struct loaderData_s * loaderData, int argc,
+ char ** argv, int * flagsPtr) {
+ (*flagsPtr) = (*flagsPtr) | LOADER_FLAGS_CMDLINE;
+ return;
+}
+
void setupKickstart(struct loaderData_s * loaderData, int * flagsPtr) {
struct ksCommandNames * cmd;
int argc;
diff --git a/loader2/kickstart.h b/loader2/kickstart.h
index ed0781cf2..4cfe1bc00 100644
--- a/loader2/kickstart.h
+++ b/loader2/kickstart.h
@@ -14,7 +14,8 @@
#define KS_CMD_LANG 8
#define KS_CMD_DD 9
#define KS_CMD_DEVICE 10
-#define KS_CMD_GRAPHICAL 11
+#define KS_CMD_CMDLINE 11
+#define KS_CMD_GRAPHICAL 12
int ksReadCommands(char * cmdFile, int flags);
int ksGetCommand(int cmd, char ** last, int * argc, char *** argv);
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index 99ce5fd26..bf35849da 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -28,13 +28,6 @@ VERSION=1.01
export TEXTDOMAIN=s390installer
export TEXTDOMAINDIR=/usr/lib/locale
-debugshell()
-{
- echo $"You have defined DEBUG, so here is a shell. You can use 'exit'"
- echo $"to go on with the normal installation process."
- /bin/sh
-}
-
startinetd()
{
echo
@@ -47,11 +40,14 @@ startinetd()
/sbin/xinetd -stayalive -reuse -pidfile /tmp/xinetd.pid
/sbin/sshd
- while : ; do
- echo
- echo $"Please connect now to $IPADDR and start 'loader' from this shell."
- ls -l /bin/sh | grep -q bash && /bin/sh --login || /bin/sh -l
- done
+ if [ -z "$RUNKS" ]; then
+ while : ; do
+ echo
+ echo $"Please connect now to $IPADDR and start 'loader' from this shell."
+ /bin/sh --login
+ [ $? = 0 ] || break
+ done
+ fi
}
S390ARCH=`uname -m`
@@ -79,11 +75,17 @@ export HOME
PYTHONPATH=/tmp/updates
export PYTHONPATH
-# limit output on x3270 console
+# remount root fs rw
+mount /dev/root / -o remount,rw
+
mount -t proc none /proc
mount -t devpts /dev/pts /dev/pts
+# limit output on x3270 console
echo "1 4 1 1" > /proc/sys/kernel/printk
+# make /tmp/ramfs
+mount -t ramfs none /tmp
+
mkdir /OCO
mount -t ext2 /dev/ram /OCO >/dev/null 2>&1
# if there is no second initrd, remove mountpoint because
@@ -95,50 +97,10 @@ fi
ifconfig lo 127.0.0.1 netmask 255.0.0.0
route add -host 127.0.0.1 dev lo 2>/dev/null
-[ -n "$DEBUG" ] && debugshell
-
LO=""
[ -L /sbin/insmod ] && LO=".o"
-# read in configuration as set by the parm file
-if [ -n "$HOST" ]; then
- set -- `echo $HOST |sed 's/:/ /g'`
- HOSTNAME=$1
- DEVICE=$2
- NETTYPE=`echo $DEVICE |sed -e 's/[0-9].*//'`
- IPADDR=$3
- if [ ":$NETTYPE" = ":iucv" ]; then
- IUCV="iucv=$4"
- GATEWAY=$5
- MTU=$6
- elif [ ":$NETTYPE" = ":ctc" -o ":$NETTYPE" = ":escon" ]; then
- GATEWAY=$4
- MTU=$5
- else
- echo $4 | grep -q "\." && MTU=$4 || echo "Invalid MTU $4, skipping"
- fi
-fi
-if [ -n "$MTU" ]; then
- MMTU="mtu $MTU"
-else
- if [ "$NETTYPE" = "ctc" ]; then
- MMTU="mtu 4096"
- MTU="4096"
- IMTU="1"
- fi
-fi
-if [ -n "$NETWORK" ]; then
- set -- `echo $NETWORK | sed 's/:/ /g'`
- NETWORKIP=$1
- NETMASK=$2
- BROADCAST=$3
- if [ ":$NETTYPE" != ":ctc" -a ":$NETTYPE" != ":iucv" -a ":$NETTYPE" != ":escon" ]; then
- GATEWAY=$4
- fi
-fi
-
-
# Parse configuration
# Check for missing parameters, prompt for them if necessary
while [ -z "$HOSTNAME" ]; do
@@ -204,56 +166,58 @@ if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ] || [ ":$NETTYPE" = ":hsi"
echo $"Enter the broadcast address for the new Linux guest:"
read BROADCAST
done
-fi
-
-if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ] || [ ":$NETTYPE" = ":hsi" ]; then
- while [ -z "$GATEWAY" ]; do
- echo $"Please enter your default gateway:"
- read GATEWAY
- done
- if echo "$CHANDEV" |grep -q "lcs"; then
- LCS="on"
- fi
- # qeth and nettype!= eth is hipersockets !
- if echo "$CHANDEV" |grep -q "qeth"; then
- if echo "$NETTYPE" |grep -q "eth"; then
- QETH="on"
- elif echo "$NETTYPE" |grep -q "hsi"; then
- HSI="on"
- elif echo "$NETTYPE" |grep -q "tr"; then
- TR="on"
- fi
- fi
+ while [ -z "$GATEWAY" ]; do
+ echo $"Please enter your default gateway:"
+ read GATEWAY
+ done
+ if echo "$CHANDEV" |grep -q "lcs"; then
+ LCS="on"
+ fi
+ # qeth and nettype!= eth is hipersockets !
+ if echo "$CHANDEV" |grep -q "qeth"; then
+ if echo "$NETTYPE" |grep -q "eth"; then
+ QETH="on"
+ elif echo "$NETTYPE" |grep -q "hsi"; then
+ HSI="on"
+ elif echo "$NETTYPE" |grep -q "tr"; then
+ TR="on"
+ fi
+ fi
else # ctc0, escon0, iucv0
- while [ -z "$GATEWAY" ]; do
- echo $"Enter the IP of your ctc/escon/iucv point-to-point partner:"
- read GATEWAY
- done
- if [ "$NETTYPE" = "ctc" ]; then
- MMTU="mtu 4096"
- MTU="4096"
- IMTU="1"
- else
- echo $"Enter the maximal transfer unit (MTU) for this connection or leave empty:"
- read MTU
- if [ -n "$MTU" ]; then
- MMTU="mtu 4096"
- fi
- fi
+ while [ -z "$GATEWAY" ]; do
+ echo $"Enter the IP of your ctc/escon/iucv point-to-point partner:"
+ read GATEWAY
+ done
- if [ ":$NETTYPE" = ":iucv" ]; then
- while [ -z "$IUCV" ]; do
- echo $"Enter iucv kernel module options (usually iucv=HOST,"
- echo $"where HOST is TCPIP for VM, \$TCPIP for VIF):"
- read IUCV
- done
- fi
+ if [ "$NETTYPE" = "ctc" ]; then
+# if [ -z "$MTU" ]; then
+# echo $"Enter the maximal transfer unit (MTU) for this connection or leave empty:"
+# read MTU
+# fi
+ if [ -z "$MTU" ]; then
+ MTU="1500"
+ fi
+ MMTU="mtu 1500" # always use mtu 1500 for the installer
+ fi
+ if [ ":$NETTYPE" = ":iucv" ]; then
+ while [ -z "$IUCV" ]; do
+ echo $"Enter iucv kernel module options (usually iucv=HOST,"
+ echo $"where HOST is TCPIP for VM, \$TCPIP for VIF):"
+ read IUCV
+ done
+ fi
+fi
+# don't ask for MTU, but use it if it has been set in the .parm file
+# don't overwrite MMTU if it has been set for CTC
+if [ -n "$MTU" -a -z "$MMTU" ]; then
+ MMTU="mtu $MTU"
fi
# configure network-interface
KERNELVERSION=`cat /proc/version | awk '{ print $3 }'`
if [ ":$NETTYPE" = ":ctc" -o ":$NETTYPE" = ":escon" ]; then
- insmod ctc$LO $CTC
+ insmod fsm$LO
+ insmod ctc$LO
ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY
route add -host $IPADDR dev $DEVICE 2>/dev/null
elif [ ":$NETTYPE" = ":iucv" ]; then
@@ -270,7 +234,7 @@ else # lcs, tr, qeth, hsi or older kernel without opensource-lcs
if [ "$?" = "1" ]; then
echo $"warning: no lcs module found in the first initrd, "
echo $" looking for second initrd"
- else
+ else
ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
fi
@@ -317,8 +281,6 @@ fi
ifconfig -a
route -n
-[ -n "$DEBUG" ] && debugshell
-
echo $"Starting portmap."
portmap
@@ -338,13 +300,6 @@ if [ "$?" != "0" ]; then
insmod ext3$LO
fi
-
-# Don't add MTU to the installed system's config. It was
-# set to 4096 for the installer only
-if [ "$IMTU" = "1" ]; then
- MTU=
-fi
-
# transfer options into install environment
cat > /tmp/install.cfg << EOF
LANG="$LANG"
@@ -362,23 +317,18 @@ MTU="$MTU"
NETWORK="$NETWORK"
NETMASK="$NETMASK"
BROADCAST="$BROADCAST"
-INTERACTIVE="$INTERACTIVE"
DNS="$DNS"
SEARCHDNS="$SEARCHDNS"
-FORCEDASDFORMAT="$FORCEDASDFORMAT"
LCS="$LCS"
QETH="$QETH"
HSI="$HSI"
TR="$TR"
IUCV="$IUCV"
-CTC="$CTC"
-ROOTPW="$ROOTPW"
-CROOTPW="$CROOTPW"
ONBOOT="yes"
export LANG CHANDEV QETHPARM S390ARCH TEXTDOMAIN TEXTDOMAINDIR HSI
export HOSTNAME DEVICE NETTYPE IPADDR GATEWAY MTU
export NETWORK NETMASK BROADCAST DNS SEARCHDNS
-export LCS QETH IUCV ROOTPW CROOTPW ONBOOT
+export LCS QETH IUCV ONBOOT
export TR
EOF
# immediately read it in again to export these into the shell below
@@ -406,13 +356,20 @@ PYTHONPATH=$PYTHONPATH
export LD_LIBRARY_PATH PATH HOME PYTHONPATH
EOF
-echo $DEVICE | grep ctc && echo "REMIP=$GATEWAY" >> /tmp/netinfo
-echo $DEVICE | grep ctc && echo "export REMIP=$GATEWAY" >> /etc/profile
+if [ "$NETTYPE" = "ctc" ]; then
+ echo "REMIP=$GATEWAY" >> /tmp/netinfo
+ echo "export REMIP=$GATEWAY" >> /etc/profile
+fi
-[ -n "$DEBUG" ] && debugshell
+# I'm tired of typing this out...
+echo "loader" >> /.bash_history
startinetd
+if [ -n "$RUNKS" ]; then
+ /sbin/loader
+fi
+
umount -a
umount /proc
diff --git a/loader2/loader.c b/loader2/loader.c
index 5cffc538e..3ef520a8c 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -93,15 +93,13 @@ static int newtRunning = 0;
#endif
static struct installMethod installMethods[] = {
-#if defined(INCLUDE_LOCAL)
+#if !defined(__s390__) && !defined(__s390x__)
{ N_("Local CDROM"), "cdrom", 0, CLASS_CDROM, mountCdromImage },
- { N_("Hard drive"), "hd", 0, CLASS_HD, mountHardDrive },
#endif
-#if defined(INCLUDE_NETWORK)
+ { N_("Hard drive"), "hd", 0, CLASS_HD, mountHardDrive },
{ N_("NFS image"), "nfs", 1, CLASS_NETWORK, mountNfsImage },
{ "FTP", "ftp", 1, CLASS_NETWORK, mountUrlImage },
{ "HTTP", "http", 1, CLASS_NETWORK, mountUrlImage },
-#endif
};
static int numMethods = sizeof(installMethods) / sizeof(struct installMethod);
@@ -359,7 +357,7 @@ static void checkForHardDrives(struct knownDevices * kd, int * flagsPtr) {
return;
}
-static writeVNCPasswordFile(char *pfile, char *password) {
+static void writeVNCPasswordFile(char *pfile, char *password) {
FILE *f;
f = fopen(pfile, "w+");
@@ -367,6 +365,38 @@ static writeVNCPasswordFile(char *pfile, char *password) {
fclose(f);
}
+/* read information that's passed as environmental variables */
+static void readEnvVars(int flags, struct loaderData_s ** ld) {
+ struct loaderData_s * loaderData = *ld;
+ char * env;
+
+ env = getenv("IPADDR");
+ if (env && *env) {
+ loaderData->ip = strdup(env);
+ loaderData->ipinfo_set = 1;
+ }
+ env = getenv("NETMASK");
+ if (env && *env) {
+ loaderData->netmask = strdup(env);
+ }
+ env = getenv("GATEWAY");
+ if (env && *env) {
+ loaderData->gateway = strdup(env);
+ }
+ env = getenv("DNS");
+ if (env && *env) {
+ loaderData->dns = strdup(env);
+ }
+ env = getenv("MTU");
+ if (env && *env) {
+ loaderData->mtu = atoi(env);
+ }
+ env = getenv("REMIP");
+ if (env && *env) {
+ loaderData->ptpaddr = strdup(env);
+ }
+}
+
/* parses /proc/cmdline for any arguments which are important to us.
* NOTE: in test mode, can specify a cmdline with --cmdline
*/
@@ -421,6 +451,8 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
flags |= LOADER_FLAGS_TEXT;
else if (!strcasecmp(argv[i], "graphical"))
flags |= LOADER_FLAGS_GRAPHICAL;
+ else if (!strcasecmp(argv[i], "cmdline"))
+ flags |= LOADER_FLAGS_CMDLINE;
else if (!strcasecmp(argv[i], "updates"))
flags |= LOADER_FLAGS_UPDATES;
else if (!strcasecmp(argv[i], "isa"))
@@ -471,7 +503,6 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
/* the anaconda script, but don't want to represent as a */
/* LOADER_FLAGS_XXX since loader doesn't care about these */
/* particular options. */
-
/* do vncpassword case first */
if (!strncasecmp(argv[i], "vncpassword=", 12)) {
if (!FL_TESTING(flags))
@@ -481,6 +512,7 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
!strncasecmp(argv[i], "skipddc", 7) ||
!strncasecmp(argv[i], "nomount", 7) ||
!strncasecmp(argv[i], "vnc", 3)) {
+ !strncasecmp(argv[i], "headless", 8)) {
int arglen;
arglen = strlen(argv[i])+3;
@@ -496,6 +528,8 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
}
}
+ readEnvVars(flags, &loaderData);
+
/* NULL terminates the array of extra args */
extraArgs[numExtraArgs] = NULL;
@@ -617,7 +651,7 @@ static char *doLoaderMain(char * location,
validMethods[numValidMethods] = i;
/* have we preselected this to be our install method? */
- if (loaderData->method &&
+ if (loaderData->method && *loaderData->method &&
!strcmp(loaderData->method, installMethods[i].shortname)) {
methodNum = numValidMethods;
}
@@ -986,7 +1020,7 @@ int main(int argc, char ** argv) {
checkForRam(flags);
- mlLoadModuleSet("cramfs:vfat:nfs:loop", modLoaded, modDeps,
+ mlLoadModuleSet("cramfs:vfat:nfs:loop:isofs", modLoaded, modDeps,
modInfo, flags);
/* now let's do some initial hardware-type setup */
@@ -1181,6 +1215,8 @@ int main(int argc, char ** argv) {
*argptr++ = "-T";
else if (FL_GRAPHICAL(flags))
*argptr++ = "--graphical";
+ if (FL_CMDLINE(flags))
+ *argptr++ = "-C";
if (FL_EXPERT(flags))
*argptr++ = "--expert";
diff --git a/loader2/loader.h b/loader2/loader.h
index 4a7f940b7..4e981b60e 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -35,7 +35,8 @@
#define LOADER_FLAGS_NOPARPORT (1 << 25)
#define LOADER_FLAGS_NOIEEE1394 (1 << 26)
#define LOADER_FLAGS_NOFB (1 << 27)
-#define LOADER_FLAGS_GRAPHICAL (1 << 28)
+#define LOADER_FLAGS_CMDLINE (1 << 28)
+#define LOADER_FLAGS_GRAPHICAL (1 << 29)
#define FL_TESTING(a) ((a) & LOADER_FLAGS_TESTING)
#define FL_EXPERT(a) ((a) & LOADER_FLAGS_EXPERT)
@@ -69,7 +70,7 @@
#define FL_NOIEEE1394(a) ((a) & LOADER_FLAGS_NOIEEE1394)
#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
#define FL_GRAPHICAL(a) ((a) & LOADER_FLAGS_GRAPHICAL)
-
+#define FL_CMDLINE(a) ((a) & LOADER_FLAGS_CMDLINE)
void startNewt(int flags);
@@ -89,7 +90,8 @@ struct loaderData_s {
int kbd_set;
char * netDev;
int netDev_set;
- char * ip, * netmask, *gateway, *dns, *hostname;
+ char * ip, * netmask, *gateway, *dns, *hostname, *ptpaddr;
+ int mtu;
int noDns;
int ipinfo_set;
char * ksFile;
diff --git a/loader2/loadermisc.h b/loader2/loadermisc.h
index 3e673d6e5..d44676cbd 100644
--- a/loader2/loadermisc.h
+++ b/loader2/loadermisc.h
@@ -7,6 +7,6 @@ int copyFile(char * source, char * dest);
int copyFileFd(int infd, char * dest);
char * readLine(FILE * f);
int simpleStringCmp(const void * a, const void * b);
-char * sdupprintf(const char *format, ...);
+char * sdupprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
#endif
diff --git a/loader2/log.h b/loader2/log.h
index a8bafa38d..6a7da0d77 100644
--- a/loader2/log.h
+++ b/loader2/log.h
@@ -6,7 +6,7 @@
extern FILE * log;
extern int logfd;
-void logMessage(const char * s, ...);
+void logMessage(const char * s, ...) __attribute__ ((format (printf, 1, 2)));;
void openLog(int useLocal);
void closeLog(void);
void setLogLevel(int level);
diff --git a/loader2/method.c b/loader2/method.c
index b2a4ecc5f..130d920ca 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -39,22 +39,7 @@
#include "../isys/imount.h"
#include "../isys/isys.h"
-
-/* JKFIXME: this is a pile of crap... should at least only be done once */
-/* Need to tell loop.h what the actual dev_t type is. */
-#undef dev_t
-#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__))
-#define dev_t unsigned int
-#else
-#if defined(__x86_64__)
-#define dev_t unsigned long
-#else
-#define dev_t unsigned short
-#endif
-#endif
-#include <linux/loop.h>
-#undef dev_t
-#define dev_t dev_t
+#include "devt.h"
#include "nfsinstall.h"
#include "hdinstall.h"
@@ -107,7 +92,7 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
devMakeInode(device, filename);
loopfd = open(filename, O_RDONLY);
if (loopfd == -1) {
- logMessage("unable to open loop device", filename);
+ logMessage("unable to open loop device %s", filename);
return LOADER_ERROR;
}
logMessage("mntloop %s on %s as %s fd is %d",
@@ -115,6 +100,7 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
if (ioctl(loopfd, LOOP_SET_FD, targfd)) {
logMessage("LOOP_SET_FD failed: %s", strerror(errno));
+ ioctl(loopfd, LOOP_CLR_FD, 0);
close(targfd);
close(loopfd);
return LOADER_ERROR;
@@ -139,9 +125,9 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
0, NULL, NULL, 0)) {
if (doPwMount(filename, mntpoint, "cramfs", 1,
0, NULL, NULL, 0)) {
-
logMessage("failed to mount loop: %s",
strerror(errno));
+ ioctl(loopfd, LOOP_CLR_FD, 0);
return LOADER_ERROR;
}
}
@@ -597,7 +583,7 @@ int copyFileAndLoopbackMount(int fd, char * dest, int flags,
rc = copyFileFd(fd, dest);
stat(dest, &sb);
- logMessage("copied %d bytes to %s (%s)", sb.st_size, dest,
+ logMessage("copied %lld bytes to %s (%s)", sb.st_size, dest,
((rc) ? " incomplete" : "complete"));
if (rc) {
diff --git a/loader2/module-info b/loader2/module-info
index d154e77f7..832b4b5e0 100644
--- a/loader2/module-info
+++ b/loader2/module-info
@@ -432,7 +432,7 @@ sunqe
tg3
eth
- "Broadcom Tigon3 ethernet driver"
+ "Broadcom Tigon3 Ethernet"
tlan
eth
@@ -499,6 +499,28 @@ ctc
eth
"S/390 Channel to Channel"
+# iSeries
+veth
+ eth
+ "iSeries Virtual Ethernet"
+
+# Mac stuff
+bmac
+ eth
+ "Apple BMAC/BMAC+"
+
+mace
+ eth
+ "Apple MACE"
+
+sungem
+ eth
+ "Apple GMAC"
+
+airport
+ eth
+ "Apple Airport"
+
# NOT YET MODULARIZED!
#znet
diff --git a/loader2/modules.c b/loader2/modules.c
index 0cc7c1b50..b0df111ee 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -281,7 +281,7 @@ static int loadModule(const char * modName, struct extractedModule * path,
}
if (FL_TESTING(flags)) {
- logMessage("would have insmod %s (%s)", path, fileName);
+ logMessage("would have insmod %s (%s)", path->path, fileName);
rc = 0;
} else {
if (!(child = fork())) {
@@ -503,7 +503,7 @@ static int doLoadModules(const char * origModNames, moduleList modLoaded,
if (loadModule(*l, p, modLoaded,
(argModule && !strcmp(argModule, *l)) ? args : NULL,
modInfo, flags)) {
- logMessage("failed to insert %s", *p);
+ logMessage("failed to insert %s", p->path);
} else {
logMessage("inserted %s", p->path);
}
diff --git a/loader2/net.c b/loader2/net.c
index 432da26d5..0e4fc1925 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -280,6 +280,16 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
cfg->dev.set |= PUMP_NETINFO_HAS_HOSTNAME;
}
+ if (loaderData->mtu) {
+ cfg->dev.mtu = loaderData->mtu;
+ cfg->dev.set |= PUMP_INTFINFO_HAS_MTU;
+ }
+
+ if (loaderData->ptpaddr && (inet_aton(loaderData->ptpaddr, &addr))) {
+ cfg->dev.ptpaddr = addr;
+ cfg->dev.set |= PUMP_INTFINFO_HAS_PTPADDR;
+ }
+
cfg->noDns = loaderData->noDns;
}
@@ -307,8 +317,6 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) {
return 0;
}
- /* JKFIXME: I do NOT like this crap */
-#if !defined(__s390__) && !defined(__s390x__)
text = newtTextboxReflowed(-1, -1,
_("Please enter the IP configuration for this machine. Each "
"item should be entered as an IP address in dotted-decimal "
@@ -446,63 +454,6 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) {
}
} while (i != 2);
-#else /* s390 now */
- char * env;
-
- /* JKFIXME: this is something of a hack... will go away better once
- * we start just reading this into the ip info in loaderdata */
- winStatus(50, 3, _("Setting up networking"),
- _("Setting up networking for %s..."), device, 0);
-
- memset(&newCfg, 0, sizeof(newCfg));
- strcpy(newCfg.dev.device, device);
- newCfg.isDynamic = 0;
- env = getenv("IPADDR");
- if (env && *env) {
- if(inet_aton(env, &newCfg.dev.ip))
- newCfg.dev.set |= PUMP_INTFINFO_HAS_IP;
- }
- env = getenv("NETMASK");
- if (env && *env) {
- if(inet_aton(env, &newCfg.dev.netmask))
- newCfg.dev.set |= PUMP_INTFINFO_HAS_NETMASK;
- }
- env = getenv("GATEWAY");
- if (env && *env) {
- if(inet_aton(env, &newCfg.dev.gateway))
- newCfg.dev.set |= PUMP_NETINFO_HAS_GATEWAY;
- }
- env = getenv("NETWORK");
- if (env && *env) {
- if(inet_aton(env, &newCfg.dev.network))
- newCfg.dev.set |= PUMP_INTFINFO_HAS_NETWORK;
- }
- env = getenv("DNS");
- if (env && *env) {
- char *s = strdup (env);
- char *t = strtok (s, ":");
- if(inet_aton((t? t : s), &newCfg.dev.dnsServers[0]))
- newCfg.dev.set |= PUMP_NETINFO_HAS_DNS;
- }
- env = getenv("BROADCAST");
- if (env && *env) {
- if(inet_aton(env, &newCfg.dev.broadcast))
- newCfg.dev.set |= PUMP_INTFINFO_HAS_BROADCAST;
- }
- env = getenv("MTU");
- if (env && *env) {
- newCfg.dev.mtu = atoi(env);
- newCfg.dev.set |= PUMP_INTFINFO_HAS_MTU;
- }
- env = getenv("REMIP");
- if (env && *env) {
- if (inet_aton(env, &newCfg.dev.ptpaddr))
- newCfg.dev.set |= PUMP_INTFINFO_HAS_PTPADDR;
- }
-
- sleep(1);
-#endif /* s390 */
-
/* preserve extra dns servers for the sake of being nice */
if (cfg->dev.numDns > newCfg.dev.numDns) {
for (i = newCfg.dev.numDns; i < cfg->dev.numDns; i++) {
@@ -538,7 +489,12 @@ int readNetConfig(char * device, struct networkDeviceConfig * cfg, int flags) {
writeResolvConf(cfg);
}
+ /* JKFIXME: this is a hack */
+#if !defined(__s390__) && !defined(__s390x__)
return 0;
+#else
+ return LOADER_NOOP;
+#endif
}
int configureNetwork(struct networkDeviceConfig * dev) {
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index e08339551..6f422ade0 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -118,7 +118,8 @@ char * mountNfsImage(struct installMethod * method,
setupNetworkDeviceConfig(&netDev, loaderData, flags);
rc = readNetConfig(devName, &netDev, flags);
- if (rc) {
+ if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
+ ((dir == -1) && (rc == LOADER_NOOP))) {
stage = NFS_STAGE_IFACE;
dir = -1;
break;
@@ -128,7 +129,7 @@ char * mountNfsImage(struct installMethod * method,
case NFS_STAGE_NFS:
logMessage("going to do nfsGetSetup");
- if (loaderData->method &&
+ if (loaderData->method && *loaderData->method &&
!strncmp(loaderData->method, "nfs", 3) &&
loaderData->methodData) {
host = ((struct nfsInstallData *)loaderData->methodData)->host;
diff --git a/loader2/shutdown.c b/loader2/shutdown.c
new file mode 100644
index 000000000..33dab7bad
--- /dev/null
+++ b/loader2/shutdown.c
@@ -0,0 +1,108 @@
+/*
+ * shutdown.c
+ *
+ * Shutdown a running system. If built with -DAS_SHUTDOWN=1, then
+ * it builds a standalone shutdown binary.
+ *
+ * Copyright 1996 - 2003 Red Hat, Inc.
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * public license.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/reboot.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#ifdef AS_SHUTDOWN
+int testing = 0;
+#else
+extern int testing;
+#endif
+
+void disableSwap(void);
+void unmountFilesystems(void);
+
+
+void shutDown(int noKill, int doReboot) {
+ sync(); sync();
+
+ if (!testing && !noKill) {
+ printf("sending termination signals...");
+ kill(-1, 15);
+ sleep(2);
+ printf("done\n");
+
+ printf("sending kill signals...");
+ kill(-1, 9);
+ sleep(2);
+ printf("done\n");
+ }
+
+ printf("disabling swap...\n");
+ disableSwap();
+
+ printf("unmounting filesystems...\n");
+ unmountFilesystems();
+
+ if (doReboot) {
+ printf("rebooting system\n");
+ sleep(2);
+
+#if USE_MINILIBC
+ reboot(0xfee1dead, 672274793, 0x1234567);
+#else
+ reboot(RB_AUTOBOOT);
+#endif
+ } else {
+ printf("you may safely reboot your system\n");
+#if !defined(__s390__) && !defined(__s390x__)
+ while (1);
+#else
+ reboot(RB_HALT_SYSTEM);
+#endif
+ }
+
+ exit(0);
+
+ return;
+}
+
+#ifdef AS_SHUTDOWN
+int main(int argc, char ** argv) {
+ int fd;
+ int doReboot = 0;
+ int i = 1;
+
+ while (i < argc) {
+ if (!strncmp("-r", argv[i], 2))
+ doReboot = 1;
+ i++;
+ }
+
+ /* ignore some signals so we don't kill ourself */
+ signal(SIGINT, SIG_IGN);
+ signal(SIGTSTP, SIG_IGN);
+
+ /* now change to / */
+ chdir("/");
+
+ /* redirect output to the real console */
+ fd = open("/dev/console", O_RDWR);
+ dup2(fd, 0);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ close(fd);
+
+ shutDown(0, doReboot);
+}
+#endif
diff --git a/loader2/undomounts.c b/loader2/undomounts.c
new file mode 100644
index 000000000..07892af57
--- /dev/null
+++ b/loader2/undomounts.c
@@ -0,0 +1,228 @@
+/*
+ * undomounts.c
+ *
+ * Handles some basic unmounting stuff for init
+ * Broken out so that it can be used on s390 in a shutdown binary
+ *
+ * Erik Troan <ewt@redhat.com>
+ * Jeremy Katz <katzj@redhat.com>
+ *
+ * Copyright 1996 - 2003 Red Hat, Inc.
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * public license.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include <sys/stat.h>
+#include <sys/swap.h>
+#include <unistd.h>
+
+#include "devt.h"
+
+struct unmountInfo {
+ char * name;
+ int mounted;
+ int loopDevice;
+ enum { FS, LOOP } what;
+} ;
+
+extern int testing;
+
+void undoLoop(struct unmountInfo * fs, int numFs, int this);
+
+static void printstr(char * string) {
+ write(1, string, strlen(string));
+}
+
+void undoMount(struct unmountInfo * fs, int numFs, int this) {
+ int len = strlen(fs[this].name);
+ int i;
+
+ if (!fs[this].mounted) return;
+ fs[this].mounted = 0;
+
+ /* unmount everything underneath this */
+ for (i = 0; i < numFs; i++) {
+ if (fs[i].name && (strlen(fs[i].name) >= len) &&
+ (fs[i].name[len] == '/') &&
+ !strncmp(fs[this].name, fs[i].name, len)) {
+ if (fs[i].what == LOOP)
+ undoLoop(fs, numFs, i);
+ else
+ undoMount(fs, numFs, i);
+ }
+ }
+
+ printf("\t%s", fs[this].name);
+ /* don't need to unmount /tmp. it is busy anyway. */
+ if (!testing) {
+ if (umount2(fs[this].name, 0) < 0) {
+ printf(" umount failed (%d)", errno);
+ } else {
+ printf(" done");
+ }
+ }
+ printf("\n");
+}
+
+void undoLoop(struct unmountInfo * fs, int numFs, int this) {
+ int i;
+ int fd;
+
+ if (!fs[this].mounted) return;
+ fs[this].mounted = 0;
+
+ /* find the device mount */
+ for (i = 0; i < numFs; i++) {
+ if (fs[i].what == FS && (fs[i].loopDevice == fs[this].loopDevice))
+ break;
+ }
+
+ if (i < numFs) {
+ /* the device is mounted, unmount it (and recursively, anything
+ * underneath) */
+ undoMount(fs, numFs, i);
+ }
+
+ unlink("/tmp/loop");
+ mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | fs[this].loopDevice);
+ printf("\tdisabling /dev/loop%d", fs[this].loopDevice);
+ if ((fd = open("/tmp/loop", O_RDONLY, 0)) < 0) {
+ printf(" failed to open device: %d", errno);
+ } else {
+ if (!testing && ioctl(fd, LOOP_CLR_FD, 0))
+ printf(" LOOP_CLR_FD failed: %d", errno);
+ close(fd);
+ }
+
+ printf("\n");
+}
+
+void unmountFilesystems(void) {
+ int fd, size;
+ char buf[65535]; /* this should be big enough */
+ char * chptr, * start;
+ struct unmountInfo filesystems[500];
+ int numFilesystems = 0;
+ int i;
+ struct loop_info li;
+ char * device;
+ struct stat sb;
+
+ fd = open("/proc/mounts", O_RDONLY, 0);
+ if (fd < 1) {
+ /* FIXME: was perror */
+ printstr("failed to open /proc/mounts");
+ sleep(2);
+ return;
+ }
+
+ size = read(fd, buf, sizeof(buf) - 1);
+ buf[size] = '\0';
+
+ close(fd);
+
+ chptr = buf;
+ while (*chptr) {
+ device = chptr;
+ while (*chptr != ' ') chptr++;
+ *chptr++ = '\0';
+ start = chptr;
+ while (*chptr != ' ') chptr++;
+ *chptr++ = '\0';
+
+ if (strcmp(start, "/") && strcmp(start, "/tmp")) {
+ filesystems[numFilesystems].name = strdup(start);
+ filesystems[numFilesystems].what = FS;
+ filesystems[numFilesystems].mounted = 1;
+
+ stat(start, &sb);
+ if ((sb.st_dev >> 8) == 7) {
+ filesystems[numFilesystems].loopDevice = sb.st_dev & 0xf;
+ } else {
+ filesystems[numFilesystems].loopDevice = -1;
+ }
+
+ numFilesystems++;
+ }
+
+ while (*chptr != '\n') chptr++;
+ chptr++;
+ }
+
+ for (i = 0; i < 7; i++) {
+ unlink("/tmp/loop");
+ mknod("/tmp/loop", 0600 | S_IFBLK, (7 << 8) | i);
+ if ((fd = open("/tmp/loop", O_RDONLY, 0)) >= 0) {
+ if (!ioctl(fd, LOOP_GET_STATUS, &li) && li.lo_name[0]) {
+ filesystems[numFilesystems].name = strdup(li.lo_name);
+ filesystems[numFilesystems].what = LOOP;
+ filesystems[numFilesystems].mounted = 1;
+ filesystems[numFilesystems].loopDevice = i;
+ numFilesystems++;
+ }
+
+ close(fd);
+ }
+ }
+
+ for (i = 0; i < numFilesystems; i++) {
+ if (filesystems[i].what == LOOP) {
+ undoLoop(filesystems, numFilesystems, i);
+ }
+ }
+
+ for (i = 0; i < numFilesystems; i++) {
+ if ((filesystems[i].mounted) && (filesystems[i].name)) {
+ undoMount(filesystems, numFilesystems, i);
+ }
+ }
+
+ for (i = 0; i < numFilesystems; i++)
+ free(filesystems[i].name);
+}
+
+void disableSwap(void) {
+ int fd;
+ char buf[4096];
+ int i;
+ char * start;
+ char * chptr;
+
+ if ((fd = open("/proc/swaps", O_RDONLY, 0)) < 0) return;
+
+ i = read(fd, buf, sizeof(buf) - 1);
+ close(fd);
+ if (i < 0) return;
+ buf[i] = '\0';
+
+ start = buf;
+ while (*start) {
+ while (*start != '\n' && *start) start++;
+ if (!*start) return;
+
+ start++;
+ if (*start != '/') return;
+ chptr = start;
+ while (*chptr && *chptr != ' ') chptr++;
+ if (!(*chptr)) return;
+ *chptr = '\0';
+ printf("\t%s", start);
+ if (swapoff(start))
+ printf(" failed (%d)", errno);
+ printf("\n");
+
+ start = chptr + 1;
+ }
+}
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 2ce84ce7c..ed4ac80c4 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -211,7 +211,8 @@ char * mountUrlImage(struct installMethod * method,
setupNetworkDeviceConfig(&netDev, loaderData, flags);
rc = readNetConfig(devName, &netDev, flags);
- if (rc) {
+ if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
+ ((dir == -1) && (rc == LOADER_NOOP))) {
stage = URL_STAGE_IFACE;
dir = -1;
break;
@@ -220,7 +221,7 @@ char * mountUrlImage(struct installMethod * method,
dir = 1;
case URL_STAGE_MAIN:
- if (loaderData->method &&
+ if (loaderData->method && *loaderData->method &&
(!strncmp(loaderData->method, "ftp", 3) ||
!strncmp(loaderData->method, "http", 3)) &&
loaderData->methodData) {
diff --git a/loader2/usb.c b/loader2/usb.c
index 028559ebe..bea93d333 100644
--- a/loader2/usb.c
+++ b/loader2/usb.c
@@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include "loader.h"
#include "log.h"
diff --git a/packages.py b/packages.py
index 09f1114a3..c739235c1 100644
--- a/packages.py
+++ b/packages.py
@@ -511,9 +511,6 @@ def setupTimezone(timezone, upgrade, instPath, dir):
def doPreInstall(method, id, intf, instPath, dir):
- if flags.test:
- return
-
if dir == DISPATCH_BACK:
return
@@ -542,7 +539,12 @@ def doPreInstall(method, id, intf, instPath, dir):
if arch == "s390":
if (string.find(os.uname()[2], "tape") > -1):
select(id.hdList, 'kernel-tape')
- elif isys.smpAvailable() or isys.htavailable():
+ elif arch == "ppc" and iutil.getPPCMachine() == "pSeries":
+ select(id.hdList, 'kernel-pseries')
+ elif arch == "ppc" and iutil.getPPCMachine() == "iSeries":
+ select(id.hdList, "kernel-iseries")
+
+ if isys.smpAvailable() or isys.htavailable():
select(id.hdList, 'kernel-smp')
if (id.hdList.has_key('kernel-bigmem')):
@@ -580,10 +582,19 @@ def doPreInstall(method, id, intf, instPath, dir):
select(id.hdList, 'lilo')
elif iutil.getArch() == "i386" and id.bootloader.useGrubVal == 1:
select(id.hdList, 'grub')
+ elif iutil.getArch() == "s390":
+ select(id.hdList, 's390utils')
+ elif iutil.getArch() == "ppc":
+ select(id.hdList, 'yaboot')
+ elif iutil.getArch() == "ia64":
+ select(id.hdList, 'elilo')
if pcmcia.pcicType():
select(id.hdList, 'kernel-pcmcia-cs')
+ if flags.test:
+ return
+
# make sure that all comps that include other comps are
# selected (i.e. - recurse down the selected comps and turn
# on the children
diff --git a/partRequests.py b/partRequests.py
index 9870babaf..680588408 100644
--- a/partRequests.py
+++ b/partRequests.py
@@ -630,8 +630,8 @@ class RaidRequestSpec(RequestSpec):
bootreq = partitions.getBootableRequest()
if not bootreq and self.mountpoint:
# XXX 390 can't have boot on raid
- if ((self.mountpoint == "/boot" or self.mountpoint == "/")
- and not raid.isRaid1(self.raidlevel)):
+ if (self.mountpoint in partitions.getBootableMountpoints()
+ and not raid.isRaid1(self.raidlevel)):
return _("Bootable partitions can only be on RAID1 devices.")
minmembers = raid.get_raid_min_members(self.raidlevel)
diff --git a/partedUtils.py b/partedUtils.py
index 161eebb57..ec0569d0a 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -129,9 +129,11 @@ def get_partition_file_system_type(part):
Return:
Filesystem object (as defined in fsset.py)
"""
- if part.fs_type == None:
+ if part.fs_type is None and part.native_type == 0x41:
+ ptype = fsset.fileSystemTypeGet("PPC PReP Boot")
+ elif part.fs_type == None:
return None
- if part.fs_type.name == "linux-swap":
+ elif part.fs_type.name == "linux-swap":
ptype = fsset.fileSystemTypeGet("swap")
elif (part.fs_type.name == "FAT" or part.fs_type.name == "fat16"
or part.fs_type.name == "fat32"):
@@ -222,6 +224,8 @@ def getDefaultDiskType():
return parted.disk_type_get("bsd")
elif iutil.getArch() == "sparc":
return parted.disk_type_get("sun")
+ elif iutil.getArch() == "ppc":
+ return parted.disk_type_get("msdos")
else:
# XXX fix me for alpha at least
return parted.disk_type_get("msdos")
@@ -231,7 +235,8 @@ archLabels = {'i386': ['msdos'],
's390': ['dasd'],
'alpha': ['bsd', 'msdos'],
'sparc': ['sun'],
- 'ia64': ['msdos', 'gpt']}
+ 'ia64': ['msdos', 'gpt'],
+ 'ppc': ['msdos', 'mac']}
def checkDiskLabel(disk, intf):
"""Check that the disk label on disk is valid for this machine type."""
@@ -362,7 +367,10 @@ def sniffFilesystemType(device):
except:
pass
- # FIXME: we don't look for reiserfs, jfs, or vfat
+ if fsset.isValidReiserFS(dev):
+ return "reiserfs"
+
+ # FIXME: we don't look for jfs, or vfat
return None
@@ -406,6 +414,15 @@ class DiskSet:
mdList = []
def __init__ (self):
self.disks = {}
+ self.onlyPrimary = None
+
+ def onlyPrimaryParts(self):
+ for disk in self.disks.values():
+ if disk.type.check_feature(parted.DISK_TYPE_EXTENDED):
+ return 0
+
+ return 1
+
def startAllRaid(self):
"""Start all of the raid devices associated with the DiskSet."""
@@ -518,9 +535,6 @@ class DiskSet:
if (part.is_active()
and (part.get_flag(parted.PARTITION_RAID)
or part.get_flag(parted.PARTITION_LVM))):
- # skip RAID and LVM partitions.
- # XXX check for raid superblocks on non-autoraid partitions
- # (#32562)
pass
elif (part.fs_type and
part.fs_type.name in fsset.getUsableLinuxFs()):
@@ -625,6 +639,7 @@ class DiskSet:
"-b", "4096",
"-d", "cdl",
"-P",
+ "-F",
"-f",
"/tmp/%s" % drive]
@@ -677,7 +692,7 @@ class DiskSet:
(pid, status) = os.waitpid(childpid, 0)
except OSError, (num, msg):
print __name__, "waitpid:", msg
-
+
os.close(fd)
w and w.pop()
diff --git a/partitioning.py b/partitioning.py
index bb3b6dcf2..0f83cd06e 100644
--- a/partitioning.py
+++ b/partitioning.py
@@ -40,10 +40,6 @@ from rhpl.log import log
def partitionObjectsInitialize(diskset, partitions, dir, intf):
- if iutil.getArch() == "s390":
- partitions.useAutopartitioning = 0
- partitions.useFdisk = 1
-
if dir == DISPATCH_BACK:
diskset.closeDevices()
return
diff --git a/partitions.py b/partitions.py
index 3cb23c54f..4a4bb0955 100644
--- a/partitions.py
+++ b/partitions.py
@@ -631,6 +631,13 @@ class Partitions:
if iutil.getArch() == "ia64":
bootreq = self.getRequestByMountPoint("/boot/efi")
return bootreq
+ elif (iutil.getPPCMachine() == "pSeries" or
+ iutil.getPPCMachine() == "iSeries"):
+ for req in self.requests:
+ if req.fstype == fsset.fileSystemTypeGet("PPC PReP Boot"):
+ return req
+ return None
+
if not bootreq:
bootreq = self.getRequestByMountPoint("/boot")
if not bootreq:
@@ -638,6 +645,15 @@ class Partitions:
return bootreq
+ def getBootableMountpoints(self):
+ """Return a list of bootable valid mountpoints for this arch."""
+ # FIXME: should be somewhere else, preferably some sort of arch object
+
+ if iutil.getArch() == "ia64":
+ return [ "/boot/efi" ]
+ else:
+ return [ "/boot", "/" ]
+
def isBootable(self, request):
"""Returns if the request should be considered a 'bootable' request.
diff --git a/scripts/mk-images b/scripts/mk-images
index 6b74c1849..6fe22fc6a 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -33,7 +33,13 @@ TOPDIR=$(cd $TOPDIR; pwd)
MODDEPS=$KERNELROOT/moddeps
BUILDARCH=$4
- KERNELNAME=vmlinuz
+ if [ "$BUILDARCH" = "ppc" -o "$BUILDARCH" = "ppc64" ]; then
+ KERNELNAME=vmlinux
+ KERNELARCH=ppc64
+ else
+ KERNELNAME=vmlinuz
+ KERNELARCH=$BUILDARCH
+ fi
if [ "$BUILDARCH" = "sparc64" ]; then
BASEARCH=sparc
@@ -41,6 +47,16 @@ TOPDIR=$(cd $TOPDIR; pwd)
BASEARCH=$BUILDARCH
fi
+ # explicit block size setting for some arches (FIXME: we compose
+ # ppc64-ish trees as ppc, so we have to set the "wrong" block size)
+ if [ "$BUILDARCH" = "sparc64" ]; then
+ CRAMBS="--blocksize 8192"
+ elif [ "$BUILDARCH" = "sparc" ]; then
+ CRAMBS="--blocksize 4096"
+ else
+ CRAMBS=""
+ fi
+
if [ ! -d "$1" ]; then
LATEST="rsh porkchop latest --arch $BUILDARCH"
else
@@ -109,7 +125,7 @@ findPackage() {
dir=$1
name=$2
- for n in $dir/$name*{${BUILDARCH},noarch}.rpm; do
+ for n in $dir/$name*{${KERNELARCH},noarch}.rpm; do
thisName=$(rpm --qf '%{NAME}' -qp $n)
if [ -z "$thisName" ]; then
continue
@@ -173,7 +189,11 @@ getmoddeps () {
what=$1
final=$2
- egrep $(echo $what | sed 's/\.o */|^/g;s/\.o$//') $MODDEPS > $final
+ for mod in $what ; do
+ mod=$(echo $mod | sed 's/\.o */|^/g;s/\.o$//;s/.*\///')
+ egrep $mod $MODDEPS >> $final.foo
+ done
+ mv $final.foo $final
}
padfile () {
@@ -194,10 +214,14 @@ intcopymodules () {
echo "Module $n not found in kernel rpm" >&2
else
echo $n >> $MODULESUSED
- echo $n
- if ! cp $m $dir ; then
- echo "Failed to copy $m to $dir (for module $n)"
- fi
+ for o in $m ; do
+ echo $n
+ ver=$(echo $o |cut -d / -f 6)
+ if ! [ -d $dir/$ver ] ; then mkdir $dir/$ver ; fi
+ if ! cp $o $dir/$ver; then
+ echo "Failed to copy $o to $dir/$ver (for module $n)" >&2
+ fi
+ done
fi
done
}
@@ -286,19 +310,16 @@ makemoduleball() {
$MODLIST --modinfo-file $MODINFO --ignore-missing --modinfo \
$MMB_MODULESET > ../$MMB_MODINFO
- getmoddeps "*.o" ../modules.dep
+ getmoddeps "$(find . -name *.o)" ../modules.dep
# create the pcitable
- $TRIMPCITABLE *.o < $PCITABLE > ../pcitable
+ $TRIMPCITABLE $(find . -name *.o -exec basename {} \;) < $PCITABLE > ../pcitable
if [ -n "$MMB_DD" ]; then
echo $MMB_DD > $MMB_DIR/rhdd-6.1
fi
- mkdir $version
- mv *.o $version
-
- find $version -type f | cpio --quiet -H crc -o | gzip -9 > ../$MMB_NAME
+ find . -type f | cpio --quiet -H crc -o | gzip -9 > ../$MMB_NAME
cd ..
rm -rf modules
chmod 644 *
@@ -509,6 +530,8 @@ EOF
$MBD_DIR nst0 c 9 128 666 root:root
$MBD_DIR random c 1 8 644 root:root
$MBD_DIR urandom c 1 9 644 root:root
+ $MBD_DIR nvram c 10 144 644 root:root
+ $MBD_DIR adb c 56 0 644 root:root
EOF
ln -s fb0 $MBD_DIR/dev/fb
@@ -674,7 +697,8 @@ makeinstimage () {
makemoduleball $tmpdir/modules "$modlist"
makeproductfile $tmpdir
- mkcramfs $tmpdir $INSTIMGPATH/${imagename}2.img
+ echo "Running mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img"
+ mkcramfs $CRAMBS $tmpdir $INSTIMGPATH/${imagename}2.img
size=$(ls -l $INSTIMGPATH/${imagename}2.img | awk '{print $5}')
size=$(expr $size / 1024)
echo "Wrote $INSTIMGPATH/${imagename}2.img (${size}k)..."
@@ -719,7 +743,8 @@ makemainimage () {
rmdir $mmi_mntpoint
elif [ $type = "cramfs" ]; then
makeproductfile $IMGPATH
- mkcramfs $IMGPATH $mmi_tmpimage
+ echo "Running mkcramfs $CRAMBS $IMGPATH $mmi_tmpimage"
+ mkcramfs $CRAMBS $IMGPATH $mmi_tmpimage
SIZE=$(expr `cat $mmi_tmpimage | wc -c` / 1024)
fi
@@ -797,10 +822,22 @@ makedriverdisk () {
fi
}
+# source the architecture specific mk-images file so we can call functions
+# in it
+if [ ${BUILDARCH} = s390x ]; then
+ # FIXME: this is a bad hack for s390, but better than copying for now
+ source $TOPDIR/mk-images.s390
+else
+ source $TOPDIR/mk-images.${BUILDARCH}
+fi
+
# Find the kernel, unpack it, and verify it
vertag="BOOT"
if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then
- vertag="BOOT BOOTtape"
+ vertag="dummyvar tape"
+fi
+if [ "$BUILDARCH" = "ppc" -o "$BUILDARCH" = "ppc64" ]; then
+ vertag="pseries iseries"
fi
for kernelvers in $vertag; do
kpackage=$($LATEST $KERNELPATH kernel-$kernelvers)
@@ -845,13 +882,14 @@ for kernelvers in $vertag; do
rundepmod "$allmods" $MODDEPS
rm -f $MODDEPS.foo
+ find $KERNELROOT/lib/modules/$version > $CACHE
- # this is a bad hack, but better than copying for now
- if [ ${BUILDARCH} = s390x ]; then
- . $TOPDIR/mk-images.s390
- else
- . $TOPDIR/mk-images.${BUILDARCH}
- fi
+ # make the boot images
+ makeBootImages
+done
+# make the second stage
+find $KERNELROOT/lib/modules/ > $CACHE
+makeSecondStage
rm -rf $KERNELROOT
-done
+
diff --git a/scripts/mk-images.alpha b/scripts/mk-images.alpha
index c6395684c..ea8569c0e 100644
--- a/scripts/mk-images.alpha
+++ b/scripts/mk-images.alpha
@@ -40,12 +40,12 @@ EOF
mount -o loop -t ext2 $MBD_TMPIMAGE $MBD_BOOTTREE
}
+makeBootImages() {
+ mkdir -p $TOPDESTPATH/boot
+ cp $BOOTDISKDIR/bootlx $TOPDESTPATH/boot
-mkdir -p $TOPDESTPATH/boot
-cp $BOOTDISKDIR/bootlx $TOPDESTPATH/boot
-
-mkdir -p $TOPDESTPATH/etc
-cat > $TOPDESTPATH/etc/aboot.cfg <<EOF
+ mkdir -p $TOPDESTPATH/etc
+ cat > $TOPDESTPATH/etc/aboot.cfg <<EOF
#
# Red Hat Linux/Alpha aboot configuration options:
#
@@ -61,47 +61,37 @@ cat > $TOPDESTPATH/etc/aboot.cfg <<EOF
EOF
-makeinitrd --initrdto $TOPDESTPATH/images/ramdisk.img \
- --initrdsize 4096 \
- --padsize 1440 \
- --loaderbin loader \
- --modules "$NETMODULES $SCSIMODULES"
-
-makeinitrd --initrdto $TOPDESTPATH/images/cdrom.img \
- --initrdsize 8192 \
- --loaderbin loader \
- --modules "$NETMODULES $SCSIMODULES $EXTRASCSI $EXTRANET"
-
-makebootdisk --bootdisksize 1440 --kernelto $TOPDESTPATH/kernels/vmlinux.gz \
- --imagename generic.img
-
+ makeinitrd --initrdto $TOPDESTPATH/images/ramdisk.img \
+ --initrdsize 4096 \
+ --padsize 1440 \
+ --loaderbin loader \
+ --modules "$NETMODULES $SCSIMODULES"
-makemainmodules "$SECSTAGE"
-makeinstimage "netstg" "$SECSTAGE"
-makeinstimage "hdstg" "$SECSTAGE"
-makemainimage "stage2" "cramfs "
+ makeinitrd --initrdto $TOPDESTPATH/images/cdrom.img \
+ --initrdsize 8192 \
+ --loaderbin loader \
+ --modules "$NETMODULES $SCSIMODULES $EXTRASCSI $EXTRANET"
+ makebootdisk --bootdisksize 1440 --kernelto $TOPDESTPATH/kernels/vmlinux.gz \
+ --imagename generic.img
-if [ -f $TOPDESTPATH/preview/RPMS/kernel-2.4.0-*.alpha.rpm ]; then
- K24_PKG=$TOPDESTPATH/preview/RPMS/kernel-2.4.0-*.alpha.rpm
- K24_DIR=/tmp/kernel24.dir.$$
- mkdir -p $K24_DIR
- rpm2cpio $K24_PKG | (cd $K24_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
- cp $K24_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.24
- rm -rf $K24_DIR
-fi
+ if [ -f $KERNELPATH/kernel-jensen-*.rpm ]; then
+ KJ_PKG=$KERNELPATH/kernel-jensen-*.rpm
+ KJ_DIR=/tmp/kernelj.dir.$$
+ mkdir -p $KJ_DIR
+ rpm2cpio $KJ_PKG | (cd $KJ_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
+ cp $KJ_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.j
+ rm -rf $KJ_DIR
+ fi
-if [ -f $KERNELPATH/kernel-jensen-*.rpm ]; then
- KJ_PKG=$KERNELPATH/kernel-jensen-*.rpm
- KJ_DIR=/tmp/kernelj.dir.$$
- mkdir -p $KJ_DIR
- rpm2cpio $KJ_PKG | (cd $KJ_DIR; cpio --quiet -iumd ./boot/vmlinuz-*)
- cp $KJ_DIR/boot/vmlinuz-* $TOPDESTPATH/kernels/vmlinuz.j
- rm -rf $KJ_DIR
-fi
-
-makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "$SCSIMODULES $EXTRASCSI +scsi"
-makedriverdisk --padsize 1440 "Supplemental Network Device Drivers" "drvnet" "$NETMODULES $EXTRANET +net"
-
+ makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "$SCSIMODULES $EXTRASCSI +scsi"
+ makedriverdisk --padsize 1440 "Supplemental Network Device Drivers" "drvnet" "$NETMODULES $EXTRANET +net"
+}
+makeSecondStage() {
+ makemainmodules "$SECSTAGE"
+ makeinstimage "netstg" "$SECSTAGE"
+ makeinstimage "hdstg" "$SECSTAGE"
+ makemainimage "stage2" "cramfs "
+}
diff --git a/scripts/mk-images.i386 b/scripts/mk-images.i386
index 1c2daa3cf..babfbe99f 100644
--- a/scripts/mk-images.i386
+++ b/scripts/mk-images.i386
@@ -140,43 +140,44 @@ PCMCIAMODULES=`echo $PCMCIAMODULES | eval "$PCMCIAMODULES_EXCLUDED_SED"`
# need to make sure the base modules are included
PCMCIAMODULES="$PCMCIAMODULES yenta_socket i82365 tcic pcmcia_core ds"
-echo "Building $TOPDESTPATH/images/pxeboot/initrd.img"
-makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
- --pcmcia \
- --initrdsize 4750 \
- --loaderbin loader \
- --modules "$COMMONMODULES"
-
-echo "Building initrd-everything.img"
-makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \
- --pcmcia \
- --initrdsize 7000 \
- --loaderbin loader \
- --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net"
-[ $? = 0 ] || exit 1
-
-echo "Building bootdisk.img"
-makebootdisk --kernelto $TOPDESTPATH/images/pxeboot/vmlinuz \
- --bootdisksize 1440 \
- --imagename $BOOTDIR/bootdisk.img \
- --initrd $TOPDESTPATH/images/pxeboot/initrd.img
-[ $? = 0 ] || exit 1
-
-rm -f $TOPDESTPATH/images/pxeboot/initrd.img
-
-echo "Building drvblock.img"
-makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "=scsi"
-# JKFIXME: was exit 1
-[ $? = 0 ] || echo "ERROR: failed to write drvblock"
-echo "Building drvnet.img"
-makedriverdisk --padsize 1440 "Supplemental Network Drivers" "drvnet" "=net"
-[ $? = 0 ] || echo "ERROR: failed to write drvnet"
-
-echo "Building pcmciadd.img"
-makedriverdisk --padsize 1440 "PCMCIA Driver Diskette" "pcmciadd" "$PCMCIAMODULES"
-[ $? = 0 ] || echo "ERROR: failed to write pcmciadd"
-
-if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
+makeBootImages() {
+ echo "Building $TOPDESTPATH/images/pxeboot/initrd.img"
+ makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd.img \
+ --pcmcia \
+ --initrdsize 4750 \
+ --loaderbin loader \
+ --modules "$COMMONMODULES"
+
+ echo "Building initrd-everything.img"
+ makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \
+ --pcmcia \
+ --initrdsize 7000 \
+ --loaderbin loader \
+ --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net"
+ [ $? = 0 ] || exit 1
+
+ echo "Building bootdisk.img"
+ makebootdisk --kernelto $TOPDESTPATH/images/pxeboot/vmlinuz \
+ --bootdisksize 1440 \
+ --imagename $BOOTDIR/bootdisk.img \
+ --initrd $TOPDESTPATH/images/pxeboot/initrd.img
+ [ $? = 0 ] || exit 1
+
+ rm -f $TOPDESTPATH/images/pxeboot/initrd.img
+
+ echo "Building drvblock.img"
+ makedriverdisk --padsize 1440 "Supplemental Block Device Drivers" "drvblock" "=scsi"
+ # JKFIXME: was exit 1
+ [ $? = 0 ] || echo "ERROR: failed to write drvblock"
+ echo "Building drvnet.img"
+ makedriverdisk --padsize 1440 "Supplemental Network Drivers" "drvnet" "=net"
+ [ $? = 0 ] || echo "ERROR: failed to write drvnet"
+
+ echo "Building pcmciadd.img"
+ makedriverdisk --padsize 1440 "PCMCIA Driver Diskette" "pcmciadd" "$PCMCIAMODULES"
+ [ $? = 0 ] || echo "ERROR: failed to write pcmciadd"
+
+ if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
echo "Building isolinux directory"
MBD_BOOTTREE=$TOPDESTPATH/isolinux
MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd-everything.img
@@ -187,26 +188,12 @@ if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
# isolinux needs the config file to be isolinux.cfg
mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg
-else
+ else
echo "No isolinux binaries. Skipping isolinux creation"
-fi
+ fi
-echo "Building main moduleball"
-makemainmodules "=scsi =net $SECSTAGE"
-[ $? = 0 ] || exit 1
-
-echo "Building netstg.img"
-makeinstimage "netstg" "=scsi $SECSTAGE"
-[ $? = 0 ] || exit 1
-echo "Building hdstg.img"
-makeinstimage "hdstg" "=net $SECSTAGE"
-[ $? = 0 ] || exit 1
-echo "Building stage2.img"
-makemainimage "stage2" "cramfs"
-[ $? = 0 ] || exit 1
-
-# clean up time -- being very explicit about what's linked
-if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;then
+ # clean up time -- being very explicit about what's linked
+ if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;then
echo "Cleaning up images"
# links for the pxeboot bits
rm -f $TOPDESTPATH/images/pxeboot/*
@@ -218,15 +205,15 @@ if [ -f $TOPDESTPATH/isolinux/vmlinuz -a -f $TOPDESTPATH/isolinux/initrd.img ] ;
mkdir -p $TOPDESTPATH/dosutils/autoboot/
ln $TOPDESTPATH/isolinux/vmlinuz $TOPDESTPATH/dosutils/autoboot/vmlinuz
ln $TOPDESTPATH/isolinux/initrd.img $TOPDESTPATH/dosutils/autoboot/initrd.img
-fi
-
-# now make a boot iso
-mkdir -p $TOPDESTPATH/images/isopath
-cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath
-mkisofs -o $TOPDESTPATH/images/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T $TOPDESTPATH/images/isopath
-rm -rf $TOPDESTPATH/images/isopath
-
-cat > $TOPDESTPATH/images/pxeboot/README <<EOF
+ fi
+
+ # now make a boot iso
+ mkdir -p $TOPDESTPATH/images/isopath
+ cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath
+ mkisofs -o $TOPDESTPATH/images/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T $TOPDESTPATH/images/isopath
+ rm -rf $TOPDESTPATH/images/isopath
+
+ cat > $TOPDESTPATH/images/pxeboot/README <<EOF
The files in this directory are useful for booting a machine via PXE.
The following files are available:
@@ -234,3 +221,20 @@ vmlinuz - the BOOT kernel used for the installer
initrd.img - an initrd with support for all install methods and
drivers supported for installation of Red Hat Linux
EOF
+}
+
+makeSecondStage() {
+ echo "Building main moduleball"
+ makemainmodules "=scsi =net $SECSTAGE"
+ [ $? = 0 ] || exit 1
+
+ echo "Building netstg.img"
+ makeinstimage "netstg" "=scsi $SECSTAGE"
+ [ $? = 0 ] || exit 1
+ echo "Building hdstg.img"
+ makeinstimage "hdstg" "=net $SECSTAGE"
+ [ $? = 0 ] || exit 1
+ echo "Building stage2.img"
+ makemainimage "stage2" "cramfs"
+ [ $? = 0 ] || exit 1
+}
diff --git a/scripts/mk-images.ia64 b/scripts/mk-images.ia64
index a03180d30..3b6e31a92 100644
--- a/scripts/mk-images.ia64
+++ b/scripts/mk-images.ia64
@@ -32,21 +32,25 @@ EOF
cp $MBD_BOOTTREE/EFI/boot/* $MBD_BOOTTREE/
}
-makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \
- --imagename boot.img \
- --bootdisksize 20480 \
- --initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \
+makeBootImages() {
+ makebootdisk --kernelto $TOPDESTPATH/kernels/vmlinuz \
+ --imagename boot.img \
+ --bootdisksize 20480 \
+ --initrdflags '--initrdto $TOPDESTPATH/images/ramdisk.img \
--initrdsize 8192 \
--loaderbin loader \
--modules "nfs fat vfat cramfs $USBMODS $NETMODULES $SCSIMODULES $IDEMODULES"'
-makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODULES"
-makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODULES"
-makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODULES"
-makemainimage "stage2" "cramfs"
+ # now make a boot iso
+ mkdir -p $TOPDESTPATH/images/isopath
+ 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
+}
-# now make a boot iso
-mkdir -p $TOPDESTPATH/images/isopath
-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
+makeSecondStage() {
+ makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODULES"
+ makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODULES"
+ makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODULES"
+ makemainimage "stage2" "cramfs"
+}
diff --git a/scripts/mk-images.ppc b/scripts/mk-images.ppc
index aff51e322..43b66ac0e 100644
--- a/scripts/mk-images.ppc
+++ b/scripts/mk-images.ppc
@@ -1,18 +1,73 @@
-SECSTAGE="nfs fat vfat raid0 raid1 raid5 ext3"
-NETMODULES="pcnet32 tulip yellowfin acenic"
-SCSIMODULES=""
+FSMODS="msdos vfat ext3 reiserfs jfs"
+IDEMODS="ide-cd"
+SCSIMODS="sd_mod sr_mod st"
+LATEUSBMODS="mousedev usb-storage"
+SECSTAGE="raid0 raid1 raid5 lvm-mod $FSMODS $IDEMODS $SCSIMODS $LATEUSBMODS"
+# need yellowfin for IBM?
+NETMODULES="sungem tg3 ne2k-pci 3c59x 8139too
+ de4x5 acenic pcnet32 tulip natsemi eepro100 airport"
+
+SCSIMODULES="advansys aic7xxx initio sym53c8xx"
+
+# images we only want on the CD (usually for space reasons)
+ISOMODULES="ehci-hcd ieee1394 ohci1394 sbp2"
prepareBootImage() {
mkdir -p $TOPDESTPATH/ppc/chrp
+ mkdir -p $TOPDESTPATH/images
}
-makeinitrd --initrdto $TOPDESTPATH/ppc/chrp/ramdisk.image.gz \
- --initrdsize 8192 \
- --loaderbin loader \
- --modules "nfs fat vfat $NETMODULES $SCSIMODULES"
+makeBootImages() {
+ echo "Building boot images for kernel $kernelvers"
+
+ if [ "$kernelvers" = "pseries" ]; then
+ echo "Building pSeries initrd"
+ makeinitrd --initrdto $TOPDESTPATH/ppc/chrp/ramdisk.image.gz \
+ --initrdsize 8192 \
+ --loaderbin loader \
+ --modules "nfs fat vfat cramfs $NETMODULES $SCSIMODULES $IDEMODULES $ISOMODULES"
+
+ mkdir -p $TOPDESTPATH/etc $TOPDESTPATH/ppc/chrp
+ cp $KERNELROOT/boot/vmlinux-*pseries* $TOPDESTPATH/ppc/chrp/vmlinux
+ cp $BOOTDISKDIR/yaboot.conf $TOPDESTPATH/etc/yaboot.conf
+ cp $BOOTDISKDIR/bootinfo.txt $TOPDESTPATH/ppc/bootinfo.txt
+ cp $IMGPATH/usr/lib/yaboot/yaboot $TOPDESTPATH/ppc/chrp
+
+ # we also want to make a boot.iso here
+ mkdir -p $TOPDESTPATH/isopath/ppc/chrp $TOPDESTPATH/isopath/etc
+ cp $TOPDESTPATH/etc/* $TOPDESTPATH/isopath/etc/
+ cp $TOPDESTPATH/ppc/chrp/* $TOPDESTPATH/isopath/ppc/chrp
-makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODULES"
-makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODULES"
-makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODULES"
-makemainimage "stage2" "cramfs"
+ # FIXME: still need the magic boot_image file
+ # mkisofs -generic-boot $TOPDESTPATH/isopath/boot_image -V "PBOOT" -J -R -v -T -allow-multidot -l -o $TOPDESTPATH/images/boot.iso $TOPDESTPATH/isopath
+ # rm -rf $TOPDESTPATH/isopath/
+ elif [ "$kernelvers" = "iseries" ]; then
+ mkdir -p $TOPDESTPATH/ppc/iSeries
+ echo "Building iSeries initrd"
+ makeinitrd --initrdto $TOPDESTPATH/ppc/iSeries/ramdisk.image.gz \
+ --initrdsize 8192 \
+ --loaderbin loader \
+ --modules "nfs fat vfat cramfs veth $NETMODULES $SCSIMODULES $IDEMODULES $ISOMODULES"
+
+ cp $KERNELROOT/boot/vmlinux-*iseries* $TOPDESTPATH/ppc/iSeries/vmlinux
+ cp $KERNELROOT/boot/System.map-*iseries* $TOPDESTPATH/ppc/iSeries/System.map
+
+ $IMGPATH/usr/sbin/addRamDisk $TOPDESTPATH/ppc/iSeries/ramdisk.image.gz $TOPDESTPATH/ppc/iSeries/System.map $TOPDESTPATH/ppc/iSeries/vmlinux $TOPDESTPATH/ppc/iSeries/boot.img
+ else
+ echo "Unknown kernel version: $kernelvers"
+ # mac?
+ # echo "Building Mac initrd"
+ # makeinitrd --initrdto $TOPDESTPATH/images/ramdisk.image.gz \
+ # --initrdsize 8192 \
+ # --loaderbin loader \
+ # --modules "nfs fat vfat cramfs $NETMODULES $SCSIMODULES $IDEMODULES $ISOMODULES"
+ fi
+}
+
+makeSecondStage() {
+ makeinstimage "netstg" "$SECSTAGE $SCSIMODULES $IDEMODULES"
+ makeinstimage "hdstg" "$SECSTAGE $NETMODULES $IDEMODULES"
+ makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES $IDEMODULES"
+ makemainimage "stage2" "cramfs"
+}
diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
index 6cd826a7a..772e8d571 100644
--- a/scripts/mk-images.s390
+++ b/scripts/mk-images.s390
@@ -1,5 +1,3 @@
-
-
prepareBootImage() {
dd if=/dev/zero bs=1k count=$BOOTDISKSIZE of=/$MBD_TMPIMAGE 2>/dev/null
mount -o loop -t msdos $MBD_TMPIMAGE $MBD_BOOTTREE
@@ -111,6 +109,9 @@ makeS390initrd() {
mkdir -p $MBD_DIR/tmp
mkdir -p $MBD_DIR/etc/terminfo/{a,d,k,l,s,v,x}
mkdir -p $MBD_DIR/var/state
+ mkdir -p $MBD_DIR/var/empty/sshd
+ mkdir -p $MBD_DIR/etc/{pam.d,security}
+ mkdir -p $MBD_DIR/$LIBDIR/security
ln -s /tmp $MBD_DIR/var/state/xkb
if [ -n "$LOADERMODULES" ]; then
@@ -123,23 +124,43 @@ root::0:0:root:/:/bin/bash
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
EOF
echo "sshd:x:74:" >> $MBD_DIR/etc/group
- mkdir -p $MBD_DIR/var/empty/sshd $MBD_DIR/etc/pam.d $MBD_DIR/lib/security \
- $MBD_DIR/etc/security $MBD_DIR/$LIBDIR/security
chmod 111 $MBD_DIR/var/empty/sshd
for i in pam_stack.so pam_nologin.so pam_limits.so pam_console.so \
- pam_securetty.so pam_env.so pam_unix.so pam_deny.so pam_cracklib.so \
+ pam_env.so pam_unix.so pam_deny.so \
pam_limits.so; do
cp -f $IMGPATH/$LIBDIR/security/$i $MBD_DIR/$LIBDIR/security
done
cp -f $IMGPATH/$LIBDIR/libpam_misc.so* $IMGPATH/$LIBDIR/libpam.so* $MBD_DIR/$LIBDIR
- for i in sshd login system-auth other; do
+ for i in sshd other; do
cp -f $IMGPATH/etc/pam.d/$i $MBD_DIR/etc/pam.d
done
+ cat > $MBD_DIR/etc/pam.d/login << EOF
+#%PAM-1.0
+auth required pam_securetty.so
+auth required pam_stack.so service=system-auth
+auth required pam_nologin.so
+account required pam_stack.so service=system-auth
+password required pam_stack.so service=system-auth
+session required pam_stack.so service=system-auth
+session optional pam_console.so
+EOF
+ cat > $MBD_DIR/etc/pam.d/system-auth << EOF
+#%PAM-1.0
+auth required pam_env.so
+auth sufficient pam_unix.so likeauth nullok
+auth required pam_deny.so
+account required pam_unix.so
+password sufficient pam_unix.so nullok use_authtok md5 shadow
+password required pam_deny.so
+session required pam_limits.so
+session required pam_unix.so
+EOF
cp -f $IMGPATH/etc/security/{limits.conf,pam_env.conf} $MBD_DIR/etc/security/
cp -f $IMGPATH/usr/bin/login $MBD_DIR/sbin/login
cp -f $IMGPATH/usr/sbin/sshd $MBD_DIR/sbin/sshd
install -s -m 755 $LOADERBINDIR/$LOADERBIN $MBD_DIR/sbin/loader
+ install -s -m 755 $LOADERBINDIR/shutdown $MBD_DIR/sbin/shutdown
#install -s -m 755 $LOADERBINDIR/load_anaconda $MBD_DIR/sbin/loader
# install -m 644 $KEYMAPS $MBD_DIR/etc/keymaps.gz
# install -m 644 $FONTS $MBD_DIR/etc/fonts.cgz
@@ -177,11 +198,10 @@ EOF
cp -f $IMGPATH/usr/bin/gawk $MBD_DIR/sbin/awk
cp -f $IMGPATH/usr/bin/sort_save $MBD_DIR/sbin/sort
cp -f $IMGPATH/usr/sbin/chroot $MBD_DIR/sbin/chroot
- cp -f $IMGPATH/usr/sbin/consoletype $MBD_DIR/sbin/consoletype
cp -f $IMGPATH/usr/sbin/mke2fs $MBD_DIR/sbin/mke2fs
cp -f $IMGPATH/usr/bin/busybox $MBD_DIR/sbin/busybox
for i in cp uname tee rm ps mv more mkdir ls ln hostname head \
- gzip grep dd chmod cat; do
+ lsmod gzip grep dd chmod cat; do
ln -sf busybox $MBD_DIR/sbin/$i
done
cp -f $IMGPATH/usr/X11R6/bin/xauth $MBD_DIR/sbin/xauth
@@ -202,6 +222,18 @@ EOF
cp -f $IMGPATH/usr/sbin/ifconfig $MBD_DIR/sbin/ifconfig
cp -f $IMGPATH/usr/sbin/xinetd $MBD_DIR/sbin/xinetd
cp -f $IMGPATH/usr/sbin/in.telnetd $MBD_DIR/sbin/in.telnetd
+ cat > $MBD_DIR/etc/xinetd.d/telnet <<EOF
+service telnet
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /sbin/in.telnetd
+ log_on_failure += USERID
+ disable = no
+}
+EOF
cp -f $IMGPATH/usr/sbin/route $MBD_DIR/sbin/route
cp -f $IMGPATH/usr/sbin/portmap $MBD_DIR/sbin/portmap
cp -f $IMGPATH/etc/xinetd.conf $MBD_DIR/etc/xinetd.conf
@@ -210,21 +242,20 @@ EOF
echo -n "Generating SSH1 RSA host key: "
/usr/bin/ssh-keygen -q -t rsa1 -f $MBD_DIR/etc/ssh/ssh_host_key \
-C '' -N '' >&/dev/null
- chmod 600 $MBD_DIR/etc/ssh/ssh_host_key
- chmod 644 $MBD_DIR/etc/ssh/ssh_host_key.pub
echo
echo -n "Generating SSH2 RSA host key: "
/usr/bin/ssh-keygen -q -t rsa -f $MBD_DIR/etc/ssh/ssh_host_rsa_key \
-C '' -N '' >&/dev/null
- chmod 600 $MBD_DIR/etc/ssh/ssh_host_rsa_key
- chmod 644 $MBD_DIR/etc/ssh/ssh_host_rsa_key.pub
echo
echo -n "Generating SSH2 DSA host key: "
/usr/bin/ssh-keygen -q -t dsa -f $MBD_DIR/etc/ssh/ssh_host_dsa_key \
-C '' -N '' >&/dev/null
- chmod 600 $MBD_DIR/etc/ssh/ssh_host_dsa_key
- chmod 644 $MBD_DIR/etc/ssh/ssh_host_dsa_key.pub
echo
+pwd
+ (cd $MBD_DIR/etc/ssh; \
+ chmod 600 ssh_host_key ssh_host_rsa_key ssh_host_dsa_key; \
+ chmod 644 ssh_host_key.pub ssh_host_rsa_key.pub ssh_host_dsa_key.pub; )
+pwd
cat > $MBD_DIR/etc/ssh/sshd_config <<EOF
Port 22
HostKey /etc/ssh/ssh_host_key
@@ -244,11 +275,13 @@ RSAAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords yes
EOF
+ chmod 600 $MBD_DIR/etc/ssh/sshd_config
for file in ISO8859-15.so EUC-JP.so libJIS.so gconv-modules; do
cp -f $IMGPATH/usr/$LIBDIR/gconv/$file $MBD_DIR/usr/$LIBDIR/gconv/$file
done
- cp -f $IMGPATH/etc/services $MBD_DIR/etc/
+ echo "telnet 23/tcp" > $MBD_DIR/etc/services
+ echo "tcp 6 TCP" > $MBD_DIR/etc/protocols
cp -df $IMGPATH/$LIBDIR/libpam.so* $MBD_DIR/$LIBDIR
cp -df $IMGPATH/$LIBDIR/libdl.so* $MBD_DIR/$LIBDIR
cp -df $IMGPATH/$LIBDIR/libdl-*.so* $MBD_DIR/$LIBDIR
@@ -279,7 +312,6 @@ EOF
cp -df $IMGPATH/$LIBDIR/libssl* $MBD_DIR/$LIBDIR
cp -df $IMGPATH/$LIBDIR/libext2* $MBD_DIR/$LIBDIR
cp -df $IMGPATH/$LIBDIR/libcom_err* $MBD_DIR/$LIBDIR
- cp -df $IMGPATH/$LIBDIR/libcrack* $MBD_DIR/$LIBDIR
cp -df $IMGPATH/usr/kerberos/$LIBDIR/libgssapi_krb5* $MBD_DIR/usr/kerberos/$LIBDIR
cp -df $IMGPATH/usr/kerberos/$LIBDIR/libkrb5.so* $MBD_DIR/usr/kerberos/$LIBDIR
cp -df $IMGPATH/usr/kerberos/$LIBDIR/libk5crypto.so* $MBD_DIR/usr/kerberos/$LIBDIR
@@ -300,7 +332,7 @@ EOF
printf("chmod %s %s/dev/%s\n", $6, $1, $2);
printf("chown %s %s/dev/%s\n", $7, $1, $2);
}' <<EOF | sh
- $MBD_DIR console c 4 64 600 root:root
+ $MBD_DIR console c 5 1 600 root:root
$MBD_DIR random c 1 8 644 root:root
$MBD_DIR ram0 b 1 1 640 root:root
$MBD_DIR ram1 b 1 2 640 root:root
@@ -333,8 +365,6 @@ EOF
$MBD_DIR ttyp7 c 3 7 644 root:root
$MBD_DIR ttyp8 c 3 8 644 root:root
$MBD_DIR ttyp9 c 3 9 644 root:root
- $MBD_DIR fd0 b 2 0 644 root:root
- $MBD_DIR fd1 b 2 1 644 root:root
EOF
ln -s ram1 $MBD_DIR/dev/ram
for i in `seq 2 9`; do
@@ -404,41 +434,31 @@ COMMONMODULES="loop cramfs dasd_diag_mod dasd_eckd_mod dasd_fba_mod dasd_mod tap
LOCALMODULES="$COMMONMODULES tape390 $IDEMODS $SCSIMODS"
NETWORKMODULES="$COMMONMODULES nfs ctc netiucv ipv6"
-echo "In mk-images.s390: kernelvers is $kernelvers"
-if [ "$kernelvers" = "BOOT" ]; then
- makeS390initrd --initrdto $TOPDESTPATH/images/initrd.img \
- --initrdsize 15000 \
- --loaderbin loader \
- --modules "$NETWORKMODULES"
- cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img
-fi
-
-if [ "$kernelvers" = "BOOTtape" ]; then
- makeS390initrd --initrdto $TOPDESTPATH/images/tapeinrd.img \
- --initrdsize 15000 \
- --loaderbin loader \
- --modules "$NETWORKMODULES"
- cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/tapekrnl.img
-fi
-
-for I in `find $BOOTDISKDIR -type d`; do
- BOOTLANG=`basename $I`
- BOOTDIR=`basename $I | cut -d'_' -f1`
+makeBootImages() {
+ echo "In mk-images.s390: kernelvers is $kernelvers"
+ if [ "$kernelvers" = "" ]; then
+ makeS390initrd --initrdto $TOPDESTPATH/images/initrd.img \
+ --initrdsize 15000 \
+ --loaderbin loader \
+ --modules "$NETWORKMODULES"
+ cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img
+ fi
- if [ $BOOTLANG = "boot" ]; then
- BOOTLANG=""
- BOOTDIR=""
+ if [ "$kernelvers" = "tape" ]; then
+ makeS390initrd --initrdto $TOPDESTPATH/images/tapeinrd.img \
+ --initrdsize 15000 \
+ --loaderbin loader \
+ --modules "$NETWORKMODULES"
+ cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/tapekrnl.img
fi
-done
+}
-unset BOOTLANG
-unset BOOTDIR
+makeSecondStage() {
+ makemainmodules "=scsi =net $SECSTAGE"
-if [ "$kernelvers" = "BOOT" ]; then
-makemainmodules "=scsi =net $SECSTAGE"
+ makeinstimage "netstg" "=scsi $SECSTAGE"
-makeinstimage "netstg" "=scsi $SECSTAGE"
+ makeinstimage "hdstg" "=net $SECSTAGE"
+ makemainimage "stage2" "cramfs"
+}
-makeinstimage "hdstg" "=net $SECSTAGE"
-makemainimage "stage2" "cramfs"
-fi
diff --git a/scripts/mk-images.sparc64 b/scripts/mk-images.sparc64
index af993e12e..cb2f57a0e 100644
--- a/scripts/mk-images.sparc64
+++ b/scripts/mk-images.sparc64
@@ -52,47 +52,51 @@ maketftp() {
$TILO vmlinux64 $TFTPKERNEL $TFTPINITRD $TFTPIMAGE
}
+makeBootImages() {
# set up the silo files
-rm -rf $TOPDESTPATH/boot
-rm -rf $TOPDESTPATH/etc
-mkdir -p $TOPDESTPATH/boot
-mkdir -p $TOPDESTPATH/etc
+ rm -rf $TOPDESTPATH/boot
+ rm -rf $TOPDESTPATH/etc
+ mkdir -p $TOPDESTPATH/boot
+ mkdir -p $TOPDESTPATH/etc
-cp $BOOTDISKDIR/cd.b $TOPDESTPATH/boot
-cp $BOOTDISKDIR/second.b $TOPDESTPATH/boot
-cp $BOOTDISKDIR/*.msg $TOPDESTPATH/etc
-cp $BOOTDISKDIR/silo.conf $TOPDESTPATH/etc
+ cp $BOOTDISKDIR/cd.b $TOPDESTPATH/boot
+ cp $BOOTDISKDIR/second.b $TOPDESTPATH/boot
+ cp $BOOTDISKDIR/*.msg $TOPDESTPATH/etc
+ cp $BOOTDISKDIR/silo.conf $TOPDESTPATH/etc
# set up aout kernel images
-rm -rf $TOPDESTPATH/kernels
-mkdir -p $TOPDESTPATH/kernels
-elftoaout -o $TOPDESTPATH/kernels/vmlinux64 $KERNELROOT/boot/vmlinux-*
-gzip -9 $TOPDESTPATH/kernels/vmlinux64
+ rm -rf $TOPDESTPATH/kernels
+ mkdir -p $TOPDESTPATH/kernels
+ elftoaout -o $TOPDESTPATH/kernels/vmlinux64 $KERNELROOT/boot/vmlinux-*
+ gzip -9 $TOPDESTPATH/kernels/vmlinux64
-SCSIMODULES="qlogicpti sg st pluto fcal soc socal
+ SCSIMODULES="qlogicpti sg st pluto fcal soc socal
fc4 aic7xxx sym53c8xx qlogicisp"
-NETMODULES="sunhme sunqe sunbmac myri_sbus 3c59x de4x5"
+ NETMODULES="sunhme sunqe sunbmac myri_sbus 3c59x de4x5"
-makeinitrd --initrdto $TOPDESTPATH/boot/initrd64.img \
- --initrdsize 2000 \
- --loaderbin loader \
- --modules "$SCSIMODULES $NETMODULES" \
- --moduleballname modules64.cgz
+ makeinitrd --initrdto $TOPDESTPATH/boot/initrd64.img \
+ --initrdsize 2000 \
+ --loaderbin loader \
+ --modules "$SCSIMODULES $NETMODULES" \
+ --moduleballname modules64.cgz
-maketftp --kernel $KERNELROOT/boot/vmlinux-* \
- --imagename $TOPDESTPATH/images/tftp64.img \
- --initrdfrom $TOPDESTPATH/boot/initrd64.img
+ maketftp --kernel $KERNELROOT/boot/vmlinux-* \
+ --imagename $TOPDESTPATH/images/tftp64.img \
+ --initrdfrom $TOPDESTPATH/boot/initrd64.img
-makebootdisk --kernelto $TOPDESTPATH/boot/vmlinux64.gz \
- --imagename boot64.img \
- --bootdisksize 1440 \
- --initrdflags '--initrdsize 2000 \
+ makebootdisk --kernelto $TOPDESTPATH/boot/vmlinux64.gz \
+ --imagename boot64.img \
+ --bootdisksize 1440 \
+ --initrdflags '--initrdsize 2000 \
--loaderbin loader-local \
--modules "$SCSIMODULES" \
--moduleballname modules64.cgz'
+}
-makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES" modules64.cgz
+makeSecondStage() {
+ makemainmodules "$SECSTAGE $NETMODULES $SCSIMODULES" modules64.cgz
-makeinstimage "netstg" "$SCSIMOUDLES $SECSTAGE"
-makeinstimage "hdstg" "$NETMODULES $SECSTAGE"
-makemainimage "stage2" "ext2"
+ makeinstimage "netstg" "$SCSIMOUDLES $SECSTAGE"
+ makeinstimage "hdstg" "$NETMODULES $SECSTAGE"
+ makemainimage "stage2" "ext2"
+}
diff --git a/scripts/mk-images.x86_64 b/scripts/mk-images.x86_64
index 65b584ca8..28f2548a9 100644
--- a/scripts/mk-images.x86_64
+++ b/scripts/mk-images.x86_64
@@ -83,15 +83,16 @@ PCMCIAMODULES=`echo $PCMCIAMODULES | eval "$PCMCIAMODULES_EXCLUDED_SED"`
mkdir -p $TOPDESTPATH/images/pxeboot
-echo "Building initrd-everything.img"
-makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \
- --pcmcia \
- --initrdsize 8192 \
- --loaderbin loader \
- --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net"
-[ $? = 0 ] || exit 1
-
-if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
+makeBootImages() {
+ echo "Building initrd-everything.img"
+ makeinitrd --initrdto $TOPDESTPATH/images/pxeboot/initrd-everything.img \
+ --pcmcia \
+ --initrdsize 8192 \
+ --loaderbin loader \
+ --modules "$LOCALMODULES $NETWORKMODULES $PCMCIAMAINMODULES $PCMCIAMODULES $ISOLINUXMODULES =scsi =net"
+ [ $? = 0 ] || exit 1
+
+ if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
echo "Building isolinux directory"
MBD_BOOTTREE=$TOPDESTPATH/isolinux
MBD_FSIMAGE=$TOPDESTPATH/images/pxeboot/initrd-everything.img
@@ -102,26 +103,29 @@ if [ -f $IMGPATH/usr/lib/syslinux/isolinux.bin ]; then
# isolinux needs the config file to be isolinux.cfg
mv $MBD_BOOTTREE/syslinux.cfg $MBD_BOOTTREE/isolinux.cfg
-else
+ else
echo "No isolinux binaries. Skipping isolinux creation"
-fi
+ fi
+
+ # now make a boot iso
+ mkdir -p $TOPDESTPATH/images/isopath
+ cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath
+ mkisofs -o $TOPDESTPATH/images/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T $TOPDESTPATH/images/isopath
+ rm -rf $TOPDESTPATH/images/isopath
+}
-echo "Building main moduleball"
-makemainmodules "=scsi =net $SECSTAGE"
-[ $? = 0 ] || exit 1
-
-echo "Building netstg.img"
-makeinstimage "netstg" "=scsi $SECSTAGE"
-[ $? = 0 ] || exit 1
-echo "Building hdstg.img"
-makeinstimage "hdstg" "=net $SECSTAGE"
-[ $? = 0 ] || exit 1
-echo "Building stage2.img"
-makemainimage "stage2" "cramfs"
-[ $? = 0 ] || exit 1
-
-# now make a boot iso
-mkdir -p $TOPDESTPATH/images/isopath
-cp -rl $TOPDESTPATH/isolinux $TOPDESTPATH/images/isopath
-mkisofs -o $TOPDESTPATH/images/boot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -V -T $TOPDESTPATH/images/isopath
-rm -rf $TOPDESTPATH/images/isopath
+makeSecondStage() {
+ echo "Building main moduleball"
+ makemainmodules "=scsi =net $SECSTAGE"
+ [ $? = 0 ] || exit 1
+
+ echo "Building netstg.img"
+ makeinstimage "netstg" "=scsi $SECSTAGE"
+ [ $? = 0 ] || exit 1
+ echo "Building hdstg.img"
+ makeinstimage "hdstg" "=net $SECSTAGE"
+ [ $? = 0 ] || exit 1
+ echo "Building stage2.img"
+ makemainimage "stage2" "cramfs"
+ [ $? = 0 ] || exit 1
+}
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 6cda83c06..4569487e9 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -104,7 +104,7 @@ PACKAGES="glibc glibc-common setup openssl python python2 newt slang
bzip2-libs dosfstools pciutils reiserfs-utils parted sed
busybox-anaconda rpm-python booty hdparm lvm
rhpl pyxf86config libxml2 libxml2-python glib2
- elfutils-libelf bogl-bterm bogl krb5-libs convertdb1"
+ elfutils-libelf bogl-bterm bogl krb5-libs convertdb1 jfsutils"
if [ $ARCH = i386 -o $ARCH = x86_64 ]; then
PACKAGES="$PACKAGES kernel-pcmcia-cs kernel-utils"
@@ -118,8 +118,12 @@ if [ $ARCH = s390 -o $ARCH = s390x ]; then
PACKAGES="$PACKAGES s390utils binutils libgcc tcp_wrappers
sed net-tools xinetd openssl openssh openssh-server coreutils
login initscripts XFree86-xauth bash portmap pam
- libcrack telnet-server login mount grep modutils gawk
- XFree86-libs"
+ telnet-server login mount grep modutils gawk
+ XFree86-libs strace"
+fi
+
+if [ $ARCH = ppc -o $ARCH = ppc64 ]; then
+ PACKAGES="$PACKAGES kernel-pcmcia-cs pdisk yaboot hfsutils"
fi
# xpm is missing
@@ -184,7 +188,7 @@ if [ $ARCH = ia64 ]; then
fi
if [ $ARCH = ppc ]; then
- PACKAGESGR="$PACKAGESGR fbset"
+ PACKAGESGR="$PACKAGESGR fbset yaboot ppc64-utils"
fi
#
@@ -207,7 +211,7 @@ etc/group
etc/passwd
etc/protocols
etc/services
-$LIBDIR/ld-*
+$LIBDIR/ld*.so*
$LIBDIR/libc*
$LIBDIR/libcom_err*
$LIBDIR/libcrypt*
@@ -264,6 +268,7 @@ sbin/mkreiserfs
sbin/mkraid
sbin/mkswap
sbin/parted
+sbin/pdisk
sbin/pvchange
sbin/pvcreate
sbin/pvdata
@@ -293,6 +298,11 @@ sbin/vgsplit
usr/X11R6/share/Xconfigurator/MonitorsDB
usr/bin/python
usr/bin/python2.2
+usr/bin/hmount
+usr/bin/humount
+usr/bin/hcopy
+usr/bin/hattrib
+usr/bin/hformat
usr/lib/anaconda-runtime/*
usr/lib/anaconda/*
usr/lib/anaconda/installclasses/*
@@ -333,11 +343,17 @@ usr/$LIBDIR/python2.2/site-packages/rhpl
usr/lib/rpm/macros
usr/lib/rpm/rpmpopt
usr/lib/rpm/rpmrc
+usr/lib/yaboot/addnote
+usr/lib/yaboot/ofboot
+usr/lib/yaboot/yaboot
usr/libexec/convertdb1
usr/share/locale/*/LC_MESSAGES/anaconda.mo
usr/sbin/anaconda
usr/sbin/ddcprobe
usr/sbin/dmidecode
+usr/sbin/mkofboot
+usr/sbin/ofpath
+usr/sbin/ybin
usr/share/anaconda/locale-list
usr/share/anaconda/anaconda.conf
usr/share/terminfo/b/bterm
@@ -356,6 +372,7 @@ if [ $ARCH = s390 -o $ARCH = s390x ]; then
cat >> $KEEPFILE <<EOF
usr/share/terminfo/a/ansi
usr/share/terminfo/d/dumb
+usr/share/terminfo/k/kterm
usr/share/terminfo/s/screen
usr/share/terminfo/v/vt100
usr/share/terminfo/v/vt100-nav
@@ -364,22 +381,12 @@ usr/share/terminfo/x/xterm
usr/share/terminfo/x/xterm-color
usr/bin/strace
usr/bin/ldd
-usr/bin/wget
-usr/bin/printf
-usr/bin/dasdformat
-usr/bin/formatmnt
-usr/bin/mountpoint
-usr/bin/netsetup
-usr/bin/pkgselect
-usr/bin/pkgsrc
usr/sbin/chroot
usr/sbin/sshd
usr/sbin/glibc_post_upgrade
usr/sbin/in.telnetd
usr/sbin/xinetd
sbin/busybox.anaconda
-sbin/consoletype
-sbin/rhsetup
sbin/ifconfig
sbin/route
sbin/portmap
@@ -388,7 +395,6 @@ sbin/dasdfmt
sbin/swapon
sbin/swapoff
sbin/mkswap
-sbin/tune2fs
bin/bash
bin/dd
bin/gawk
@@ -399,7 +405,6 @@ bin/login
bin/cat
bin/chmod
bin/sort
-bin/rpm
$LIBDIR/libpam.so*
$LIBDIR/libdl.so*
$LIBDIR/libdl-*.so*
@@ -419,16 +424,12 @@ $LIBDIR/libresolv-*.so*
$LIBDIR/libvtoc*.so*
lib/modules/ibm/*
etc/xinetd.conf
-etc/xinetd.d/telnet
etc/pam.d/sshd
-etc/pam.d/login
-etc/pam.d/system-auth
etc/pam.d/other
etc/security/limits.conf
etc/security/pam_env.conf
lib/security
$LIBDIR/security/pam_*
-usr/$LIBDIR/libcrack.so*
usr/$LIBDIR/libwrap.so*
usr/X11R6/$LIBDIR/libXmuu.so*
usr/X11R6/$LIBDIR/libX11.so*
@@ -478,8 +479,10 @@ etc/man.config
etc/pango/*
etc/fonts/*
$LIBDIR/libnss_dns*
+$LIBDIR/libnss_nis*
$LIBDIR/libpam*
$LIBDIR/libproc*
+sbin/addRamDisk
sbin/debugfs
sbin/e2fsck
sbin/e2label
@@ -568,6 +571,7 @@ usr/$LIBDIR/pango/*
usr/$LIBDIR/python2.2/site-packages/gtk*/gtk/*
usr/$LIBDIR/rpm/rpmpopt
usr/lib/syslinux/*
+usr/lib/yaboot/*
usr/sbin/chroot
usr/sbin/ddcprobe
usr/sbin/fbset
diff --git a/syslogd.py b/syslogd.py
index 7722e2717..f484de05a 100644
--- a/syslogd.py
+++ b/syslogd.py
@@ -85,7 +85,10 @@ class InstSyslog:
def stop(self):
if self.pid == -1:
raise RuntimeError, "syslogd not running"
- os.kill (self.pid, 15)
+ try:
+ os.kill (self.pid, 15)
+ except OSError, (num, msg):
+ log("killing syslogd failed: %s %s" %(num, msg))
try:
os.waitpid (self.pid, 0)
diff --git a/text.py b/text.py
index 063d4d604..2d4da507b 100644
--- a/text.py
+++ b/text.py
@@ -86,11 +86,8 @@ if iutil.getArch() == 's390':
stepToClasses["bootloader"] = ("zipl_text", ( "ZiplWindow"))
class InstallWindow:
- def __call__ (self, screen, todo):
- if todo.doInstall ():
- return INSTALL_BACK
-
- return INSTALL_OK
+ def __call__ (self, screen):
+ raise RuntimeError, "Unimplemented screen"
class WaitWindow:
def pop(self):
@@ -198,7 +195,7 @@ class InstallInterface:
buttons=[TEXT_OK_BUTTON])
return None
- l = f.readlines()
+ lines = f.readlines()
for l in lines:
l = l.replace("@RHL@", productName)
l = l.replace("@RHLVER@", productVersion)
diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py
index 411facf68..6d103975b 100644
--- a/textw/bootloader_text.py
+++ b/textw/bootloader_text.py
@@ -86,6 +86,9 @@ class BootloaderChoiceWindow:
continue
dispatch.skipStep("instbootloader", skip = (rc == "yes"))
dispatch.skipStep("bootloaderadvanced", skip = (rc == "yes"))
+
+ # kind of a hack...
+ bl.defaultDevice = None
elif blradio.getSelection() == "lilo":
bl.setUseGrub(0)
dispatch.skipStep("instbootloader", 0)
diff --git a/textw/complete_text.py b/textw/complete_text.py
index c30441efc..f0ac5dc19 100644
--- a/textw/complete_text.py
+++ b/textw/complete_text.py
@@ -24,19 +24,20 @@ class FinishedWindow:
screen.pushHelpLine (string.center(_("<Enter> to reboot"),
screen.width))
- if iutil.getArch() != "ia64":
- bootstr = _("If you created a boot disk to use to boot your "
- "%s system, insert it before you "
- "press <Enter> to reboot.\n\n") % (productName,)
+ if iutil.getArch() == "i386":
+ bootstr = _("If you created a boot diskette during this "
+ "installation as your primary means of "
+ "booting %s, insert it before "
+ "rebooting your newly installed system.\n\n") % (productName,)
else:
bootstr = ""
if iutil.getArch() == "s390":
- floppystr = ""
+ floppystr = _("Press <Enter> to reboot your system.\n\n")
else:
- floppystr = _("Remove any floppy diskettes you used during the "
- "installation process and press <Enter> to reboot "
- "your system."
+ floppystr = _("Remove any installation media (diskettes or "
+ "CD-ROMs) used during the installation process "
+ "and press <Enter> to reboot your system."
"\n\n")
diff --git a/textw/partition_text.py b/textw/partition_text.py
index a963ac9c2..81f050296 100644
--- a/textw/partition_text.py
+++ b/textw/partition_text.py
@@ -684,8 +684,10 @@ class PartitionWindow:
# XXX need to see if cylinder range is in extended or not
row = row + 1
primary = Checkbox(_("Force to be a primary partition"))
- poplevel.add(primary, 0, row, (0,1,0,0))
- row = row + 1
+ # only show if we have something other than primary
+ if not self.diskset.onlyPrimaryParts():
+ poplevel.add(primary, 0, row, (0,1,0,0))
+ row = row + 1
# XXX We are not allowing badblocks checking
badblocksCB = None
diff --git a/urlinstall.py b/urlinstall.py
index 1a570ff05..a3d8f4fb8 100644
--- a/urlinstall.py
+++ b/urlinstall.py
@@ -213,17 +213,29 @@ class UrlInstallMethod(InstallMethod):
def __init__(self, url, rootPath):
InstallMethod.__init__(self, rootPath)
- i = string.index(url, '://') + 2
- self.baseUrl = url[0:i]
- rem = url[i:]
- new = string.replace(rem, "//", "/")
- while (new != rem):
- rem = new
- new = string.replace(rem, "//", "/")
- rem = new
- if rem and rem[-1] == "/":
- rem = rem[:-1]
- self.baseUrl = self.baseUrl + rem
+ if url.startswith("ftp"):
+ isFtp = 1
+ else:
+ isFtp = 0
+
+ # build up the url. this is tricky so that we can replace
+ # the first instance of // with /%3F to do absolute URLs right
+ i = string.index(url, '://') + 3
+ self.baseUrl = url[:i]
+ rem = url[i:]
+
+ i = string.index(rem, '/') + 1
+ self.baseUrl = self.baseUrl + rem[:i]
+ rem = rem[i:]
+
+ # encoding fun so that we can handle absolute paths
+ if rem.startswith("/") and isFtp:
+ rem = "%2F" + rem[1:]
+
+ self.baseUrl = self.baseUrl + rem
+
+ if self.baseUrl[-1] == "/":
+ self.baseUrl = self.baseUrl[:-1]
# self.baseUrl points at the path which contains the 'RedHat'
# directory with the hdlist.