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.
This commit is contained in:
parent
40c7d835b9
commit
2696c9b917
@ -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 },
|
||||
@ -203,6 +205,12 @@ dispatch_msgConfirm(dialogMenuItem *unused)
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
static int
|
||||
dispatch_mediaOpen(dialogMenuItem *unused)
|
||||
{
|
||||
return mediaOpen();
|
||||
}
|
||||
|
||||
static int
|
||||
dispatch_mediaClose(dialogMenuItem *unused)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 },
|
||||
@ -203,6 +205,12 @@ dispatch_msgConfirm(dialogMenuItem *unused)
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
static int
|
||||
dispatch_mediaOpen(dialogMenuItem *unused)
|
||||
{
|
||||
return mediaOpen();
|
||||
}
|
||||
|
||||
static int
|
||||
dispatch_mediaClose(dialogMenuItem *unused)
|
||||
{
|
||||
|
@ -122,6 +122,14 @@ cpioVerbosity()
|
||||
return "";
|
||||
}
|
||||
|
||||
int
|
||||
mediaOpen(void)
|
||||
{
|
||||
if (!mediaDevice || !mediaVerify() || !DEVICE_INIT(mediaDevice))
|
||||
return DITEM_FAILURE;
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
mediaClose(void)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user