From: Mark W. <ri...@us...> - 2003-03-29 21:06:19
|
Update of /cvsroot/ipcop/installer In directory sc8-pr-cvs1:/tmp/cvs-serv23785 Modified Files: doit.c doit.h install2.c Log Message: Removed setup XFree Index: doit.c =================================================================== RCS file: /cvsroot/ipcop/installer/doit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doit.c 28 Mar 2003 15:32:19 -0000 1.2 --- doit.c 29 Mar 2003 21:06:12 -0000 1.3 *************** *** 298,398 **** } - int setupXfree(struct installMethod * method, char * rootPath, - struct pkgSet * psp) { - int fd, i; - char buf[200], * chptr; - char server[50]; - int rc; - char * path; - char * procPath; - rpmdb db; - rpmTransactionSet trans; - struct callbackInfo cbi; - rpmProblemSet probs; - - if (rpmdbOpen(rootPath, &db, O_RDWR | O_CREAT, 0644)) { - errorWindow(_("Fatal error reopening RPM database")); - return INST_ERROR; - } - logMessage("reopened rpm database"); - - path = alloca(strlen(rootPath) + 200); - procPath = alloca(strlen(rootPath) + 50); - sprintf(path, "%s/usr/X11R6/bin/Xconfigurator", rootPath); - - /* This is a cheap trick to see if our X component was installed */ - if (access(path, X_OK)) { - logMessage("%s cannot be run", path); - return INST_OKAY; - } - - /* need proc to do pci probing */ - sprintf(procPath, "%s/proc", rootPath); - umount(procPath); - if ((rc = doMount("/proc", procPath, "proc", 0, 0))) { - return INST_ERROR; - } - - /* this handles kickstart and normal/expert modes */ - if ((rc=xfree86Config(rootPath, "--pick"))) - return INST_ERROR; - - sprintf(path, "%s/tmp/SERVER", rootPath); - if ((fd = open(path, O_RDONLY)) < 0) { - logMessage("failed to open %s: %s", path, strerror(errno)); - return INST_ERROR; - } - - buf[0] = '\0'; - read(fd, buf, sizeof(buf)); - close(fd); - chptr = buf; - while (chptr < (buf + sizeof(buf) - 1) && *chptr && *chptr != ' ') - chptr++; - - if (chptr >= (buf + sizeof(buf) - 1) || *chptr != ' ') { - logMessage("couldn't find ' ' in %s", path); - return INST_ERROR; - } - - *chptr = '\0'; - strcpy(server, "XFree86-"); - strcat(server, buf); - - logMessage("I will install the %s package", server); - - for (i = 0; i < psp->numPackages; i++) { - if (!strcmp(psp->packages[i]->name, server)) { - logMessage("\tfound package: %s", psp->packages[i]->name); - swOpen(1, psp->packages[i]->size); - trans = rpmtransCreateSet(db, rootPath); - rpmtransAddPackage(trans, psp->packages[i]->h, NULL, - psp->packages[i], 0, NULL); - - cbi.method = method; - cbi.upgrade = 0; - - rpmRunTransactions(trans, swCallback, &cbi, NULL, &probs, 0, - 0xffffffff); - - swClose(); - break; - } - } - - /* this handles kickstart and normal/expert modes */ - if ((rc=xfree86Config(rootPath, "--continue"))) - return INST_ERROR; - - /* done with proc now */ - umount(procPath); - - rpmdbClose(db); - - logMessage("rpm database closed"); - - return INST_OKAY; - } - static void rpmerror(void) { int code; --- 298,301 ---- Index: doit.h =================================================================== RCS file: /cvsroot/ipcop/installer/doit.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** doit.h 28 Mar 2003 08:03:37 -0000 1.1.1.1 --- doit.h 29 Mar 2003 21:06:12 -0000 1.2 *************** *** 8,13 **** struct pkgSet * psp, char * netSharedPath, char * keymap, char * kbdtype, int upgrade); - int setupXfree(struct installMethod * method, char * rootPath, - struct pkgSet * psp); int getPackageSize(void); --- 8,11 ---- Index: install2.c =================================================================== RCS file: /cvsroot/ipcop/installer/install2.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** install2.c 28 Mar 2003 15:51:03 -0000 1.6 --- install2.c 29 Mar 2003 21:06:13 -0000 1.7 *************** *** 151,155 **** static int upgrFindInstall(struct installState * state); static void setupSerialConsole(void); - static int configureX(struct installState * state); static int configureMouse(struct installState * state); static int configureAuth(struct installState * state); --- 151,154 ---- *************** *** 197,205 **** { N_("Create bootdisk"), STEP_AUTH, STEP_LILO, createBootdisk, 0, 0, 1 }, ! { N_("Install bootloader"), STEP_BOOTDISK, STEP_XCONFIG, setupBootloader, 0, 0, 1 }, ! { N_("Configure X"), STEP_LILO, STEP_EXIT, ! configureX, 0, 0, 0 }, ! { N_("Exit install"), STEP_XCONFIG, STEP_DONE, exitInstall, 0, 0, 0 }, }; --- 196,202 ---- { N_("Create bootdisk"), STEP_AUTH, STEP_LILO, createBootdisk, 0, 0, 1 }, ! { N_("Install bootloader"), STEP_BOOTDISK, STEP_EXIT, setupBootloader, 0, 0, 1 }, ! { N_("Exit install"), STEP_LILO, STEP_DONE, exitInstall, 0, 0, 0 }, }; *************** *** 1603,1636 **** p = atoi(buf); kill(p, SIGTERM); - } - - static int configureX(struct installState * state) { - if (kickstart) { - int argc; - char **argv; - poptContext optCon; - struct poptOption ksPcOptions[] = { - { 0, 0, 0, 0, 0 } - }; - if (!ksGetCommand(KS_CMD_SKIPX, NULL, &argc, &argv)) { - char *t; - optCon = poptGetContext(NULL, argc, argv, ksPcOptions, 0); - poptGetNextOpt(optCon); - t = poptGetArg(optCon); - if (t && *t && (!strcasecmp(t,"yes") || - !strcasecmp(t,"on") || !strcmp(t, "1"))) - return INST_OKAY; - else if (!(t && *t && (!strcasecmp(t,"no") || - !strcasecmp(t,"off") || !strcmp(t, "0")))) { - newtWinMessage("Xconfig Kickstart", "Ok", - "bad argument to skipx " - "command: %s.\nMust be " - "'on', '1', or 'yes' to enable, " - "or 'off', '0', or 'no' to disable.",t); - kickstart = 0; - } - } - } - return setupXfree(state->method, state->rootPath, &state->ps); } --- 1600,1603 ---- |