[anaconda] Use Size for all size quantities.
by David Lehman
This doesn't include the blivet req version bump in the spec, which I'm
adding locally right after sending this.
Also, I'm not totally sure the increase of the length of the size entry
is needed -- that was added when I was trying to display sizes based on
binary prefixes (MiB) as decimal-prefixed units (MB).
10 years, 4 months
[PATCH rhel7-branch] network GUI: ignore fcoe vlan devices (#1051268)
by Radek Vykydal
Resolves: rhbz#1051268
---
pyanaconda/ui/gui/spokes/network.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 1dbec82..0c1baea 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -650,6 +650,9 @@ class NetworkControlBox(GObject.GObject):
def add_device_to_list(self, device):
if device.get_device_type() not in self.supported_device_types:
return
+ # ignore fcoe vlan devices
+ if device.get_iface().endswith('fcoe'):
+ return
try:
con_uuid = nm.nm_device_setting_value(device.get_iface(), "connection", "uuid")
--
1.7.11.7
10 years, 4 months
[PATCH 1/2] dracut: add when_any_cdrom_appears for cdrom autoprobe
by Will Woods
This works a lot like when_diskdev_appears, except you don't need to
pass a device name - the specified command will be added to the
initqueue whenever udev finds valid CDROM media.
---
dracut/anaconda-lib.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 86ab570..9e24136 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -154,6 +154,12 @@ when_diskdev_appears() {
} >> $rulesfile
}
+when_any_cdrom_appears() {
+ local cmd="/sbin/initqueue --settled --onetime --name autocd $*"
+ printf 'SUBSYSTEM=="block", ENV{ID_CDROM_MEDIA}=="1", RUN+="%s"\n' "$cmd" \
+ >> $rulesfile
+}
+
# dracut doesn't bring up the network unless:
# a) $netroot is set (i.e. you have a network root device), or
# b) /tmp/net.ifaces exists.
--
1.8.4.2
10 years, 4 months
[PATCH 1/2] make anaconda-shell@.service match getty@.service
by Will Woods
They're basically the same thing, so we should use the same
configuration. Changes:
* Type=idle - the service waits until any related jobs finish
* add '--noclear' - TTYVTDisallocate clears the terminal for us
* IgnoreSIGPIPE=no - agetty/bash should handle SIGPIPE appropriately
Note that we *don't* set the terminal to 'linux'; agetty should
automatically use 'linux' for VTs and 'vt100' for serial terminals, and
I'm not sure 'linux' is appropriate for serial/virt consoles.
---
data/systemd/anaconda-shell@.service | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/data/systemd/anaconda-shell@.service b/data/systemd/anaconda-shell@.service
index 0422615..bc69fd1 100644
--- a/data/systemd/anaconda-shell@.service
+++ b/data/systemd/anaconda-shell@.service
@@ -8,7 +8,8 @@ ConditionKernelCommandLine=!inst.noshell
[Service]
WorkingDirectory=/
-ExecStart=-/sbin/agetty -n -l /bin/bash -o '--login' %I 38400
+ExecStart=-/sbin/agetty --noclear -n -l /bin/bash -o '--login' %I 38400
+Type=idle
Restart=always
RestartSec=0
TTYPath=/dev/%I
@@ -17,3 +18,4 @@ TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
KillSignal=SIGHUP
+IgnoreSIGPIPE=no
--
1.8.4.2
10 years, 4 months
[PATCH] dracut: minor shell cleanup
by Will Woods
getargbool doesn't echo any result, so $(getargbool ...) will always
evaluate to the empty string (""). This works fine in this case:
if $(getargbool ...); then ...
because the 'if' statement uses the *return* value of the command, not its
output. But if getargbool echoed a result (like getarg), this would
break. So remove the subshell escape.
---
dracut/parse-anaconda-options.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index 4ed6650..a508938 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -104,7 +104,7 @@ warn_renamed_arg "kssendsn" "inst.ks.sendsn"
# Ignore self-signed SSL certs
warn_renamed_arg "noverifyssl" "inst.noverifyssl"
-if $(getargbool 0 noverifyssl inst.noverifyssl); then
+if getargbool 0 noverifyssl inst.noverifyssl; then
# Tell dracut to use curl --insecure
echo "rd.noverifyssl" >> /etc/cmdline.d/75-anaconda-options.conf
fi
--
1.8.4.2
10 years, 4 months
[PATCH] fix inst.noshell (#807703)
by Will Woods
Suppress the anaconda shell if 'inst.noshell' or 'noshell' are in the
boot args. Note that any argument is ignored, so 'inst.noshell=false'
still disables the shell.
---
data/systemd/anaconda-shell@.service | 2 ++
1 file changed, 2 insertions(+)
diff --git a/data/systemd/anaconda-shell@.service b/data/systemd/anaconda-shell@.service
index 41c4469..0422615 100644
--- a/data/systemd/anaconda-shell@.service
+++ b/data/systemd/anaconda-shell@.service
@@ -3,6 +3,8 @@
[Unit]
Description=Shell on %I
After=systemd-user-sessions.service plymouth-quit-wait.service
+ConditionKernelCommandLine=!noshell
+ConditionKernelCommandLine=!inst.noshell
[Service]
WorkingDirectory=/
--
1.8.4.2
10 years, 4 months
[isomd5sum] Display supported iso status (#1026336)
by Brian C. Lane
---
libcheckisomd5.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libcheckisomd5.c b/libcheckisomd5.c
index 0454513..a7a9433 100644
--- a/libcheckisomd5.c
+++ b/libcheckisomd5.c
@@ -360,6 +360,7 @@ int printMD5SUM(char *file) {
if ( (strlen(fragmentsums) > 0) && (fragmentcount > 0) ) {
printf("Fragment sums: %s\n", fragmentsums);
printf("Fragment count: %lld\n", fragmentcount);
+ printf("Supported ISO: %s\n", supported ? "yes" : "no");
}
return 0;
--
1.8.4.2
10 years, 4 months
[master/rhel7-branch] Error gracefully if we have a question in cmdline mode. (#869731), v02
by Samantha N. Bueno
(Take two, with mulhern's and vpodzime's suggestions.)
Show a nice error message before bailing instead of just crashing.
Resolves: rhbz#869731
---
pyanaconda/errors.py | 6 ++++--
pyanaconda/exception.py | 14 ++++++++++++++
pyanaconda/ui/tui/hubs/summary.py | 3 ++-
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/errors.py b/pyanaconda/errors.py
index 6fe7bba..744f0f5 100644
--- a/pyanaconda/errors.py
+++ b/pyanaconda/errors.py
@@ -19,12 +19,11 @@
# Author(s): Chris Lumens <clumens(a)redhat.com>
from pyanaconda.i18n import _
-from pyanaconda.ui.tui import TextUserInterface
__all__ = ["ERROR_RAISE", "ERROR_CONTINUE", "ERROR_RETRY",
"ErrorHandler",
"InvalidImageSizeError", "MissingImageError", "MediaUnmountError",
- "MediaMountError", "ScriptError",
+ "MediaMountError", "ScriptError", "CmdlineError",
"errorHandler"]
class InvalidImageSizeError(Exception):
@@ -42,6 +41,9 @@ class MediaUnmountError(Exception):
class ScriptError(Exception):
pass
+class CmdlineError(Exception):
+ pass
+
# These constants are returned by the callback in the ErrorHandler class.
# Each represents a different kind of action the caller can take:
#
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index a32f318..ca3471e 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -32,6 +32,7 @@ import signal
import time
import kickstart
import blivet.errors
+from pyanaconda.errors import CmdlineError
from pyanaconda.ui.communication import hubQ
from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
from pyanaconda.threads import threadMgr
@@ -90,6 +91,19 @@ class AnacondaExceptionHandler(ExceptionHandler):
"The installer will now terminate.") % str(value)
self.intf.messageWindow(_("Hardware error occured"), hw_error_msg)
sys.exit(0)
+ elif (issubclass (ty, CmdlineError)):
+
+ cmdline_error_msg = _("\nThe installation was stopped due to "
+ "incomplete spokes detected while running "
+ "in non-interactive cmdline mode. Since there "
+ "can not be any questions in cmdline mode, "
+ "edit your kickstart file and retry "
+ "installation.\nThe exact error message is: "
+ "\n\n%s.\n\nThe installer will now terminate.") % str(value)
+ print(cmdline_error_msg)
+ # sleep for a bit so the error message has a chance of being seen
+ time.sleep(10)
+ sys.exit(0)
else:
try:
# pylint: disable-msg=E0611
diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py
index 78bd5fc..5865033 100644
--- a/pyanaconda/ui/tui/hubs/summary.py
+++ b/pyanaconda/ui/tui/hubs/summary.py
@@ -22,6 +22,7 @@
from pyanaconda.ui.tui.hubs import TUIHub
from pyanaconda.flags import flags
+from pyanaconda.errors import CmdlineError
from pyanaconda.i18n import _
import sys
import time
@@ -61,6 +62,6 @@ class SummaryHub(TUIHub):
if not flags.ksprompt:
errtxt = _("The following mandatory spokes are not completed:") + \
"\n" + "\n".join(spoke.title for spoke in incompleteSpokes)
- raise RuntimeError(errtxt)
+ raise CmdlineError(errtxt)
return TUIHub.prompt(self, args)
--
1.8.3.1
10 years, 4 months
[blivet:rhel7/master 00/10] Changes to the handling of filesystem labeling (v3)
by Anne Mulhern
The first four patches listed below haven't changed, so I'm not sending them.
The most important thing is that I had to make the DeviceFormat.label setter
much
less restrictive than I had previously thought and compensate for that by
adding a few methods to the DeviceFormat interface that anaconda can make use
of when setting labels in the GUI.
This patch needs to go in before the associated anaconda patch, since it
provides some methods that patch uses.
mulhern (10):
Add some simple tests for file formats.
Changes to the handling of filesystem labeling (#1038590)
Remove fsConfigFromFile (#1038590)
More tests to check writing and reading labels (#1038590)
Restore ability to write an empty label where possible (#1038590)
Indicate whether the filesystem can label (#1038590)
Add a labelFormatOK method to the DeviceFormat's interface (#1038590)
Default to None to mean none, rather than empty string (#1038590)
Add a test for labeling swap devices (#1038590)
Move label setter and getter into DeviceFormat class (#1038590)
blivet/devicelibs/swap.py | 2 +-
blivet/formats/__init__.py | 57 +++++++++
blivet/formats/fs.py | 154 ++++++++++++-----------
blivet/formats/fslabel.py | 264 ++++++++++++++++++++++++++++++++++++++++
blivet/formats/swap.py | 13 ++
tests/formats_test/__init__.py | 0
tests/formats_test/misc_test.py | 183 ++++++++++++++++++++++++++++
7 files changed, 594 insertions(+), 79 deletions(-)
create mode 100644 blivet/formats/fslabel.py
create mode 100644 tests/formats_test/__init__.py
create mode 100755 tests/formats_test/misc_test.py
--
1.8.3.1
10 years, 4 months
[PATCH] Make the firstboot mixin spokes more mixable.
by David Shea
Instead of duplicating the firstboot should_run code in classes that
need to override it, note the expected inheritance order in the
firstboot mixin classes and use super calls for most of the should_run
logic.
---
pyanaconda/ui/common.py | 12 ++++++++++--
pyanaconda/ui/gui/spokes/user.py | 16 +++++-----------
pyanaconda/ui/tui/spokes/user.py | 17 +++++------------
3 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py
index 63a7afc..7fa3638 100644
--- a/pyanaconda/ui/common.py
+++ b/pyanaconda/ui/common.py
@@ -113,6 +113,9 @@ class UIObject(object):
class FirstbootSpokeMixIn(object):
"""This MixIn class marks Spokes as usable for Firstboot
and Anaconda.
+
+ Unlike other mixins, this class should be first in the inheritance list
+ so that it overrides Spoke.should_run.
"""
@classmethod
def should_run(cls, environment, data):
@@ -126,7 +129,8 @@ class FirstbootSpokeMixIn(object):
the data argument.
"""
- if environment == ANACONDA_ENVIRON:
+ # First check the superclass method
+ if super(FirstbootSpokeMixIn, cls).should_run(environment, data):
return True
elif environment == FIRSTBOOT_ENVIRON and data is None:
# cannot decide, stay in the game and let another call with data
@@ -143,7 +147,11 @@ class FirstbootSpokeMixIn(object):
class FirstbootOnlySpokeMixIn(object):
- """This MixIn class marks Spokes as usable for Firstboot."""
+ """This MixIn class marks Spokes as usable for Firstboot.
+
+ Like FirstbootSpokeMixIn, this class should be placed first in the
+ inheritance order.
+ """
@classmethod
def should_run(cls, environment, data):
"""This method is responsible for beginning Spoke initialization
diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 07d9012..88ea50a 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -31,8 +31,7 @@ from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.ui.gui.utils import enlightbox
from pyanaconda.ui.helpers import GUISpokeInputCheckHandler, GUIInputCheckHandler, InputCheck
-from pykickstart.constants import FIRSTBOOT_RECONFIG
-from pyanaconda.constants import ANACONDA_ENVIRON, FIRSTBOOT_ENVIRON,\
+from pyanaconda.constants import FIRSTBOOT_ENVIRON,\
PASSWORD_EMPTY_ERROR, PASSWORD_CONFIRM_ERROR_GUI, PASSWORD_STRENGTH_DESC,\
PASSWORD_WEAK, PASSWORD_WEAK_WITH_ERROR, PASSWORD_WEAK_CONFIRM,\
PASSWORD_WEAK_CONFIRM_WITH_ERROR
@@ -202,17 +201,12 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler):
@classmethod
def should_run(cls, environment, data):
- # the user spoke should run always in the anaconda and in firstboot only
- # when doing reconfig or if no user has been created in the installation
- if environment == ANACONDA_ENVIRON:
- return True
- elif environment == FIRSTBOOT_ENVIRON and data is None:
- # cannot decide, stay in the game and let another call with data
- # available (will come) decide
+ # Check the superclass should_run
+ if super(UserSpoke, cls).should_run(environment, data):
return True
+ # If running in firstboot, check if a user has been created
elif environment == FIRSTBOOT_ENVIRON and data and \
- (data.firstboot.firstboot == FIRSTBOOT_RECONFIG or \
- len(data.user.userList) == 0):
+ len(data.user.userList) == 0:
return True
else:
return False
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py
index 8cc96ac..8636bcf 100644
--- a/pyanaconda/ui/tui/spokes/user.py
+++ b/pyanaconda/ui/tui/spokes/user.py
@@ -24,8 +24,7 @@ from pyanaconda.ui.tui.spokes import EditTUISpokeEntry as Entry
from pyanaconda.ui.common import FirstbootSpokeMixIn
from pyanaconda.users import guess_username
from pyanaconda.i18n import N_, _
-from pykickstart.constants import FIRSTBOOT_RECONFIG
-from pyanaconda.constants import ANACONDA_ENVIRON, FIRSTBOOT_ENVIRON
+from pyanaconda.constants import FIRSTBOOT_ENVIRON
from pyanaconda.regexes import GECOS_VALID, USERNAME_VALID, GROUPLIST_SIMPLE_VALID
__all__ = ["UserSpoke"]
@@ -46,23 +45,17 @@ class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke):
@classmethod
def should_run(cls, environment, data):
- # the user spoke should run always in the anaconda and in firstboot only
- # when doing reconfig or if no user has been created in the installation
- if environment == ANACONDA_ENVIRON:
- return True
- elif environment == FIRSTBOOT_ENVIRON and data is None:
- # cannot decide, stay in the game and let another call with data
- # available (will come) decide
+ # Check the superclass should_run
+ if super(UserSpoke, cls).should_run(environment, data):
return True
+ # If running in firstboot, check if a user has been recreated
elif environment == FIRSTBOOT_ENVIRON and data and \
- (data.firstboot.firstboot == FIRSTBOOT_RECONFIG or \
- len(data.user.userList) == 0):
+ len(data.user.userList) == 0:
return True
else:
return False
def __init__(self, app, data, storage, payload, instclass):
- FirstbootSpokeMixIn.__init__(self)
EditTUISpoke.__init__(self, app, data, storage, payload, instclass)
if self.data.user.userList:
--
1.8.4.2
10 years, 4 months