[blivet] md followups to recent changes and one more
by David Lehman
Patch 1 fixes a bug I introduced with the container device class.
Patches 2 and 3 fix long-standing bugs related to detection of existing
MD.
Patch 4 is a followup to make lvm data caching work with MD PVs.
Patch 5 is unrelated, and makes it so that merely instantiating an action
does not change the device instance it will operate on.
blivet/deviceaction.py | 106 +++++++++++++++++++++++++++++++++++++++++++----
blivet/devicelibs/lvm.py | 11 +++--
blivet/devices.py | 12 ++++--
blivet/devicetree.py | 10 ++++-
tests/action_test.py | 55 ++++++++++++++++++++----
5 files changed, 170 insertions(+), 24 deletions(-)
10 years
[PATCH] Fix unloading modules in driver-updates (#1085099)
by Will Woods
An unintended consequence of commit de2d663 is that driver-updates won't
unload *any* modules at all: /tmp/dd_modules (the list of "early"
modules that shouldn't be removed) is now created *after* we load all
modules.)
This patch makes driver-updates attempt to remove any driver that's in
the update disk(s) it loads.
First we make dd_extract() return a list of the firmware/module files
that were in the driver disk it extracted.
Next process_dd() builds a list of those for each extracted driver and
passes that to reload_modules().
reload_modules() maps those filenames to module names, and adds them to
the list of modules to be unloaded.
NOTE: Probably the correct behavior (and the way it worked in RHEL6)
would be to revert the change to /tmp/dd_modules and fix that bug in a
different way (e.g. by tracking driver disks by UUID instead of device
name, so they don't get loaded twice if the device name changes).
That requires a bunch of refactoring work; this is a stopgap solution.
---
dracut/driver-updates | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/dracut/driver-updates b/dracut/driver-updates
index 5eb4cdc..373884f 100755
--- a/dracut/driver-updates
+++ b/dracut/driver-updates
@@ -252,8 +252,10 @@ def get_module_set(fname):
modules.update([mod_args[0]])
return modules
+def to_modname(modfile):
+ return os.path.basename(modfile)[:-3].replace('-','_')
-def reload_modules():
+def reload_modules(newfiles):
""" Reload new module versions from /lib/modules/<kernel>/updates/
"""
try:
@@ -267,6 +269,12 @@ def reload_modules():
new_modules = current_modules.difference(startup_modules)
log.debug("new_modules = %s", " ".join(new_modules))
+ # And a list of modules contained in the disk we just extracted
+ dd_modules = set(to_modname(f) for f in newfiles if f.endswith(".ko"))
+ # TODO: what modules do we unload when there's new firmware?
+ log.debug("dd_modules = %s", " ".join(dd_modules))
+ new_modules.update(dd_modules)
+
# I think we can just iterate once using modprobe -r to remove unused deps
for module in new_modules:
try:
@@ -369,7 +377,7 @@ def dd_extract(driver, dest_path="/updates/", kernel_ver=None):
:type driver: Driver object
:param dest_path: Top directory of the destination path
:type dest_path: string
- :returns: None
+ :returns: list of paths to extracted firmware and modules
This extracts the driver's files into 'dest_path' (which defaults
to /updates/ so that the normal live updates handling will overlay
@@ -402,12 +410,15 @@ def dd_extract(driver, dest_path="/updates/", kernel_ver=None):
if not os.path.exists(d):
os.makedirs(d)
+ filelist = []
+
# Copy *.ko files over to /updates/lib/modules/<kernel>/updates/
for root, _dirs, files in os.walk(dest_path+"/lib/modules/"):
if root.endswith("/updates") and os.path.isdir(root):
continue
for f in (f for f in files if f.endswith(".ko")):
src = root+"/"+f
+ filelist.append(src)
copy_file(src, ko_updates)
move_file(src, initrd_updates)
@@ -417,9 +428,13 @@ def dd_extract(driver, dest_path="/updates/", kernel_ver=None):
continue
for f in (f for f in files):
src = root+"/"+f
+ filelist.append(src)
copy_file(src, firmware_updates)
move_file(src, initrd_firmware)
+ # Tell our caller about the newly-extracted stuff
+ return filelist
+
# an arbitrary value to signal refreshing the menu contents
DoRefresh = True
@@ -542,15 +557,17 @@ def process_dd(dd_path):
# Copy the repository for Anaconda to use during install
copy_repo(dd_path, "/updates/run/install/DD-")
+ extracted = []
+
for driver in filter(lambda d: d.selected, drivers):
- dd_extract(driver, "/updates/")
+ extracted += dd_extract(driver, "/updates/")
# Write the package names for all modules and firmware for Anaconda
if "modules" in driver.flags or "firmwares" in driver.flags:
with open("/run/install/dd_packages", "a") as f:
f.write("%s\n" % driver.name)
- reload_modules()
+ reload_modules(extracted)
def select_dd(device):
--
1.9.0
10 years
[master][PATCH] Relabel /home partition if using and existing one (#1087736)
by Vratislav Podzimek
If an existing partition is used for the /home mountpoint and there is an
existing directory for the user created in the installation process, we should
relabel the directory so it gets proper SELinux contexts.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/users.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/users.py b/pyanaconda/users.py
index 0c8a5cb..d0d06bd 100644
--- a/pyanaconda/users.py
+++ b/pyanaconda/users.py
@@ -346,12 +346,14 @@ class Users:
orig_gid = stats.st_gid
log.info("Home directory for the user %s already existed, "
- "fixing the owner.", user_name)
+ "fixing the owner and SELinux context.", user_name)
# home directory already existed, change owner of it properly
iutil.chown_dir_tree(userEnt.get(libuser.HOMEDIRECTORY)[0],
userEnt.get(libuser.UIDNUMBER)[0],
groupEnt.get(libuser.GIDNUMBER)[0],
orig_uid, orig_gid)
+ iutil.execWithRedirect("restorecon",
+ ["-r", userEnt.get(libuser.HOMEDIRECTORY)[0]])
except OSError as e:
log.critical("Unable to change owner of existing home directory: %s",
os.strerror)
--
1.9.0
10 years
[PATCH] v3 Add btrfs reclaim for existing subvol
by Gene Czarcinski
These patches update two separate packages: anaconda and pykickstart.
The reclaim capability introduces the "format" functionality available for
standard partitions and LVMLVs by deleting an existing btrfs subvol and
then recreating that subvol.
Gene Czarcinski (1):
v3 update anaconda to add reclaim
pyanaconda/kickstart.py | 8 ++++++++
1 file changed, 8 insertions(+)
Gene Czarcinski (1):
v3 update pykickstart to add reclaim to btrfs command
pykickstart/commands/btrfs.py | 5 +++++
1 file changed, 5 insertions(+)
--
1.9.0
10 years
[master][PATCH] Don't forget to call os._exit() in the child process
by Vratislav Podzimek
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/users.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/users.py b/pyanaconda/users.py
index 0c8a5cb..d13ec02 100644
--- a/pyanaconda/users.py
+++ b/pyanaconda/users.py
@@ -421,7 +421,10 @@ class Users:
self.admin.lockUser(user)
user.set(libuser.SHADOWLASTCHANGE, "")
- self.admin.modifyUser(user)
+ if self.admin.modifyUser(user):
+ os._exit(0)
+ else:
+ os._exit(1)
else:
return self._finishChroot(childpid)
--
1.9.0
10 years
[blivet][master] Fix and tests for the Size.humanReadable method
by Vratislav Podzimek
Vratislav Podzimek (2):
If size is an integer value, show it as an integer value
Add some more tests for the Size.humanReadable method
blivet/size.py | 5 +++++
tests/size_test.py | 23 +++++++++++++++++++++++
2 files changed, 28 insertions(+)
--
1.9.0
10 years
[blivet:master 00/25] Yet more pylint fixes
by Anne Mulhern
A mere 100 warning and errors left to go!
mulhern (25):
Setting variables in __init__
Import name 'deviceaction' where needed
Remove addKeyFromFile() method
Remove suite() methods in tests
Do not evaluate % operator in log message arguments
Make signature of Size.__str__ match signature of Decimal.__str__
Override resize() method in subclasses of StorageDevice
Suppress W0201 errors
Add to false positives an error which is not suppressed by a pragma.
Suppress W0201 error where attribute is set in __new__.
Do not cache the DeviceFormat object
Disable E1003 warning.
Spell BootLoaderError properly
Remove BootLoaderError definitions
Suppress W0602 false positives
Add a stub function for get_bootloader
Suppress W0621 warnings
Suppress W0612 (unused-variable) false positives
Use isResize in isShrink and isGrow.
Disable E1101 (no-member) error
Do not use strip() incorrectly
Put module level code in a method
Rename to avoid conflict with name in outer scope.
Rename bits() to numBits()
Do not assign result of evaluating EddTestFS() to a variable
blivet/__init__.py | 15 +++++++++------
blivet/arch.py | 9 ++++-----
blivet/deviceaction.py | 7 +++++--
blivet/devicefactory.py | 6 ++----
blivet/devicelibs/lvm.py | 6 +++---
blivet/devices.py | 35 ++++++++++++++++++++++++++++++-----
blivet/devicetree.py | 7 ++++---
blivet/formats/__init__.py | 3 +++
blivet/formats/fs.py | 2 +-
blivet/formats/luks.py | 16 ----------------
blivet/formats/swap.py | 1 +
blivet/partitioning.py | 2 +-
blivet/pyudev.py | 15 ++++++++-------
blivet/size.py | 2 +-
blivet/util.py | 9 +++++----
tests/action_test.py | 5 -----
tests/devicefactory_test.py | 4 ----
tests/devicelibs_test/btrfs_test.py | 7 -------
tests/devicelibs_test/crypto_test.py | 4 ----
tests/devicelibs_test/edd_test.py | 20 ++++++++++----------
tests/devicelibs_test/lvm_test.py | 6 ------
tests/devicelibs_test/mdraid_test.py | 7 -------
tests/devicelibs_test/raid_test.py | 3 ---
tests/devicelibs_test/swap_test.py | 5 -----
tests/devices_test.py | 4 ----
tests/formats_test/init_test.py | 3 ---
tests/formats_test/selinux_test.py | 5 -----
tests/partitioning_test.py | 5 -----
tests/pylint/pylint-false-positives | 16 ++++++++++++++++
tests/sanity_check_test.py | 3 ---
tests/size_test.py | 3 ---
tests/tsort_test.py | 6 ------
32 files changed, 103 insertions(+), 138 deletions(-)
--
1.8.3.1
10 years
[master] Three patches for the size module
by Vratislav Podzimek
These three patches should improve UX when using Size instances. I'd like to add
one more that would remove the 'places' argument of the humanReadable method
because it seems to me useless. Then I'll add tests for the Size class which may
result in some more tweaks/fixes.
Vratislav Podzimek (3):
Round sizes in humanReadable instead of flooring them
Make humanReadable size use binary prefixes and nicer units
Make sure that using just k/m/g/... results in ki/mi/gi/...
blivet/size.py | 123 +++++++++++++++++++++++++++++++--------------------------
1 file changed, 66 insertions(+), 57 deletions(-)
--
1.9.0
10 years
[blivet:master 0/4] Catching Exception patches
by Anne Mulhern
The first contains a function for more thoroughly logging exceptions.
It may seem strange that I pass string format args as a list, but it was
not obvious that there was a better way to arrange the arguments.
The remaining three patches all suppress warnings but use the logging function
to log the exception information more completely. The exception logging
function can be extended to, e.g., log more complete information or raise
selected exceptions as appropriate.
mulhern (4):
Add a function that logs available exception info.
Disable some W0703 warnings.
Disable some W0703 warnings
Log exception information and disable W0703 warning.
blivet/__init__.py | 58 +++++++++++++++++++++++++++------------------
blivet/arch.py | 7 ++++--
blivet/deviceaction.py | 8 ++++++-
blivet/devicetree.py | 12 ++++++----
blivet/formats/disklabel.py | 17 ++++++++++++-
blivet/formats/fs.py | 15 ++++++++----
blivet/iscsi.py | 8 +++++--
blivet/storage_log.py | 28 ++++++++++++++++++++++
8 files changed, 115 insertions(+), 38 deletions(-)
--
1.8.3.1
10 years
[PATCH] Add an option to copy translation files to an updates.img
by David Shea
---
scripts/makeupdates | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/scripts/makeupdates b/scripts/makeupdates
index faa1a9e..20b80be 100755
--- a/scripts/makeupdates
+++ b/scripts/makeupdates
@@ -397,6 +397,28 @@ def copyUpdatedWidgets(updates, srcdir, builddir):
if os.path.isfile(typelib):
shutil.copy2(typelib, updates + libdir + "girepository-1.0")
+def copyTranslations(updates, srcdir, builddir):
+ localedir = "/usr/share/locale/"
+
+ # Ensure all the message files are up to date
+ if os.system('make -C %s/po' % builddir) != 0:
+ sys.exit(1)
+
+ # From here gettext puts everything in $srcdir
+ # For each language in LINGUAS, install srcdir/<lang>.gmo as
+ # /usr/share/locale/$language/LC_MESSAGES/anaconda.mo
+ with open(os.path.join(srcdir + '/po/LINGUAS')) as linguas:
+ for line in linguas.readlines():
+ if line.startswith('#'):
+ continue
+
+ for lang in line.strip().split(" "):
+ if not os.path.isdir(updates + localedir + lang + "/LC_MESSAGES"):
+ os.makedirs(updates + localedir + lang + "/LC_MESSAGES")
+
+ shutil.copy2(srcdir + "/po/" + lang + ".gmo",
+ updates + localedir + lang + "/LC_MESSAGES/anaconda.mo")
+
def addRpms(updates_path, add_rpms):
"""Add content one or more RPM packages to the updates image
@@ -864,6 +886,9 @@ def main():
parser.add_argument('-o', '--offset', action='store', type=int, default=0,
help='make image from (latest_tag - OFFSET) to HEAD')
+ parser.add_argument('-p', '--po', action='store_true',
+ help='update translations')
+
# -a/--add can be both used multiple times and multiple paths can be
# passed to a single -a/--add option, all provided paths will be then added
# to the add_rpm list
@@ -919,6 +944,9 @@ def main():
if widgetsChanged(args.tag):
copyUpdatedWidgets(updates, cwd, builddir)
+ if args.po:
+ copyTranslations(updates, cwd, builddir)
+
if args.add_rpms:
# as using -a or --add mutltiple times
# adds a new list to the list instead of extending the
--
1.9.0
10 years