summaryrefslogtreecommitdiffstats
path: root/loader2/hdinstall.c
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-12-17 17:39:43 +0000
committerMike Fulbright <msf@redhat.com>2002-12-17 17:39:43 +0000
commita46c0c55d17e48fbc099d8eb0812a3ef24808afd (patch)
tree923735037dbf8450eba0ace55143b92e8baf8123 /loader2/hdinstall.c
parentce10e9b32a53e20e5584a15754a21da98886be81 (diff)
downloadanaconda-a46c0c55d17e48fbc099d8eb0812a3ef24808afd.tar.gz
anaconda-a46c0c55d17e48fbc099d8eb0812a3ef24808afd.tar.xz
anaconda-a46c0c55d17e48fbc099d8eb0812a3ef24808afd.zip
add support for pulling ks.cfg from hd or cd
Diffstat (limited to 'loader2/hdinstall.c')
-rw-r--r--loader2/hdinstall.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index 65e667b21..c1831ece5 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -28,6 +28,7 @@
#include "driverdisk.h"
#include "hdinstall.h"
+#include "kickstart.h"
#include "loader.h"
#include "loadermisc.h"
#include "log.h"
@@ -518,6 +519,48 @@ void setKickstartHD(struct loaderData_s * loaderData, int argc,
logMessage("results of hd ks, partition is %s, dir is %s", partition, dir);
}
+int kickstartFromHD(char *kssrc, int flags) {
+ int rc;
+ char *p, *q, *tmpstr, *ksdev, *kspath;
+
+ logMessage("getting kickstart file from harddrive");
+
+ /* format is ks=hd:[device]:/path/to/ks.cfg */
+ /* split of pieces */
+ tmpstr = strdup(kssrc);
+ p = strchr(tmpstr, ':');
+ if (p)
+ q = strchr(p+1, ':');
+
+ /* no second colon, assume its the old format of ks=hd:[device]/path/to/ks.cfg */
+ /* this format is bad however because some devices have '/' in them! */
+ if (!q)
+ q = strchr(p+1, '/');
+
+ if (!p || !q) {
+ logMessage("Format of command line is ks=hd:[device]:/path/to/ks.cfg");
+ free(tmpstr);
+ return 1;
+ }
+
+ *q = '\0';
+ ksdev = p+1;
+ kspath = q+1;
+
+ logMessage("Loading ks from device %s on path %s", ksdev, kspath);
+ if ((rc=getKickstartFromBlockDevice(ksdev, kspath))) {
+ if (rc == 3) {
+ startNewt(flags);
+ newtWinMessage(_("Error"), _("OK"),
+ _("Cannot find kickstart file on hard drive."));
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+
#endif
/* use for testing */