[PATCH] pylint wants regexes with backslashes to be specified with 'r'.
by Chris Lumens
---
scripts/makebumpver | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/makebumpver b/scripts/makebumpver
index f3c00b9..5647cdd 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -107,7 +107,7 @@ class MakeBumpVer:
fields = lines[0].split(' ')
if len(fields) == 2 and fields[1].startswith('rhel'):
- branch_pattern="^rhel(\d+)-(.*)"
+ branch_pattern=r"^rhel(\d+)-(.*)"
m = re.match(branch_pattern, fields[1])
if m:
return m.group(1)
@@ -216,7 +216,7 @@ class MakeBumpVer:
return True
bzentry = self._queryBug(bug)
- ack_pattern="rhel-%s\.\d+\.\d+" % self.rhel
+ ack_pattern=r"rhel-%s\.\d+\.\d+" % self.rhel
for f in bzentry.flags:
if re.match(ack_pattern, f['name']) and f['status'] == '+':
return True
--
1.8.3.1
10 years, 6 months
[PATCH] add setting of the exiting subvolume UUID for fstab
by Gene Czarcinski
Earlier in BTRFSData, the BTRFS volume (the parent of all
subvolumes) is determined and assigned to "dev". The value of
dev.uuid can be used to set the uuid value for the subvolume which,
in turn, will then be used in fstab.
This patch was tested as an updates img against Fedora 20 Beta TC6.
The current code works, this patch just makes it work a little better
by using the UUID.
---
pyanaconda/kickstart.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index e6ed38d..4546e14 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -386,6 +386,8 @@ class BTRFSData(commands.btrfs.F17_BTRFSData):
raise KickstartValueError(formatErrorMsg(self.lineno, msg="Specified nonexistent BTRFS volume %s in btrfs command" % self.name))
device.format.mountpoint = self.mountpoint
+ if dev:
+ device.format.uuid = dev.uuid # use the UUID from the parent (the BTRFS Volume)
else:
request = storage.newBTRFS(name=name,
subvol=self.subvol,
--
1.8.3.1
10 years, 6 months
[makebumpver 0/3] Add makebumpver to blivet
by Brian C. Lane
From: "Brian C. Lane" <bcl(a)redhat.com>
Patch #1 updates the version numbers in setup and __init__ which had never been
updated since we started using x.y.z numbering (this is for blivet rhel7-branch)
Patch #2 adds a blivet specific version of makebumpver and changes the Makefile
to use it.
Patch #3 adds ack checking for the rhel branch.
I'd like to put all 2,3 on blivet master and 1,2,3 on rhel7-branch.
I want to add patch 3 (ack checking) to anaconda master and rhel7-branch (it
applies with a few small changes).
ack checking can be skipped by passing -s/--skip-acks to makebumpver or setting
SKIP_ACKS environmental variable while doing make bumpver.
Brian C. Lane (3):
Fix setup and init version numbers
Add makebumpver script
Add ack flag checking to makebumpver
Makefile | 24 ++-
blivet/__init__.py | 2 +-
scripts/makebumpver | 512 ++++++++++++++++++++++++++++++++++++++++++++++++++++
setup.py | 2 +-
4 files changed, 528 insertions(+), 12 deletions(-)
create mode 100755 scripts/makebumpver
--
1.8.3.1
10 years, 6 months
[master/f20-branch/rhel7-branch] Check that s390x LVM configuration is valid. (#873135, #885011)
by Samantha N. Bueno
On s390x, /boot (or / if /boot isn't a mountpoint) needs to exist on a
single PV if using LVM, so check for this.
Resolves: rhbz#873135
Resolves: rhbz#885011
---
pyanaconda/bootloader.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index cf769ed..600ba6f 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -40,6 +40,7 @@ import pyanaconda.network
from pyanaconda.nm import nm_device_hwaddress
from blivet import platform
from pyanaconda.i18n import _, N_
+from blivet.errors import SinglePhysicalVolumeError
import logging
log = logging.getLogger("anaconda")
@@ -718,6 +719,17 @@ class BootLoader(object):
"device.") % self.stage2_description)
valid = False
+ # s390x can only have /boot on a single PV; or if there is no /boot
+ # partition, / must be on a single PV, so check for that here
+ if self.stage2_device.type == "lvmlv":
+ try:
+ self.stage2_device._getSinglePV()
+ valid = True
+ except SinglePhysicalVolumeError as e:
+ msg = str(e)
+ self.errors.append(msg)
+ valid = False
+
log.debug("is_valid_stage2_device(%s) returning %s" % (device.name,
valid))
return valid
--
1.8.3.1
10 years, 6 months
[PATCH] Make 'ks=cdrom' scan all optical media (#828589)
by Will Woods
In Ye Olde Times, 'ks=cdrom' would make loader poll all optical drives
for media. We can do that pretty easily with udev these days, so let's
bring that behavior back.
The syntax for inst.ks=cdrom is now: inst.ks=cdrom[:<path>].
Note that there's no <dev> argument anymore; if you know what device
your kickstart is on, use "inst.ks=hd:<dev>[:<path>]" instead.
We'll still accept "inst.ks=cdrom:<dev>:<path>", but <dev> will be
ignored.
While I'm at it, I've cleaned up kickstart-genrules.sh so it's easier to
follow and it prints better log messages. Woo!
---
dracut/kickstart-genrules.sh | 30 ++++++++++++++++++------------
dracut/parse-anaconda-kickstart.sh | 1 +
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/dracut/kickstart-genrules.sh b/dracut/kickstart-genrules.sh
index f29ad87..25165e6 100755
--- a/dracut/kickstart-genrules.sh
+++ b/dracut/kickstart-genrules.sh
@@ -4,22 +4,28 @@
. /lib/anaconda-lib.sh
case "${kickstart%%:*}" in
- http|https|ftp|nfs)
+ http|https|ftp|nfs|nfs4)
# handled by fetch-kickstart-net in the online hook
+ info "inst.ks: will fetch kickstart once network comes online"
wait_for_kickstart
;;
- cdrom|hd|bd) # cdrom, cdrom:<dev>:<path>, hd:<dev>:<path>, bd:<dev>:<path>
+ cdrom) # cdrom, cdrom:<path> - kickstart on optical media
+ splitsep ":" "$kickstart" kstype kspath
+ # if we get cdrom:<dev>:<path>, split out (and ignore) the ksdev
+ strstr "$kspath" ":" && splitsep ":" "$kickstart" kstype ksdev kspath
+ printf 'SUBSYSTEM=="block", ENV{ID_CDROM_MEDIA}=="1", RUN+="/sbin/initqueue --settled --onetime --name cdrom-ks fetch-kickstart-disk $env{DEVNAME} %s"\n' "$kspath" >> $rulesfile
+ info "inst.ks: will scan optical media for ${kspath:-/ks.cfg}"
+ wait_for_kickstart
+ ;;
+ hd) # hd:<dev>:<path> - kickstart on disk device
splitsep ":" "$kickstart" kstype ksdev kspath
- [ "$kstype" = "cdrom" ] && [ -z "$ksdev" ] && ksdev="/dev/cdrom"
ksdev=$(disk_to_dev_path $ksdev)
- if [ "$kstype" = "bd" ]; then # TODO FIXME: no biospart support yet
- warn "inst.ks='$kickstart'"
- warn "can't get kickstart: biospart isn't supported yet"
- ksdev=""
- else
- when_diskdev_appears "$ksdev" \
- fetch-kickstart-disk \$env{DEVNAME} "$kspath"
- wait_for_kickstart
- fi
+ when_diskdev_appears "$ksdev" \
+ fetch-kickstart-disk \$env{DEVNAME} "$kspath"
+ info "inst.ks: will look for ${kspath:-/ks.cfg} on $ksdev"
+ wait_for_kickstart
+ ;;
+ bd) # bd:<dev>:<path> - biospart (TODO... if anyone uses this anymore)
+ warn "inst.ks: can't get kickstart - biospart (bd:) isn't supported yet"
;;
esac
diff --git a/dracut/parse-anaconda-kickstart.sh b/dracut/parse-anaconda-kickstart.sh
index d445e27..930b6b6 100755
--- a/dracut/parse-anaconda-kickstart.sh
+++ b/dracut/parse-anaconda-kickstart.sh
@@ -29,5 +29,6 @@ case "${kickstart%%:*}" in
warn "can't find $kspath!"
fi
;;
+ # cdrom/hd are handled later - see (pre-trigger/50-)kickstart-genrules.sh
esac
export kickstart
--
1.8.3.1
10 years, 6 months
[master/f20/rhel7] Minor updates to boot-options.txt document.
by Anne Mulhern
Related: rhbz#831512
Updates information about format for inst.updates and inst.ks to be less
confusing for me. Adds my name to the list of authors since if it's to be kept
up-to-date it's better to have at least one other author. Listed myself second
in :Author: field because ascii-doc doesn't accomodate additonal authors
easily.
Signed-off-by: mulhern <amulhern(a)redhat.com>
---
docs/boot-options.txt | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/docs/boot-options.txt b/docs/boot-options.txt
index 5ced706..2db9522 100644
--- a/docs/boot-options.txt
+++ b/docs/boot-options.txt
@@ -1,7 +1,6 @@
Anaconda Boot Options
=====================
-Will Woods <wwoods(a)redhat.com>
-v17.0, June 6 2012: Rewrite for F17 changes.
+:Author: Will Woods <wwoods(a)redhat.com> and Anne Mulhern <amulhern(a)redhat.com>
// written in asciidoc: http://www.methods.co.nz/asciidoc/
// here's a few macros to improve readability in the text below..
@@ -93,10 +92,10 @@ Kickstart
---------
=== inst.ks ===
-Give the location of a kickstart file to be used to automate the install. Uses
-the same formats as `inst.repo`.
+Give the location of a kickstart file to be used to automate the install.
+Locations may be specified using any of the formats allowed for `inst.repo`.
-If `<path>` is omitted, `/ks.cfg` is assumed.
+For any format the `<path>` component defaults to `/ks.cfg` if it is omitted.
If `inst.ks` is used without a value, the installer will look for
`nfs:<next_server>:/<filename>`:
@@ -278,9 +277,10 @@ broken systems.
=== inst.updates ===
Give the location of an `updates.img` to be applied to the installer runtime.
-Takes the same arguments as `inst.repo` and `inst.ks`.
+Locations may be specified using any of the formats allowed for `inst.repo`.
-If no `<path>` is given, `/updates.img` is assumed.
+For any format the `<path>` component defaults to `/updates.img` if it is
+omitted.
=== inst.loglevel ===
`inst.loglevel=<debug|info|warning|error|critical>`::
@@ -381,8 +381,7 @@ machine.
Use `console=ttyS0` or similar instead. See <<console,console>> for details.
=== updates ===
-Plain `updates` is no longer supported. Use `inst.updates=hd:<dev>[:<img>]`,
-discussed above.
+Use `inst.updates` instead.
=== essid, wepkey, wpakey ===
Dracut doesn't support wireless networking, so these don't do anything.
--
1.8.3.1
10 years, 6 months
[PATCH] Only eject CDROM devices we're actually using (#949919)
by Will Woods
Rather than ejecting *every optical drive* on the system, we should only
eject those devices that are actually being used by the installer.
So, check each cdrom device to see if it's mounted somewhere, and eject
it if so.
---
anaconda | 9 ++++-----
pyanaconda/iutil.py | 7 +++++++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/anaconda b/anaconda
index 968a3de..7dd5547 100755
--- a/anaconda
+++ b/anaconda
@@ -62,13 +62,12 @@ def exitHandler(rebootData, storage, exitCode=None):
if not flags.imageInstall and not flags.livecdInstall \
and not flags.dirInstall:
from pykickstart.constants import KS_SHUTDOWN, KS_WAIT
- from pyanaconda.iutil import dracut_eject
+ from pyanaconda.iutil import dracut_eject, get_mount_paths
if flags.eject or rebootData.eject:
- for drive in storage.devicetree.devices:
- if drive.type != "cdrom":
- continue
- dracut_eject(drive.path)
+ for cdrom in storage.devicetree.getDevicesByType("cdrom"):
+ if get_mount_paths(cdrom.path):
+ dracut_eject(cdrom.path)
if rebootData.action == KS_SHUTDOWN:
subprocess.Popen(["systemctl", "--no-wall", "poweroff"])
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index ff7d32b..45614d2 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -758,3 +758,10 @@ def upcase_first_letter(text):
return text.upper()
else:
return text[0].upper() + text[1:]
+
+def get_mount_paths(devnode):
+ '''given a device node, return a list of all active mountpoints.'''
+ devno = os.stat(devnode).st_rdev
+ majmin = "%d:%d" % (os.major(devno),os.minor(devno))
+ mountinfo = (line.split() for line in open("/proc/self/mountinfo"))
+ return [info[4] for info in mountinfo if info[2] == majmin]
--
1.8.3.1
10 years, 6 months
[PATCH] Correctly accept 'sshd' boot arg as alias for 'inst.sshd' (#924157)
by Will Woods
In dracut/parse-anaconda-options.sh we have:
check_depr_arg "sshd" "inst.sshd"
which makes us accept "sshd" as an alias for inst.sshd, *inside* the
initrd. But this script runs in the anaconda runtime, so we don't have
/etc/cmdline.d/75-anaconda-options.conf anymore, so getarg only sees
the actual boot args - which don't contain inst.sshd.
We could copy /run/install/cmdline.d/* into /etc/cmdline.d, but I'm not
sure if that would have surprising or unintended side-effects.
So let's do the simple thing: check for both inst.sshd and sshd.
---
data/systemd/anaconda-generator | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/systemd/anaconda-generator b/data/systemd/anaconda-generator
index 41ee092..ba82c8f 100755
--- a/data/systemd/anaconda-generator
+++ b/data/systemd/anaconda-generator
@@ -45,6 +45,6 @@ done
# platform. Really any platform with a crappy console that can't do curses
# or have multiple VTs should get sshd spawned automatically, but we don't
# yet have a good way of detecting these platforms.
-if getargbool 0 inst.sshd || [ $(uname -m) = "s390x" ]; then
+if getargbool 0 sshd inst.sshd || [ $(uname -m) = "s390x" ]; then
ln -sf $systemd_dir/anaconda-sshd.service $target_dir/anaconda-sshd.service
fi
--
1.8.3.1
10 years, 6 months
[blivet][master/rhel7-branch] If installing on s390x, check to make sure /boot is on single PV. (#873135, #885011)
by Samantha N. Bueno
Resolves: rhbz#873135
Resolves: rhbz#885011
---
blivet/__init__.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index 9420c50..83d3507 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1458,6 +1458,12 @@ class Blivet(object):
swaps = self.fsset.swapDevices
try:
boot = self.bootDevice
+ # /boot must be on a single PV if installing on s390x, since ZIPL
+ # can't handle anything more complex
+ if arch.isS390() and boot.type == "lvmlv":
+ if not boot.singlePV:
+ errors.append(_("This platform requires /boot on a single "
+ "physical volume or disk."))
except (DeviceError, AttributeError):
boot = None
--
1.8.3.1
10 years, 6 months