summaryrefslogtreecommitdiffstats
path: root/loader2/method.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-02-13 22:16:55 +0000
committerJeremy Katz <katzj@redhat.com>2003-02-13 22:16:55 +0000
commit4dc1a04916b8d9ae1193370e51777dac565ef7d3 (patch)
tree70fdb0e17bde0b11a7da6be6e877d3bf33065901 /loader2/method.c
parent3da29eced0bde086f3a6ff20b269e84196a408df (diff)
downloadanaconda-4dc1a04916b8d9ae1193370e51777dac565ef7d3.tar.gz
anaconda-4dc1a04916b8d9ae1193370e51777dac565ef7d3.tar.xz
anaconda-4dc1a04916b8d9ae1193370e51777dac565ef7d3.zip
move method from cmdline settings to a function.
add hard drive and cdrom add urlinstall based on patch from mattdm@mattdm.org (#84156)
Diffstat (limited to 'loader2/method.c')
-rw-r--r--loader2/method.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/loader2/method.c b/loader2/method.c
index 700033e8c..6cef9be5f 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -56,7 +56,9 @@
#undef dev_t
#define dev_t dev_t
-
+#include "nfsinstall.h"
+#include "hdinstall.h"
+#include "urlinstall.h"
int umountLoopback(char * mntpoint, char * device) {
int loopfd;
@@ -614,3 +616,37 @@ int copyFileAndLoopbackMount(int fd, char * dest, int flags,
return 0;
}
+
+void setMethodFromCmdline(char * arg, struct loaderData_s * ld) {
+ char * c;
+ ld->method = strdup(arg);
+
+ c = ld->method;
+ /* : will let us delimit real information on the method */
+ if ((c = strtok(c, ":"))) {
+ c = strtok(NULL, ":");
+
+ if (!strcmp(ld->method, "nfs")) {
+ ld->methodData = calloc(sizeof(struct nfsInstallData *), 1);
+ ((struct nfsInstallData *)ld->methodData)->host = c;
+ if ((c = strtok(NULL, ":"))) {
+ ((struct nfsInstallData *)ld->methodData)->directory = c;
+ }
+ } else if (!strcmp(ld->method, "ftp") ||
+ !strcmp(ld->method, "http")) {
+ ld->methodData = calloc(sizeof(struct urlInstallData *), 1);
+ ((struct urlInstallData *)ld->methodData)->url = strdup(arg);
+ } else if (!strcmp(ld->method, "cdrom")) {
+ /* no cdrom specific data */
+ } else if (!strcmp(ld->method, "harddrive") ||
+ !strcmp(ld->method, "hd")) {
+ ld->methodData = calloc(sizeof(struct hdInstallData *), 1);
+ ((struct hdInstallData *)ld->methodData)->partition = c;
+ if ((c = strtok(NULL, ":"))) {
+ ((struct hdInstallData *)ld->methodData)->directory = c;
+ }
+ }
+
+ }
+
+}