summaryrefslogtreecommitdiffstats
path: root/anaconda
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2013-02-06 16:09:51 -0800
committerBrian C. Lane <bcl@redhat.com>2013-02-08 10:13:07 -0800
commit151ebab12ecb6bb7eebd6ca35b8d10ec25ccde16 (patch)
tree9653fadcc0a1d9a5d7490da4bef6b3c2076a6ddb /anaconda
parent20b027211e466c48266cadb9f3ad60650dabdc66 (diff)
downloadanaconda-151ebab12ecb6bb7eebd6ca35b8d10ec25ccde16.tar.gz
anaconda-151ebab12ecb6bb7eebd6ca35b8d10ec25ccde16.tar.xz
anaconda-151ebab12ecb6bb7eebd6ca35b8d10ec25ccde16.zip
Add --dirinstall command
This disables the storage spoke and installs to /mnt/sysimage without mounting any filesystems. If something is already mounted on /mnt/sysimage it leaves it untouched. This can be useful for utilities like livemedia-creator which will mount a filesystem image on the directory and then run anaconda to install to it.
Diffstat (limited to 'anaconda')
-rwxr-xr-xanaconda32
1 files changed, 21 insertions, 11 deletions
diff --git a/anaconda b/anaconda
index 10d1abbef..324d31eec 100755
--- a/anaconda
+++ b/anaconda
@@ -49,7 +49,7 @@ def exitHandler(rebootData, storage, exitCode=None):
while True:
time.sleep(10000)
- if image_count:
+ if image_count or flags.dirInstall:
anaconda.storage.umountFilesystems(ignoreErrors=True, swapoff=False)
devicetree = anaconda.storage.devicetree
devicetree.teardownAll()
@@ -59,7 +59,8 @@ def exitHandler(rebootData, storage, exitCode=None):
loop.controllable = True
device.deactivate(recursive=True)
- if not flags.imageInstall and not flags.livecdInstall:
+ if not flags.imageInstall and not flags.livecdInstall \
+ and not flags.dirInstall:
from pykickstart.constants import KS_SHUTDOWN, KS_WAIT, KS_REBOOT
from pyanaconda.iutil import dracut_eject
@@ -281,6 +282,7 @@ def parseOptions(argv=None, cmdline=None):
op.add_option("--updates", dest="updateSrc", action="store", type="string")
op.add_option("--dlabel", action="store_true", default=False)
op.add_option("--image", action="append", dest="images", default=[])
+ op.add_option("--dirinstall", action="store_true", default=False)
op.add_option("--memcheck", action="store_true", default=True)
op.add_option("--nomemcheck", action="store_false", dest="memcheck")
op.add_option("--leavebootorder", action="store_true", default=False)
@@ -650,10 +652,8 @@ if __name__ == "__main__":
from pyanaconda import addons
# do this early so we can set flags before initializing logging
- from pyanaconda.flags import flags
+ from pyanaconda.flags import flags, can_touch_runtime_system
(opts, args, depr) = parseOptions(cmdline=flags.cmdline)
- if opts.images:
- flags.imageInstall = True
# Set up logging as early as possible.
import logging
@@ -671,6 +671,14 @@ if __name__ == "__main__":
stdoutLog.error("anaconda must be run as root.")
sys.exit(0)
+ if opts.images and opts.dirinstall:
+ stdoutLog.error("--images and --dirinstall cannot be used at the same time")
+ sys.exit(0)
+ elif opts.images:
+ flags.imageInstall = True
+ elif opts.dirinstall:
+ flags.dirInstall = True
+
# see if we're on s390x and if we've got an ssh connection
uname = os.uname()
if uname[4] == 's390x':
@@ -794,7 +802,7 @@ if __name__ == "__main__":
flags.mpath = opts.mpath
flags.selinux = opts.selinux
- if not flags.livecdInstall and not flags.imageInstall:
+ if can_touch_runtime_system("start audit daemon"):
startAuditDaemon()
# setup links required for all install types
@@ -989,18 +997,20 @@ if __name__ == "__main__":
networkInitialize(ksdata)
- threadMgr.add(AnacondaThread(name="AnaStorageThread", target=storageInitialize, args=(anaconda.storage, ksdata, anaconda.protected)))
+ if not flags.dirInstall:
+ threadMgr.add(AnacondaThread(name="AnaStorageThread", target=storageInitialize, args=(anaconda.storage, ksdata, anaconda.protected)))
threadMgr.add(AnacondaThread(name="AnaWaitForConnectingNMThread", target=wait_for_connecting_NM_thread, args=(ksdata,)))
threadMgr.add(AnacondaThread(name="AnaPayloadThread", target=payloadInitialize, args=(anaconda.storage, ksdata, anaconda.payload)))
atexit.register(exitHandler, ksdata.reboot, anaconda.storage)
# setup ntp servers and start NTP daemon if not requested otherwise
- if (not flags.imageInstall) and anaconda.ksdata.timezone.ntpservers:
- ntp.save_servers_to_config(anaconda.ksdata.timezone.ntpservers)
+ if can_touch_runtime_system("start chronyd"):
+ if anaconda.ksdata.timezone.ntpservers:
+ ntp.save_servers_to_config(anaconda.ksdata.timezone.ntpservers)
- if not anaconda.ksdata.timezone.nontp:
- iutil.start_service("chronyd")
+ if not anaconda.ksdata.timezone.nontp:
+ iutil.start_service("chronyd")
# FIXME: This will need to be made cleaner once this file starts to take
# shape with the new UI code.