Another try, this time with a lot more testing. Not much to say that hasn't already been sit or is said in the commit messages. But this does seem to do the right thing now.
--jlk
This is useful as the install user's shell, rather than having anaconda direct as that shell. --- scripts/Makefile.am | 2 +- scripts/run-anaconda | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 scripts/run-anaconda
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 01c0492..3813ee6 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -18,7 +18,7 @@ # Author: David Cantrell dcantrell@redhat.com
scriptsdir = $(libexecdir)/$(PACKAGE_NAME) -dist_scripts_SCRIPTS = upd-updates +dist_scripts_SCRIPTS = upd-updates run-anaconda dist_scripts_DATA = pyrc.py dist_noinst_SCRIPTS = upd-kernel makeupdates
diff --git a/scripts/run-anaconda b/scripts/run-anaconda new file mode 100755 index 0000000..d31f70c --- /dev/null +++ b/scripts/run-anaconda @@ -0,0 +1,6 @@ +#!/usr/bin/bash +# +# Quick script to attach to tmux where anaconda is running +# + +/usr/bin/tmux -u attach -t anaconda
When installing on s390x, we just want to run pure anaconda on the tty. This will either detect s390x and print out ssh details for the user to ssh in to continue the isntall (and get tmux), or if a kickstart was provided and the RUNKS option was used it will just blast through the kickstart in cmdline mode. Tmux doesn't work in x3270, the terminal for s390x, so we have to avoid using it. --- data/systemd/Makefile.am | 1 + data/systemd/anaconda-direct.service | 19 +++++++++++++++++++ data/systemd/anaconda-generator | 8 ++++++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 data/systemd/anaconda-direct.service
diff --git a/data/systemd/Makefile.am b/data/systemd/Makefile.am index 96bd8f0..7edc212 100644 --- a/data/systemd/Makefile.am +++ b/data/systemd/Makefile.am @@ -21,6 +21,7 @@ systemddir = /lib/systemd/system generatordir = /lib/systemd/system-generators
dist_systemd_DATA = anaconda.service \ + anaconda-direct.service \ anaconda.target \ anaconda-tmux@.service \ anaconda-shell@.service \ diff --git a/data/systemd/anaconda-direct.service b/data/systemd/anaconda-direct.service new file mode 100644 index 0000000..c92dd9b --- /dev/null +++ b/data/systemd/anaconda-direct.service @@ -0,0 +1,19 @@ +[Install] +WantedBy=anaconda.target + +[Unit] +Description=the anaconda installation program +Wants=instperf.service rsyslog.service udev-settle.service NetworkManager.service +After=instperf.service rsyslog.service udev-settle.service NetworkManager.service anaconda-sshd.service +Requires=anaconda.service + +[Service] +Environment=HOME=/root MALLOC_CHECK_=2 MALLOC_PERTURB_=204 PATH=/usr/bin:/bin:/sbin:/usr +Type=oneshot +WorkingDirectory=/root +ExecStart=/usr/sbin/anaconda +StandardInput= +StandardOutput=journal+console +StandardError=journal+console +TimeoutSec=0 + diff --git a/data/systemd/anaconda-generator b/data/systemd/anaconda-generator index 4c8b828..41ee092 100755 --- a/data/systemd/anaconda-generator +++ b/data/systemd/anaconda-generator @@ -24,8 +24,12 @@ while [ -f /sys/class/tty/$tty/active ]; do done consoletty="$tty"
-# put anaconda on the real console -service_on_tty anaconda-tmux@.service $consoletty +# put anaconda on the real console if not s390x, otherwise put anaconda direct +if [ $(uname -m) = "s390x" ]; then + ln -sf $systemd_dir/anaconda-direct.service $target_dir/ +else + service_on_tty anaconda-tmux@.service $consoletty +fi
# put a shell on tty2 and the first virtualization console we find for tty in tty2 hvc0 hvc1 xvc0 hvsi0 hvsi1 hvsi2; do
If anaconda is launched /inside/ tmux, the TMUX variable will be present. This is the anaconda we want to attach to, so don't prompt for ssh here. --- anaconda | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/anaconda b/anaconda index c2d246d..cf3758c 100755 --- a/anaconda +++ b/anaconda @@ -671,7 +671,7 @@ if __name__ == "__main__": # see if we're on s390x and if we've got an ssh connection uname = os.uname() if uname[4] == 's390x': - if 'SSH_CONNECTION' not in os.environ and "RUNKS" not in flags.cmdline: + if 'TMUX' not in os.environ and "RUNKS" not in flags.cmdline: prompt_for_ssh() sys.exit(0) # If we get RUNKS, we default to cmdline display mode, because nothing
This keeps the ugly hack going, but it keeps us from crashing on the s390 case where anaconda gets launched twice (once to prompt for ssh, once inside tmux to do the actual install). --- anaconda | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/anaconda b/anaconda index cf3758c..90fad45 100755 --- a/anaconda +++ b/anaconda @@ -138,10 +138,13 @@ def setupPythonUpdates(): from distutils.sysconfig import get_python_lib
# Temporary hack for F18 alpha to symlink updates and product directories - # into tmpfs. To be removed after alpha in order to directly use content + # into tmpfs. To be removed after beta in order to directly use content # from /run/install/ -- JLK for dirname in ("updates", "product"): if os.path.exists("/run/install/%s" % dirname): + if os.path.islink("/tmp/%s" % dirname): + # Assume updates have already been setup + return os.symlink("/run/install/%s" % dirname, "/tmp/%s" % dirname)
On Wed, Oct 10, 2012 at 04:12:52PM -0700, Jesse Keating wrote:
Another try, this time with a lot more testing. Not much to say that hasn't already been sit or is said in the commit messages. But this does seem to do the right thing now.
ACK, other than the misspelling in the commit msg in 2/4
anaconda-patches@lists.fedorahosted.org