New: [rhinstaller/blivet/pulls/98 rhel7-branch] Include LUKSDevice information in kickstart data (#1139222)
by dashea
Resolves: rhbz#1139222
Previously, if a device had a child that was a LUKS device that child was
ignored when generating ksdata. What this meant was that that device's
format, which was luks, was used in generating the kickstart data.
Now, the LUKSDevice, which contains the format that should appear in the ks
output is used. This means that the LUKS format is used to set some ks data,
but the mountpoint and so forth are overwritten with the correct values
when the format on the LUKSDevice is used to populate those values.
The --passphrase option with passphrase continues to not appear in the
output anaconda-ks.cfg file.
Signed-off-by: mulhern <amulhern(a)redhat.com>
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/98
8 years, 12 months
New: [rhinstaller/blivet/pulls/60 master] Master tasks
by dashea
The purpose of this patch is to make blivet able to operate in a context in which it is aware of what external dependencies are available. What this means is a couple of things:
* If a DeviceAction that requires an external resource is constructed and that resource is unavailable then the constructor will raise an exception. Currently these exceptions are ValueErrors, which are the same kind of exception raised when the device or some other aspect of the environment has a problem.
* All methods on formats like formattable, supported, are environment aware. Previously they usually returned True if the functionality was implemented in blivet...now they only return True if the functionality is implemented _and_ also the external tool required is available. So, where anaconda uses methods to determine whether to display a particular filesystem type in a combo, those should all return False if the operations they check can not be run.
* Ultimately, if by some chance a method is called requiring a task with an unavailable external dependency, an exception will be raised indicating that the problem is the unavailability of the external application. This is already implemented in the filesystem format tasks and will be implemented in the libblockdev plugins. There are two external apps in devices, multipath and kpartx for which perhaps it should be implemented as well.
Availability of resources has its own separate simple packages. There are only two kinds of external resources so far, libblockdev plugins and executables. libblockdev plugin availability is checked by loadedness, which is always going to be correct on an installed system. executable are available if their names are in $PATH.
There are three different categories of things to track availability of, in order of difficulty are:
* non-filesystem formats
* filesystem formats
* devices
Non-filesystem formats are easy, because if they depend on anything external they depend on exactly one libblockdev plugin. SwapSpace is an example and all others are handled similarly. All methods like formattable, supportable, typically just check whether the plugin is available. There's just not much to look at for this.
Filesystem formats are bit harder. Each filesystem has a lot of tasks to do, create, mount, fsck, info getting, size calculating, etc, and these can be handled by different applications that get installed by different packages. To handle this, these tasks are abstracted out into subclasses of Task and each is set up with an unavailable and an unimplemented method. It is the availability of these tasks that is checked for the various filesystem format properties. Abstracting these tasks into separate tasks forms a significant part of these patches but these probably don't require a lot of scrutiny either. There are no additional tests for these tasks, as they are like friend classes of the filesystem formats and don't really make sense being tested outside the formats classes. They all pass a bunch of regression tests on filesystem formats.
Devices is of course the hardest. Besides device classes just generally being more intricate there are the following problems:
* Calculations must be done recursively on ancestor devices.
* Dependencies seem to accumulate as you travel down the class hierarchy.
* Abstracting into tasks like for filesystem formats is not going to happen, but devices aren't really like non-filesystems formats in having just one simple dependency, either.
Under these circumstances it is impossible to be correct about all dependencies so I have aimed for being conservative, i.e., sometimes raising an exception when constructing a DeviceAction that actually could go through by some special circumstances. There are only two mechanisms:
* an ability to find unavailable external resources for a device and all its ancestors
* an ability to find unavailable external resources required for setting up formats for the formats on all the ancestors of a device
I've chosen these because it seems, from study of the code, that for almost every DeviceAction a setup task must be performed that requires doing things to the device and to the formats on that device.
Generally there will be some small check on the specifics of the action as well; for example, the ActionDestroyFormat class has a check whether the format to be destroyed is actually destroyable.
When creating a format, I check whether the format is formattable, DeviceFormat's are not formattable so an exception is raised in that case.
Currently, the search for unavailable external resources for a device and all its ancestors has only two modes, Default and Destroy. I chose to add the Destroy mode, because a PartitionDevice has a dependency on the dm plugin but only in the _postDestroy method and AFAICT, it would be a little harsh to require the dm plugin for every combination of DeviceAction, PartitionDevice. The mode mechanism is ready to be extended as necessary to refine the search to only relevant dependencies in case some other situation comes up where the DeviceAction constructor would raise an exception even though the action could be succesfully executed (and it is considered worthwhile to distinguish).
For checking whether formats are setupable I wrote two functions that mirror the structure of Device.setup and Device.setupParents, so that these function do not check the setupability of formats that setup does not actually try to setup.
In summary, it's probably OK to skip the code about formats, although you might want to look at the Tasks abstractions, and to focus on how I deal with devices, and how I insert calls into DeviceAction classes. That's the tricky part.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/60
8 years, 12 months
[Patch for Review] Introduce delay for slow USB devices to detect OEMDRV on time.
by B_B_Singh@DELL.com
Hi ,
During the installation of RHEL-7.X the driver pack drivers or OEMDRV is NOT getting detected on time, due to which the latest drivers will not get installed from OEMDRV.
The problem is due to slow usb.
Upon introducing the delay for slow usb (OEMDRV) during the insertion of modules after "udevadm trigger" everything works fine.
Here is the patch.
--- anaconda-19.31.79/dracut/driver-updates.sh 2015-04-20 23:03:45.160081886 +0530
+++ anaconda-19.31.79_new/dracut/driver-updates.sh 2015-04-20 23:07:38.719101243 +0530
@@ -4,6 +4,7 @@
# load all modules
udevadm trigger
+sleep 2
udevadm settle
# Look for devices with the OEMDRV label
Regards
Balaji Singh
9 years
Re: [Patch for Review] iSCSI Name Validation using regex.
by Sujith Pandel
Hi Vratislav,
Thank you for your feedback on this.
One of the changes which you mentioned in this:
> > --- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
> > +++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
> > @@ -18,7 +18,7 @@
> > #
> > # Red Hat Author(s): Chris Lumens <clumens(a)redhat.com>
> > #
> > -
> > +import re
> > +from pyanaconda.regexes import ISCSI_IQN_NAME_REGEX, ISCSI_EUI_NAME_REGEX
> >....
> > + #iSCSI Name validation using regex. Name should either match IQN format or EUI format.
> > + if re.match(ISCSI_IQN_NAME_REGEX,stripped) or re.match(ISCSI_EUI_NAME_REGEX,stripped):
> We prefer calling the match() method of the compiled regexes instead of
> using re.match() on them. That would also remove allow you to get rid of
> the commas that would otherwise need a space right after them. :)
>
> > + return True
> > + else:
> > + return False
> This if statement should be reduced to just:
>
> return ISCSI_ION_NAME_REGEX.match(stripped) or ISCSI_EUI_NAME_REGEX.match(stripped)
>
>
Please note that this results in a run time exception when return value becomes 'None'. Verified this condition.
(Boolean values are expected at the receiving end.)
Based on your suggestions above, I am thinking of changing it to:
if ISCSI_IQN_NAME_REGEX.match(stripped) or ISCSI_EUI_NAME_REGEX.match(stripped):
return True
else:
return False
This will also prevent the need to "import re" in iscsi.py
Let me know if any changes are required to it.
> > +import unittest
> > +import re
> Seems like the 're' module is not needed anywhere below.
>
Yes. I'll remove it.
I'll send the modified patch incorporating the changes once you confirm on these changes.
Thanks and Regards,
Sujith Pandel
9 years
New: [rhinstaller/blivet/pulls/101 rhel7-branch] Include LUKSDevice information in kickstart data (#1139222)
by dashea
Resolves: rhbz#1139222
Previously, if a device had a child that was a LUKS device that child was
ignored when generating ksdata. What this meant was that that device's
format, which was luks, was used in generating the kickstart data.
Now, the LUKSDevice, which contains the format that should appear in the ks
output is used. This means that the LUKS format is used to set some ks data,
but the mountpoint and so forth are overwritten with the correct values
when the format on the LUKSDevice is used to populate those values.
The --passphrase option with passphrase continues to not appear in the
output anaconda-ks.cfg file.
Signed-off-by: mulhern <amulhern(a)redhat.com>
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/101
9 years
[PATCH] Adapt to the new argument list for save_servers_to_config.
by Chris Lumens
This was caught by pylint.
---
anaconda | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/anaconda b/anaconda
index b124b52..565a263 100755
--- a/anaconda
+++ b/anaconda
@@ -1362,7 +1362,7 @@ if __name__ == "__main__":
# setup ntp servers and start NTP daemon if not requested otherwise
if can_touch_runtime_system("start chronyd"):
if anaconda.ksdata.timezone.ntpservers:
- ntp.save_servers_to_config(anaconda.ksdata.timezone.ntpservers)
+ ntp.save_servers_to_config([], anaconda.ksdata.timezone.ntpservers)
if not anaconda.ksdata.timezone.nontp:
iutil.start_service("chronyd")
--
2.2.2
9 years
[anaconda][f22-blocker] Catch libblockdev's CryptoError when trying to unlock LUKS
by Vratislav Podzimek
Otherwise we get a traceback instead of warning and another chance for the user.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/rescue.py | 5 +++--
pyanaconda/ui/gui/spokes/custom.py | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/rescue.py b/pyanaconda/rescue.py
index b3c96b3..6fba78d 100644
--- a/pyanaconda/rescue.py
+++ b/pyanaconda/rescue.py
@@ -42,6 +42,7 @@ from blivet.devices import LUKSDevice
from blivet.osinstall import storageInitialize, mountExistingSystem
from pykickstart.constants import KS_REBOOT, KS_SHUTDOWN
+from gi.repository import BlockDev as blockdev
import meh.ui.text
@@ -245,8 +246,8 @@ def _unlock_devices(intf, storage):
unlocked = True
# try to use the same passhprase for other devices
try_passphrase = passphrase
- except StorageError as serr:
- log.error("Failed to unlock %s: %s", device.name, serr)
+ except (StorageError, blockdev.CryptoError) as err:
+ log.error("Failed to unlock %s: %s", device.name, err)
device.teardown(recursive=True)
device.format.passphrase = None
try_passphrase = None
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 19b376a..95e53a0 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -88,6 +88,7 @@ from pyanaconda.ui.gui.utils import really_hide, really_show, timed_action
from pyanaconda.ui.categories.system import SystemCategory
from gi.repository import Gdk, Gtk
+from gi.repository import BlockDev as blockdev
from gi.repository.AnacondaWidgets import MountpointSelector
from functools import wraps
@@ -2653,7 +2654,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
try:
device.setup()
device.format.setup()
- except StorageError as e:
+ except (StorageError, blockdev.CryptoError) as e:
log.error("failed to unlock %s: %s", device.name, e)
device.teardown(recursive=True)
self._error = e
--
2.1.0
9 years