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 > Edubuntu User

 
 
LinkBack Thread Tools
 
Old 09-10-2010, 01:14 AM
"Brian C. Lane"
 
Default Add noeject support to loader (#477887)

When noeject is passed on the kernel command line disable ejecting the
cdrom.
---
loader/cdinstall.c | 6 ++++++
loader/loader.c | 2 ++
loader/loader.h | 2 ++
3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/loader/cdinstall.c b/loader/cdinstall.c
index bde1bff..a8e4dfc 100644
--- a/loader/cdinstall.c
+++ b/loader/cdinstall.c
@@ -69,6 +69,12 @@ static void ejectCdrom(char *device) {
int ejectfd;

if (!device) return;
+
+ if (FL_NOEJECT(flags)) {
+ logMessage(INFO, "noeject in effect, not ejecting cdrom");
+ return;
+ }
+
logMessage(INFO, "ejecting %s...",device);
if ((ejectfd = open(device, O_RDONLY | O_NONBLOCK, 0)) >= 0) {
ioctl(ejectfd, CDROM_LOCKDOOR, 0);
diff --git a/loader/loader.c b/loader/loader.c
index fd71004..a0fecbb 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1018,6 +1018,8 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData,
} else {
flags |= LOADER_FLAGS_SELINUX;
}
+ } else if (!strcasecmp(k, "noeject")) {
+ flags |= LOADER_FLAGS_NOEJECT;
} else if (v != NULL) {
/* boot arguments that are of the form name=value */
/* all arguments in this block require the value */
diff --git a/loader/loader.h b/loader/loader.h
index 1c54c52..e516ca3 100644
--- a/loader/loader.h
+++ b/loader/loader.h
@@ -71,6 +71,7 @@
#define LOADER_FLAGS_NOKILL (((uint64_t) 1) << 38)
#define LOADER_FLAGS_KICKSTART_SEND_SERIAL (((uint64_t) 1) << 39)
#define LOADER_FLAGS_AUTOMODDISK (((uint64_t) 1) << 40)
+#define LOADER_FLAGS_NOEJECT (((uint64_t) 1) << 41)

#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT)
#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE)
@@ -107,6 +108,7 @@
#define FL_NOKILL(a) ((a) & LOADER_FLAGS_NOKILL)
#define FL_KICKSTART_SEND_SERIAL(a) ((a) & LOADER_FLAGS_KICKSTART_SEND_SERIAL)
#define FL_AUTOMODDISK(a) ((a) & LOADER_FLAGS_AUTOMODDISK)
+#define FL_NOEJECT(a) ((a) & LOADER_FLAGS_NOEJECT)

void doExit(int) __attribute__ ((noreturn));
void startNewt(void);
--
1.7.2.2

_______________________________________________
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 08:27 AM.

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