diff options
author | Matt Wilson <msw@redhat.com> | 2000-04-17 20:00:33 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2000-04-17 20:00:33 +0000 |
commit | 6f122a2794396f1777e3fe41bc98fda27e67ae44 (patch) | |
tree | 3074b305703c1f0170673657ae0e5834a1085f5a /loader | |
parent | 96040f2d2acfcc3052eefd2102227aabbaf70f6f (diff) | |
download | anaconda-6f122a2794396f1777e3fe41bc98fda27e67ae44.tar.gz anaconda-6f122a2794396f1777e3fe41bc98fda27e67ae44.tar.xz anaconda-6f122a2794396f1777e3fe41bc98fda27e67ae44.zip |
merge from anaconda-6-2j-branch
Diffstat (limited to 'loader')
-rw-r--r-- | loader/Makefile | 68 | ||||
-rw-r--r-- | loader/kon2/.config | 2 | ||||
-rw-r--r-- | loader/kon2/src/main.c | 2 | ||||
-rw-r--r-- | loader/lang.c | 65 | ||||
-rw-r--r-- | loader/loader.c | 72 |
5 files changed, 133 insertions, 76 deletions
diff --git a/loader/Makefile b/loader/Makefile index dec373147..f4d4b9c4c 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -14,30 +14,24 @@ SOURCES = $(subst .o,.c,$(OBJS) $(LOADEROBJS)) BINS = init DIRS = NETOBJS = net.o -ifeq (i386, $(ARCH)) -KON = 0 -endif PCMCIAOBJS = pcmcia.o $(NETOBJS) OPTS = -O2 -g MODULELINKAGE :=../isys/modutils/insmod/libmodutils.a \ - ../isys/modutils/util/libutil.a \ - ../isys/modutils/obj/libobj.a + ../isys/modutils/util/libutil.a \ + ../isys/modutils/obj/libobj.a CFLAGS = $(DEBUG) $(OPTS) -Wall -D_GNU_SOURCE=1 -I/usr/include/rpm -I.. -DUSE_ALT_DNS=1 -DVERSION='"$(VERSION)"' -DHAVE_LIBIO_H -ggdb ALLOBJS = $(OBJS) $(PCMCIAOBJS) -ifeq (1, $(KON)) -DIRS += kon2 -OBJS += ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a -CFLAGS += -DINCLUDE_KON=1 -endif - +# XXX Japanese is i386 only at the moment ifeq (i386, $(ARCH)) -BINS += loader-local loader-network loader-pcmcia -DIRS += pcmcia-install -OBJS += stubs.o +BINS += loader-local loader-network loader-pcmcia \ + loader-local-kon loader-network-kon loader-pcmcia-kon +DIRS += pcmcia-install kon2 +OBJS += stubs.o +KONOBJS += ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a endif ifeq (ia64, $(ARCH)) @@ -80,20 +74,19 @@ STATIC=-static endif endif -ifeq (1, $(KON)) -LANGS = ja -else -LANGS = $(shell awk '{ print $$2 }' ../lang-table | grep -v '^en$$') -endif +LANGS = $(shell awk '{ print $$2 }' ../lang-table | egrep -v '(^en$$)|(^ja$$)') TR = $(patsubst %,tr/%.tr,$(LANGS)) TRFILES = $(patsubst %,%.tr,$(LANGS)) -all: dirs $(BINS) loader.tr +all: dirs $(BINS) loader.tr kon-loader.tr loader.tr: $(TR) ../lang-table (cd tr; ls $(TRFILES) | cpio --quiet -Hcrc -o | gzip -9) > $@ +kon-loader.tr: tr/ja.tr ../lang-table + (cd tr; echo ja.tr | cpio --quiet -Hcrc -o | gzip -9) > $@ + loader.po: *.c xgettext --default-domain=loader --add-comments \ --keyword=_ --keyword=N_ *.c @@ -126,12 +119,26 @@ loader-local: loader-local.o $(OBJS) $(MODULELINKAGE) \ -L ../stubs -lz -lresolv -lnewt -lslang -lpci +loader-local-kon: loader-local-kon.o $(OBJS) + $(CC) -g $(STATIC) -o $@ $^ -lpopt \ + -lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \ + $(MODULELINKAGE) \ + -L ../stubs -lz -lresolv -lnewt -lslang -lpci + ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a + loader-network: loader-net.o $(OBJS) $(NETOBJS) $(CC) -g $(STATIC) -o $@ $^ -lpopt \ -lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \ $(MODULELINKAGE) \ -lpump -lrpm -lbz2 -lz -lresolv -lnewt -lslang -lpci +loader-network-kon: loader-net-kon.o $(OBJS) $(NETOBJS) + $(CC) -g $(STATIC) -o $@ $^ -lpopt \ + -lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \ + $(MODULELINKAGE) \ + -lpump -lrpm -lbz2 -lz -lresolv -lnewt -lslang -lpci + ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a + loader-pcmcia: loader-pcmcia.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS) $(CC) -g $(STATIC) -o $@ loader-pcmcia.o $(OBJS) \ $(PCMCIAOBJS) -L pcmcia-install/cardmgr -lcardmgr -lprobe popen.o \ @@ -140,25 +147,44 @@ loader-pcmcia: loader-pcmcia.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS) $(MODULELINKAGE) \ -lpump -lrpm -lbz2 -lz -lresolv -lnewt -lslang -lpci +loader-pcmcia-kon: loader-pcmcia-kon.o pcmcia.o popen.o $(OBJS) $(PCMCIAOBJS) + $(CC) -g $(STATIC) -o $@ loader-pcmcia-kon.o $(OBJS) \ + $(PCMCIAOBJS) -L pcmcia-install/cardmgr -lcardmgr -lprobe popen.o \ + -lpopt \ + -lkudzu_loader ../isys/libisys.a ../balkan/libbalkan.a \ + $(MODULELINKAGE) \ + ./kon2/src/libkon.a ./kon2/src/display.a ./kon2/lib/libgon.a + loader.o: loader.c $(CC) -DINCLUDE_LOCAL -DINCLUDE_NETWORK $(CFLAGS) -o $@ -c $^ loader-local.o: loader.c $(CC) -DINCLUDE_LOCAL $(CFLAGS) -o $@ -c $^ +loader-local-kon.o: loader.c + $(CC) -DINCLUDE_LOCAL -DINCLUDE_KON $(CFLAGS) -o $@ -c $^ + loader-net.o: loader.c $(CC) -DINCLUDE_NETWORK $(CFLAGS) -o $@ -c $^ +loader-net-kon.o: loader.c + $(CC) -DINCLUDE_NETWORK -DINCLUDE_KON $(CFLAGS) -o $@ -c $^ + loader-pcmcia.o: loader.c $(CC) -DINCLUDE_PCMCIA -DINCLUDE_LOCAL -DINCLUDE_NETWORK \ $(CFLAGS) -o $@ -c $^ +loader-pcmcia-kon.o: loader.c + $(CC) -DINCLUDE_PCMCIA -DINCLUDE_LOCAL -DINCLUDE_NETWORK \ + -DINCLUDE_KON $(CFLAGS) -o $@ -c $^ + init: init.o $(MINILIBC) $(CC) $(STATIC) -g $(LDFLAGS) -o $@ init.o $(MINILIBC) clean: rm -f *.o .depend *~ loader-local loader-network loader.old loader-pcmcia probe modprobe \ - loader.po loader.tr tr/*.tr loader init + loader.po loader.tr tr/*.tr loader init loader-local-kon loader-network-kon \ + loader-pcmcia-kon for n in $(DIRS); do \ (cd $$n; make clean) \ done diff --git a/loader/kon2/.config b/loader/kon2/.config index be693892f..e9e116669 100644 --- a/loader/kon2/.config +++ b/loader/kon2/.config @@ -3,7 +3,7 @@ BINDIR = $(TOPDIR)/usr/bin LIBDIR = $(TOPDIR)/etc MANDIR = $(TOPDIR)/usr/man/ja_JP.ujis/man1 CONFIG_NAME = kon.cfg -OPTS = -DCONFIG_NAME=\"$(LIBDIR)/$(CONFIG_NAME)\" -I$(INCDIR) +OPTS = -DCONFIG_NAME=\"$(LIBDIR)/$(CONFIG_NAME)\" -I$(INCDIR) -g CFLAGS = -O2 -Wall $(OPTS) LD = gcc $(CFLAGS) RM = rm -f diff --git a/loader/kon2/src/main.c b/loader/kon2/src/main.c index 1598d64a0..439da2c25 100644 --- a/loader/kon2/src/main.c +++ b/loader/kon2/src/main.c @@ -41,11 +41,13 @@ kon_main(int argc, const char *argv[]) { extern void ChangeNewConsole(); +#if 0 /* disable version number by request */ #ifdef MINI_KON fprintf(stderr, "Kanji ON Console MINI " VERSION "\n\n"); #else fprintf(stderr, "Kanji ON Console " VERSION "\n\n"); #endif +#endif if (geteuid() != 0) { fprintf(stderr, "can not get I/O permissions.\n"); exit(EXIT_FAILURE); diff --git a/loader/lang.c b/loader/lang.c index 2f9752ea4..f516c1f77 100644 --- a/loader/lang.c +++ b/loader/lang.c @@ -70,7 +70,7 @@ char * translateString(char * str) { } struct langInfo { - char * lang, * key, * font, * map, * lc_all; + char * lang, * key, * font, * map, * lc_all, * keyboard; } ; static struct langInfo * languages = NULL; @@ -81,7 +81,8 @@ static void loadLanguageList(int flags) { "/etc/lang-table"; FILE * f; char line[256]; - char name[256], key[256], sun[256], console[256], code[256]; + char name[256], key[256], sun[256], console[256], code[256], + keyboard[256], timezone[256]; int lineNum = 0; f = fopen(file, "r"); @@ -94,8 +95,8 @@ static void loadLanguageList(int flags) { while (fgets(line, sizeof(line), f)) { lineNum++; languages = realloc(languages, sizeof(*languages) * (numLanguages + 1)); - if (sscanf(line, "%s %s %s %s %s\n", name, key, sun, console, - code) != 5) { + if (sscanf(line, "%s %s %s %s %s %s %s\n", name, key, sun, console, + code, keyboard, timezone) != 7) { logMessage("bad line %d in lang-table", lineNum); } else { languages[numLanguages].lang = strdup(name); @@ -103,6 +104,7 @@ static void loadLanguageList(int flags) { languages[numLanguages].font = strdup(sun); languages[numLanguages].map = strdup(console); languages[numLanguages].lc_all = strdup(code); + languages[numLanguages].keyboard = strdup(keyboard); numLanguages++; } } @@ -302,29 +304,34 @@ int chooseLanguage(char ** lang, int flags) { numStrings = allocedStrings = 0; } + { + extern int continuing; + extern void stopNewt(void); + + if (!strcmp (languages[choice].key, "ja") && !continuing) { + char * args[4]; + + stopNewt(); + + args[0] = "kon"; + args[1] = "-e"; + args[2] = FL_TESTING(flags) ? "./loader" : "/sbin/continue"; + args[3] = NULL; + + execv(FL_TESTING(flags) ? "./loader" : "/sbin/loader", args); + } + } + loadLanguage (NULL, flags); if (languages[choice].map) loadFont(languages[choice].map, flags); + newtDrawRootText(0, 0, _("Welcome to Red Hat Linux")); + newtPushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen ")); + return 0; } -struct defaultKeyboardByLang { - char * lang, * keyboard; -} defaultKeyboards[] = { - { "de", "de-latin1" }, - { "cs", "cz-lat2" }, - { "fi", "fi-latin1" }, - { "hu", "hu" }, - { "is", "is-latin1" }, - { "it", "it" }, - { "no", "no-latin1" }, - { "ru", "ru" }, - { "se", "se-latin1" }, - { "tr", "trq" }, - { "ja", "jp106" }, - { NULL, NULL } }; - #ifdef __sparc__ struct defaultKeyboardByLang defaultSunKeyboards[] = { @@ -406,6 +413,7 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) { int i; char * defkbd = keymap ? *keymap : NULL; struct defaultKeyboardByLang * kbdEntry; + char *lang; #ifdef __sparc__ #define KBDTYPE_SUN 0 @@ -452,17 +460,26 @@ int chooseKeyboard(char ** keymap, char ** kbdtypep, int flags) { } } #endif - - if (!defkbd && getenv("LANG")) { - kbdEntry = defaultKeyboards; + + if (!languages) loadLanguageList(flags); + + lang = getenv("LANG"); + if (!defkbd && lang) { + for (i = 0; i < numLanguages; i++) { + if (!strncmp(languages[i].key, lang, 2)) { + defkbd = languages[i].keyboard; + break; + } + } + #ifdef __sparc__ if (kbdtype == KBDTYPE_SUN) kbdEntry = defaultSunKeyboards; -#endif while (kbdEntry->lang && strcmp(kbdEntry->lang, getenv("LANG"))) kbdEntry++; if (kbdEntry->keyboard) defkbd = kbdEntry->keyboard; +#endif } if (!defkbd) #ifdef __sparc__ diff --git a/loader/loader.c b/loader/loader.c index a9b641c7d..ae971d7ee 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -113,9 +113,7 @@ static struct installMethod installMethods[] = { static int numMethods = sizeof(installMethods) / sizeof(struct installMethod); static int newtRunning = 0; -#ifdef INCLUDE_KON -static int startKon = 1; -#endif +int continuing = 0; void doSuspend(void) { newtFinished(); @@ -136,7 +134,7 @@ static void startNewt(int flags) { } } -static void stopNewt(void) { +void stopNewt(void) { if (newtRunning) newtFinished(); } @@ -1122,7 +1120,15 @@ static char * doMountImage(char * location, startNewt(flags); +#ifdef INCLUDE_KON + if (continuing) + step = STEP_KBD; + else + step = STEP_LANG; +#else step = STEP_LANG; +#endif + while (step != STEP_DONE) { switch (step) { case STEP_LANG: @@ -1555,19 +1561,11 @@ static int parseCmdLineFlags(int flags, char * cmdLine, char ** ksSource) { flags |= LOADER_FLAGS_KSFILE; *ksSource = argv[i] + 8; } else if (!strncasecmp(argv[i], "lang=", 5)) { + /* For Japanese, we have two options. We should just + display them so we don't have to start kon if it is not needed. */ +#ifndef INCLUDE_KON setLanguage (argv[i] + 5, flags); -#ifdef INCLUDE_KON - if (!strcmp (argv[i] + 5, "ja") && startKon) { - char * args[5]; - - args[0] = "kon"; - args[1] = "-e"; - args[2] = "/sbin/continue"; - args[3] = NULL; - - execv(FL_TESTING(flags) ? "./loader" : "/sbin/loader", args); - } -#endif /* INCLUDE_KON */ +#endif } } @@ -1826,6 +1824,7 @@ void loadUpdates(struct knownDevices *kd, moduleList modLoaded, } while (!done); chdir("/tmp/updates"); + setenv("PYTHONPATH", "/tmp/updates", 1); return; } @@ -1907,8 +1906,9 @@ int main(int argc, char ** argv) { else if (!strcmp(argv[0] + strlen(argv[0]) - 3, "kon")) { i = kon_main(argc, argv); return i; - } else if (!strcmp(argv[0] + strlen(argv[0]) - 8, "continue")) - startKon = 0; + } else if (!strcmp(argv[0] + strlen(argv[0]) - 8, "continue")) { + continuing = 1; + } #endif #ifdef INCLUDE_PCMCIA @@ -1969,28 +1969,36 @@ int main(int argc, char ** argv) { flags |= LOADER_FLAGS_KICKSTART; } +#ifdef INCLUDE_KON + if (continuing) + setLanguage ("ja", flags); +#endif + #ifdef INCLUDE_PCMCIA startNewt(flags); - winStatus(40, 3, _("PC Card"), _("Initializing PC Card Devices...")); - startPcmcia(modLoaded, modDeps, modInfo, flags); - newtPopWindow(); + if (!continuing) { + winStatus(40, 3, _("PC Card"), _("Initializing PC Card Devices...")); + startPcmcia(modLoaded, modDeps, modInfo, flags); + newtPopWindow(); + } #endif kdFindIdeList(&kd); kdFindScsiList(&kd); kdFindNetList(&kd); - if (((access("/proc/bus/pci/devices", X_OK) && - access("/proc/openprom", X_OK)) || FL_MODDISK(flags)) + if (!continuing) { + if (((access("/proc/bus/pci/devices", X_OK) && + access("/proc/openprom", X_OK)) || FL_MODDISK(flags)) && !ksFile) { - startNewt(flags); - devLoadDriverDisk(modInfo, modLoaded, &modDeps, flags, 1); - } - - busProbe(modInfo, modLoaded, modDeps, probeOnly, &kd, flags); - if (probeOnly) exit(0); + startNewt(flags); + devLoadDriverDisk(modInfo, modLoaded, &modDeps, flags, 1); + } + busProbe(modInfo, modLoaded, modDeps, probeOnly, &kd, flags); + if (probeOnly) exit(0); + } if (FL_KSHD(flags)) { ksFile = "/tmp/ks.cfg"; kickstartFromHardDrive(ksFile, modLoaded, modDeps, ksSource, flags); @@ -2150,7 +2158,11 @@ int main(int argc, char ** argv) { if (FL_RESCUE(flags)) { *argptr++ = "/bin/sh"; } else { - *argptr++ = "/usr/bin/anaconda"; + if (!access("./anaconda", X_OK)) + *argptr++ = "./anaconda"; + else + *argptr++ = "/usr/bin/anaconda"; + *argptr++ = "-m"; *argptr++ = url; |