FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-25-2011, 11:00 PM
"Brian C. Lane"
 
Default Add noeject support anaconda (#665094)

When noeject is passed on the kernel command line do not eject the
cdrom, not even if eject is passed in a kickstart file.

Resolves: rhbz#665094
---
anaconda | 4 ++++
flags.py | 1 +
storage/devices.py | 5 +++++
3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/anaconda b/anaconda
index 2c16e36..aabb809 100755
--- a/anaconda
+++ b/anaconda
@@ -251,6 +251,7 @@ def parseOptions():
op.add_option("--ibft", action="store_true")
op.add_option("--noiscsi", dest="iscsi", action="store_false", default=False)
op.add_option("--iscsi", action="store_true")
+ op.add_option("--noeject", action="store_true")

# Miscellaneous
op.add_option("--module", action="append", default=[])
@@ -783,6 +784,9 @@ if __name__ == "__main__":
if opts.iscsi:
flags.iscsi = 1

+ if opts.noeject:
+ flags.noeject = True
+
if opts.targetArch:
flags.targetarch = opts.targetArch

diff --git a/flags.py b/flags.py
index 702a30d..e01ec63 100644
--- a/flags.py
+++ b/flags.py
@@ -94,6 +94,7 @@ class Flags:
self.__dict__['flags']['sshd'] = 0
self.__dict__['flags']['noverifyssl'] = False
self.__dict__['flags']['preexisting_x11'] = False
+ self.__dict__['flags']['noeject'] = False
# for non-physical consoles like some ppc and sgi altix,
# we need to preserve the console device and not try to
# do things like bogl on them. this preserves what that
diff --git a/storage/devices.py b/storage/devices.py
index 2a243d2..61082be 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -109,6 +109,7 @@ import block

from errors import *
from iutil import notify_kernel, numeric_type
+from flags import flags
from .storage_log import log_method_call
from udev import *
from formats import get_device_format_class, getFormat, DeviceFormat
@@ -3605,6 +3606,10 @@ class OpticalDevice(StorageDevice):
#try to umount and close device before ejecting
self.teardown()

+ if flags.noeject:
+ log.info("noeject in effect, not ejecting cdrom")
+ return
+
# Make a best effort attempt to do the eject. If it fails, it's not
# critical.
fd = os.open(self.path, os.O_RDONLY | os.O_NONBLOCK)
--
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:33 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org