summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2006-01-27 21:00:31 +0000
committerjkim <jkim@FreeBSD.org>2006-01-27 21:00:31 +0000
commit2696c9b917d23fe657d74ed0da554cc778a6a7df (patch)
tree779e8f0fda55c6dc317a4e9f4ac1b1da15d6a532 /usr.sbin/sade
parent40c7d835b9c0f0875af9bbcd1a9f8e838f5a3ca1 (diff)
downloadFreeBSD-src-2696c9b917d23fe657d74ed0da554cc778a6a7df.zip
FreeBSD-src-2696c9b917d23fe657d74ed0da554cc778a6a7df.tar.gz
Add `mediaOpen' function. This function mounts selected media device.
For example, you can dynamically generate and load configuration file depending on the hardware configuration with the following template: mediaSetCDROM mediaOpen command='/dist/rescue/sh /dist/scripts/install.sh' system mediaClose configFile=/tmp/generated.cfg loadConfig Now we have full access to files on the media before installation begins.
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/dispatch.c8
-rw-r--r--usr.sbin/sade/sade.85
-rw-r--r--usr.sbin/sade/sade.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c
index 4896b23..b1d0099 100644
--- a/usr.sbin/sade/dispatch.c
+++ b/usr.sbin/sade/dispatch.c
@@ -45,6 +45,7 @@
static int dispatch_shutdown(dialogMenuItem *unused);
static int dispatch_systemExecute(dialogMenuItem *unused);
static int dispatch_msgConfirm(dialogMenuItem *unused);
+static int dispatch_mediaOpen(dialogMenuItem *unused);
static int dispatch_mediaClose(dialogMenuItem *unused);
static struct _word {
@@ -91,6 +92,7 @@ static struct _word {
{ "installVarDefaults", installVarDefaults },
{ "loadConfig", dispatch_load_file },
{ "loadFloppyConfig", dispatch_load_floppy },
+ { "mediaOpen", dispatch_mediaOpen },
{ "mediaClose", dispatch_mediaClose },
{ "mediaSetCDROM", mediaSetCDROM },
{ "mediaSetFloppy", mediaSetFloppy },
@@ -204,6 +206,12 @@ dispatch_msgConfirm(dialogMenuItem *unused)
}
static int
+dispatch_mediaOpen(dialogMenuItem *unused)
+{
+ return mediaOpen();
+}
+
+static int
dispatch_mediaClose(dialogMenuItem *unused)
{
mediaClose();
diff --git a/usr.sbin/sade/sade.8 b/usr.sbin/sade/sade.8
index aeb268e..378359d 100644
--- a/usr.sbin/sade/sade.8
+++ b/usr.sbin/sade/sade.8
@@ -629,6 +629,11 @@ configuration file from another.
.It configFile
The fully qualified pathname of the file to load.
.El
+.It mediaOpen
+If a media device is set, mount it.
+.Pp
+.Sy Variables :
+None
.It mediaClose
If a media device is open, close it.
.Pp
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index d099cca..3dfc048 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -702,6 +702,7 @@ extern u_char default_scrnmap[];
/* media.c */
extern char *cpioVerbosity(void);
+extern int mediaOpen(void);
extern void mediaClose(void);
extern int mediaTimeout(void);
extern int mediaSetCDROM(dialogMenuItem *self);
OpenPOWER on IntegriCloud