[PATCH] ARM: add command line option to set the platform.
by Dennis Gilmore
Use case is to create images using livemedia-creator where we wont be
running on the target platform
Signed-off-by: Dennis Gilmore <dennis(a)ausil.us>
---
anaconda | 4 ++++
pyanaconda/iutil.py | 3 +++
2 files changed, 7 insertions(+)
diff --git a/anaconda b/anaconda
index fc679c9..c37dd72 100755
--- a/anaconda
+++ b/anaconda
@@ -222,6 +222,7 @@ def parseOptions(argv=None, cmdline=None):
op.add_option("--kickstart", dest="ksfile")
op.add_option("--rescue", dest="rescue", action="store_true", default=False)
op.add_option("--targetarch", "rpmarch", dest="targetArch", type="string")
+ op.add_option("--targetplatform", "platform", dest="targetPlatform", type="string")
op.add_option("-m", "--method", dest="method", default=None)
op.add_option("--repo", dest="method", default=None)
@@ -803,6 +804,9 @@ if __name__ == "__main__":
if opts.targetArch:
flags.targetarch = opts.targetArch
+ if opts.targetPlatform:
+ flags.platform = opts.targetPlatform
+
# set flags
flags.dmraid = opts.dmraid
flags.mpath = opts.mpath
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index ed6d098..aef4cc6 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -627,6 +627,9 @@ def getARMMachine():
if not isARM():
return 0
+ if flags.platform:
+ return flags.platform
+
armMachine = os.uname()[2].rpartition('.' )[2]
if armMachine.startswith('arm'):
--
1.7.10.4
11 years, 8 months
[PATCH 1/2] ARM: break out the setup of OMAP systems as they need to have a vfat partition at the start of the disk in order for the SOC to load u-boot from. Signed-off-by: Dennis Gilmore <dennis@ausil.us>
by Dennis Gilmore
---
pyanaconda/platform.py | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 1611797..05a496f 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -348,6 +348,32 @@ class ARM(Platform):
def armMachine(self):
return self._armMachine
+class omapARM(ARM):
+ _bootloaderClass = bootloader.UBOOTuEnv
+ _boot_stage1_format_types = ["vfat"]
+ _boot_stage1_device_types = ["partition"]
+ _boot_stage1_mountpoints = ["/boot/uboot"]
+ _boot_mbr_description = N_("Master Boot Record")
+ _boot_descriptions = {"disk": _boot_mbr_description,
+ "partition": Platform._boot_partition_description}
+
+ def setDefaultPartitioning(self):
+ from storage.partspec import PartSpec
+ ret = Platform.setDefaultPartitioning(self)
+ ret.append(PartSpec(mountpoint="/boot/uboot", fstype="vfat", size=20,
+ maxSize=20,
+ grow=True, weight=self.weight(fstype="vfat")))
+ return ret
+
+ def weight(self, fstype=None, mountpoint=None):
+ score = Platform.weight(self, fstype=fstype, mountpoint=mountpoint)
+ if score:
+ return score
+ elif fstype == "vfat" and mountpoint == "/boot/uboot":
+ return 6000
+ else:
+ return 0
+
def getPlatform(anaconda):
"""Check the architecture of the system and return an instance of a
Platform subclass to match. If the architecture could not be determined,
@@ -375,6 +401,11 @@ def getPlatform(anaconda):
elif iutil.isX86():
return X86(anaconda)
elif iutil.isARM():
- return ARM(anaconda)
+ armMachine = iutil.getARMMachine()
+
+ if (armMachine == "omap" ):
+ return omapARM(anaconda)
+ else:
+ return ARM(anaconda)
else:
raise SystemError, "Could not determine system architecture."
--
1.7.10.4
11 years, 8 months
[newui] Two fixes for the newui exception handling
by Vratislav Podzimek
PATCH 1/2 adds two methods needed by python-meh to user interfaces. We had such
method in the old UI and the other way to do that would be some getattr hack,
which I'd like to avoid.
PATCH 2/2 removes the (not needed?) line causing traceback.
Vratislav Podzimek (2):
Add mainExceptionWindow and saveExceptionWindow methods to the
interfaces
Do not run __del__() on anaconda interface in runDebug
pyanaconda/exception.py | 2 --
pyanaconda/ui/__init__.py | 12 ++++++++++++
pyanaconda/ui/gui/__init__.py | 11 +++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
--
1.7.10.4
11 years, 8 months
[PATCH] parse-kickstart: fix "readfile", rename to "readsysfile"
by Will Woods
Make "readfile" more clear about its intent (read one line, discard
errors). Rename it to "readsysfile" just so nobody gets confused about
what it's for.
---
dracut/parse-kickstart | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 2d35560..13a0e8f 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -23,6 +23,15 @@ from collections import OrderedDict
# Default logging: none
log = logging.getLogger('parse-kickstart').addHandler(logging.NullHandler())
+# Helper function for reading simple files in /sys
+def readsysfile(f):
+ '''Return the contents of f, or "" if missing.'''
+ try:
+ val = open(f).readline().strip()
+ except IOError:
+ val = ""
+ return val
+
# Here are the kickstart commands we care about:
class Method(commands.method.F14_Method):
@@ -143,13 +152,9 @@ def is_mac(addr):
def find_devname(mac):
for netif in os.listdir("/sys/class/net"):
- try:
- thismac = readfile("/sys/class/net/%s/address" % netif)
- except IOError:
- pass
- else:
- if thismac.lower() == mac.lower():
- return netif
+ thismac = readsysfile("/sys/class/net/%s/address" % netif)
+ if thismac.lower() == mac.lower():
+ return netif
def ksnet_to_dracut(args, lineno, net, bootdev=False):
'''Translate the kickstart network data into dracut network data.'''
@@ -218,13 +223,6 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
return " ".join(line)
-def readfile(f):
- try:
- val = open(f).readline().strip()
- except IOError:
- val = None
- return val
-
def ksnet_to_ifcfg(net, filename=None):
'''Write an ifcfg file for the given kickstart network config'''
dev = net.device
@@ -238,8 +236,8 @@ def ksnet_to_ifcfg(net, filename=None):
if not os.path.isdir("/tmp/ifcfg"):
os.makedirs("/tmp/ifcfg")
ifcfg['DEVICE'] = dev
- ifcfg['HWADDR'] = readfile("/sys/class/net/%s/address" % dev)
- ifcfg['UUID'] = readfile("/proc/sys/kernel/random/uuid")
+ ifcfg['HWADDR'] = readsysfile("/sys/class/net/%s/address" % dev)
+ ifcfg['UUID'] = readsysfile("/proc/sys/kernel/random/uuid")
ifcfg['ONBOOT'] = "yes" if net.onboot else "no"
# dhcp etc.
--
1.7.11.2
11 years, 8 months
[PATCH] Add "Starting installer..." messages
by Will Woods
Print a couple of messages as anaconda starts up so the user isn't
confused about what's happening after the screen goes dark.
---
anaconda | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/anaconda b/anaconda
index fc679c9..15d13e6 100755
--- a/anaconda
+++ b/anaconda
@@ -646,6 +646,8 @@ def prompt_for_ssh():
if __name__ == "__main__":
+ print "Starting installer, one moment..."
+
setupPythonPath()
# Allow a file to be loaded as early as possible
@@ -708,6 +710,13 @@ if __name__ == "__main__":
from pyanaconda import vnc
from pyanaconda import kickstart
+ print "anaconda %s for %s %s%s started." % (
+ getAnacondaVersion(),
+ product.productName,
+ product.productVersion,
+ " (pre-release)" if not product.isFinal else "",
+ )
+
# to set UTF8 mode on the terminal, we need LANG to be set usefully
if os.environ.get("LANG", "C") == "C":
os.environ['LANG'] = DEFAULT_LANG
--
1.7.10.4
11 years, 8 months
[newui] use the virtio rsyslog template (#820106)
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
The rsyslog template for forwarding logs over virtio was lost when
loader was removed.
---
pyanaconda/anaconda_log.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index f9d884e..68b0f70 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -224,7 +224,7 @@ class AnacondaLog:
def setupVirtio(self):
"""Setup virtio rsyslog logging.
"""
- TEMPLATE = "*.* %s\n"
+ TEMPLATE = "*.* %s;anaconda_syslog\n"
if not os.path.exists(self.VIRTIO_PORT) \
or not os.access(self.VIRTIO_PORT, os.W_OK):
--
1.7.7.6
11 years, 8 months
[newui] log package installation
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
log to syslog as well as /mnt/sysimage/root/install.log so that virtio
and remote logging see the progress of the install.
---
pyanaconda/packaging/yumpayload.py | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 5d85b3a..85f534c 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -45,6 +45,9 @@ import time
from . import *
+import logging
+log = logging.getLogger("anaconda")
+
try:
import rpm
except ImportError:
@@ -72,9 +75,6 @@ from pyanaconda.image import findFirstIsoImage
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
-import logging
-log = logging.getLogger("anaconda")
-
from pyanaconda.errors import *
from pyanaconda.packaging import NoSuchGroup, NoSuchPackage
import pyanaconda.progress as progress
@@ -1133,6 +1133,7 @@ class RPMCallback(object):
log_msg = msg_format % (mode, txmbr.po,
self.completed_actions,
self.total_actions)
+ log.info(log_msg)
self.install_log.write("%s %s\n" % (time.strftime("%H:%M:%S"),
log_msg))
self.install_log.flush()
--
1.7.7.6
11 years, 8 months
[PATCH 1/2] dracut: fix crash with PXE ipappend and ks=file:..
by Will Woods
If you're using pxelinux with 'ipappend 2', it will add a "BOOTIF=..."
argument to your boot args.
parse-kickstart will rewrite your first 'network' line to a "ip=..."
argument for dracut.
But dracut refuses to allow "ip=..." and "BOOTIF=..." arguments to mix,
so this makes it die with the message:
FATAL: Mixing BOOTIF and ip= lines is dangerous
So: parse-kickstart should check the boot arguments, and not bother
generating an "ip=..." line if "BOOTIF" is already there.
---
dracut/parse-kickstart | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart
index 3b6b861..d81dc72 100755
--- a/dracut/parse-kickstart
+++ b/dracut/parse-kickstart
@@ -23,6 +23,23 @@ from collections import OrderedDict
# Default logging: none
log = logging.getLogger('parse-kickstart').addHandler(logging.NullHandler())
+# So we can examine commandline args
+def readfile(f):
+ try:
+ val = open(f).readline().strip()
+ except IOError:
+ val = None
+ return val
+
+def read_cmdline(f):
+ args = OrderedDict()
+ for arg in readfile(f).split():
+ k,e,v = arg.partition("=")
+ args[k] = v
+ return args
+
+proc_cmdline = read_cmdline("/proc/cmdline")
+
# Here are the kickstart commands we care about:
class Method(commands.method.F14_Method):
@@ -79,7 +96,7 @@ class Network(commands.network.F16_Network):
# write ifcfg for all listed devices
ksnet_to_ifcfg(net)
# anaconda tradition: bring up the first device listed, and no others
- if len(self.network) == 1:
+ if len(self.network) == 1 and "BOOTIF" not in proc_cmdline:
netline = ksnet_to_dracut(args, lineno, net, bootdev=True)
return netline
@@ -215,13 +232,6 @@ def ksnet_to_dracut(args, lineno, net, bootdev=False):
return " ".join(line)
-def readfile(f):
- try:
- val = open(f).readline().strip()
- except IOError:
- val = None
- return val
-
def ksnet_to_ifcfg(net, filename=None):
'''Write an ifcfg file for the given kickstart network config'''
dev = net.device
--
1.7.11.2
11 years, 8 months
[PATCH 0/4] lorax/livemedia-creator patches
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
These patches switch lorax over to use execWith* functions so that we can log
everything, and moves the templates for live media creation into their own
directory tree.
I have successfully created a f17 boot.iso with lorax (that booted, but failed
to run anaconda because of changes on master), and I have created a f17 live
iso using the newui iso to drive it (with one small patch to anaconda).
Brian C. Lane (4):
livemedia-creator: cleanup logging a bit
clean up command execution
move live templates into their own subdir of share
add logging to lorax
share/config_files/live/x86/boot.msg | 5 --
share/config_files/live/x86/grub.conf | 13 ----
share/config_files/live/x86/isolinux.cfg | 99 -------------------------
share/live/arm.tmpl | 79 ++++++++++++++++++++
share/live/config_files/x86/boot.msg | 5 ++
share/live/config_files/x86/grub.conf | 13 ++++
share/live/config_files/x86/isolinux.cfg | 99 +++++++++++++++++++++++++
share/live/efi.tmpl | 51 +++++++++++++
share/live/ppc.tmpl | 117 ++++++++++++++++++++++++++++++
share/live/s390.tmpl | 33 +++++++++
share/live/sparc.tmpl | 38 ++++++++++
share/live/x86.tmpl | 77 ++++++++++++++++++++
src/pylorax/__init__.py | 7 +-
src/pylorax/executils.py | 26 ++++++-
src/pylorax/imgutils.py | 49 ++++++-------
src/pylorax/ltmpl.py | 18 +++--
src/pylorax/sysutils.py | 4 +-
src/pylorax/treebuilder.py | 17 +++--
src/sbin/livemedia-creator | 74 +++++++++----------
src/sbin/lorax | 39 ++++++++++-
20 files changed, 655 insertions(+), 208 deletions(-)
delete mode 100644 share/config_files/live/x86/boot.msg
delete mode 100644 share/config_files/live/x86/grub.conf
delete mode 100644 share/config_files/live/x86/isolinux.cfg
create mode 100644 share/live/arm.tmpl
create mode 100644 share/live/config_files/x86/boot.msg
create mode 100644 share/live/config_files/x86/grub.conf
create mode 100644 share/live/config_files/x86/isolinux.cfg
create mode 100644 share/live/efi.tmpl
create mode 100644 share/live/ppc.tmpl
create mode 100644 share/live/s390.tmpl
create mode 100644 share/live/sparc.tmpl
create mode 100644 share/live/x86.tmpl
--
1.7.7.6
11 years, 8 months