diff options
author | Matt Wilson <msw@redhat.com> | 1999-09-12 16:59:19 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-09-12 16:59:19 +0000 |
commit | c8a45a63b6b31f74ae7c83e690b94cbf3c3e55ea (patch) | |
tree | 6b24661ec83f922194dd13da2ce2815251ad9222 /loader | |
parent | ca0c6579981c990ec7242b36b2d6f7f74ae091db (diff) | |
download | anaconda-c8a45a63b6b31f74ae7c83e690b94cbf3c3e55ea.tar.gz anaconda-c8a45a63b6b31f74ae7c83e690b94cbf3c3e55ea.tar.xz anaconda-c8a45a63b6b31f74ae7c83e690b94cbf3c3e55ea.zip |
warning cleanups, language selection
Diffstat (limited to 'loader')
-rw-r--r-- | loader/Makefile | 19 | ||||
-rw-r--r-- | loader/lang.h | 5 | ||||
-rw-r--r-- | loader/loader.c | 39 | ||||
-rw-r--r-- | loader/pcmcia.c | 3 | ||||
-rw-r--r-- | loader/popen.c | 1 | ||||
-rwxr-xr-x | loader/simplemot | 59 |
6 files changed, 110 insertions, 16 deletions
diff --git a/loader/Makefile b/loader/Makefile index 39ddc2dca..0d59d29e5 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -5,7 +5,7 @@ DESTDIR = ../../trees/initrd ARCH := $(patsubst i%86,i386,$(shell uname -m)) ARCH := $(patsubst sparc%,sparc,$(ARCH)) -OBJS = log.o windows.o modules.o devices.o cdrom.o urls.o kickstart.o +OBJS = log.o windows.o modules.o devices.o cdrom.o urls.o kickstart.o lang.o LOADEROBJS = loader.o loader-pcmcia.o popen.o SOURCES = $(subst .o,.c,$(OBJS) $(LOADEROBJS)) BINS = init @@ -65,7 +65,21 @@ STATIC=-static endif endif -all: dirs $(BINS) +LANGS = cs et id pl se tr da fi is pt_BR sk uk de fr it ro sl es hu no ru sr + +TR = $(patsubst %,tr/%.tr,$(LANGS)) + +all: dirs $(BINS) loader.tr + +loader.tr: $(TR) + (cd tr; ls *.tr | cpio --quiet -Hcrc -o | gzip -9) > $@ + +loader.po: *.c + xgettext --default-domain=loader --add-comments \ + --keyword=_ --keyword=N_ *.c + +tr/%.tr: ../po/%.po loader.po + msgmerge $< loader.po | ./simplemot > $@ dirs: for n in $(DIRS); do \ @@ -80,6 +94,7 @@ install: all # install -s loader $(DESTDIR)/sbin/loader # install -s init $(DESTDIR)/sbin/init # install -m 755 ../kudzu/pcitable $(DESTDIR)/etc +# install -m 644 loader.tr $(DESTDIR)/etc loader: loader.o $(OBJS) $(NETOBJS) $(CC) -g $(STATIC) -o $@ $^ -lpopt \ diff --git a/loader/lang.h b/loader/lang.h index 3c5eef80a..945878cb7 100644 --- a/loader/lang.h +++ b/loader/lang.h @@ -1,7 +1,10 @@ #ifndef _LANG_H_ #define _LANG_H_ -#define _(x) x +#define _(x) translateString (x) #define N_(foo) (foo) +int chooseLanguage(int flags); +char * translateString(char * str); + #endif /* _LANG_H_ */ diff --git a/loader/loader.c b/loader/loader.c index 1c59f2544..0f8d2f574 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -72,6 +72,7 @@ struct installMethod { moduleDeps modDeps, int flags); }; +#ifdef INCLUDE_LOCAL static char * mountCdromImage(struct installMethod * method, char * location, struct knownDevices * kd, moduleInfoSet modInfo, moduleList modLoaded, @@ -80,6 +81,8 @@ static char * mountHardDrive(struct installMethod * method, char * location, struct knownDevices * kd, moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, int flags); +#endif +#ifdef INCLUDE_NETWORK static char * mountNfsImage(struct installMethod * method, char * location, struct knownDevices * kd, moduleInfoSet modInfo, moduleList modLoaded, @@ -88,6 +91,7 @@ static char * mountUrlImage(struct installMethod * method, char * location, struct knownDevices * kd, moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, int flags); +#endif static struct installMethod installMethods[] = { #if defined(INCLUDE_LOCAL) @@ -118,6 +122,7 @@ static void startNewt(int flags) { newtDrawRootText(0, 0, _("Welcome to Red Hat Linux")); newtPushHelpLine(_(" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen ")); + newtRunning = 1; if (FL_TESTING(flags)) newtSetSuspendCallback((void *) doSuspend, NULL); @@ -465,7 +470,6 @@ static int loadStage2Ramdisk(int fd, off_t size, int flags) { } #ifdef INCLUDE_LOCAL - static char * setupHardDrive(char * device, char * type, char * dir, int flags) { int fd; @@ -1028,6 +1032,8 @@ static char * doMountImage(char * location, struct knownDevices * kd, startNewt(flags); + chooseLanguage(flags); + do { rc = newtWinMenu(FL_RESCUE(flags) ? _("Rescue Method") : _("Installation Method"), @@ -1053,37 +1059,44 @@ static char * setupKickstart(char * location, struct knownDevices * kd, moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps, int * flagsPtr) { - static struct networkDeviceConfig netDev; - char * host = NULL, * dir = NULL, * partname = NULL; - char * url = NULL, * proxy = NULL, * proxyport = NULL; char ** ksArgv; - char * fullPath; char * device = NULL; int ksArgc; int ksType; - int i, rc, fd, partNum; + int i, rc; int flags = *flagsPtr; enum deviceClass ksDeviceType; struct poptOption * table; poptContext optCon; - struct partitionTable partTable; + char * dir = NULL; +#ifdef INCLUDE_NETWORK + static struct networkDeviceConfig netDev; + char * host = NULL, * url = NULL, * proxy = NULL, * proxyport = NULL; + char * fullPath; + struct poptOption ksNfsOptions[] = { { "server", '\0', POPT_ARG_STRING, &host, 0 }, { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, { 0, 0, 0, 0, 0 } }; - struct poptOption ksHDOptions[] = { - { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, - { "partition", '\0', POPT_ARG_STRING, &partname, 0 }, - { 0, 0, 0, 0, 0 } - }; + struct poptOption ksUrlOptions[] = { { "url", '\0', POPT_ARG_STRING, &url, 0 }, { "proxy", '\0', POPT_ARG_STRING, &proxy, 0 }, { "proxyport", '\0', POPT_ARG_STRING, &proxyport, 0 }, { 0, 0, 0, 0, 0 } }; - +#endif +#ifdef INCLUDE_LOCAL + int partNum, fd; + char * partname = NULL; + struct partitionTable partTable; + struct poptOption ksHDOptions[] = { + { "dir", '\0', POPT_ARG_STRING, &dir, 0 }, + { "partition", '\0', POPT_ARG_STRING, &partname, 0 }, + { 0, 0, 0, 0, 0 } + }; +#endif /* XXX kickstartDevices(modInfo, modLoaded, modDeps); */ if (0) { diff --git a/loader/pcmcia.c b/loader/pcmcia.c index 4977b72b9..61418a1bd 100644 --- a/loader/pcmcia.c +++ b/loader/pcmcia.c @@ -7,6 +7,9 @@ #include "log.h" #include "modules.h" +int probe_main (int argc, char ** argv); +int cardmgr_main (int argc, char ** argv); + void startPcmcia(moduleList modLoaded, moduleDeps modDeps, int flags) { pid_t child; char * probeArgs[] = { "/sbin/probe", NULL }; diff --git a/loader/popen.c b/loader/popen.c index ad88243bf..173d0f7a4 100644 --- a/loader/popen.c +++ b/loader/popen.c @@ -4,6 +4,7 @@ #include <string.h> #include <sys/wait.h> #include <unistd.h> +#include <stdlib.h> #include <syslog.h> diff --git a/loader/simplemot b/loader/simplemot new file mode 100755 index 000000000..467020be0 --- /dev/null +++ b/loader/simplemot @@ -0,0 +1,59 @@ +#!/usr/bin/perl + +$inone = 0; +$intran = 0; +$total = 0; +while (<>) { + if (!$inone && /^msgid/) { + chop; + $str = substr($_, 7, length($_) - 8); + $inone = 1; + } elsif ($inone && /^"/) { + chop; + $str .= substr($_, 1, length($_) - 2); + } elsif ($inone) { + $inone = 0; + + $str =~ s/\\n/\n/g; + $str =~ s/\\t/\t/g; + $str =~ s/\\"/"/g; + + # the string is complete -- calculate a hash + $sum = 0; + $xor = 0; + for ($i = 0; $i < length($str); $i++) { + $char = ord(substr($str, $i, 1)); + $sum += $char; + $xor ^= $char; + } + + $total = ($sum << 16) | (($xor & 0xFF) << 8) | (length($str) & 0xFF); + } + + if (!$intran && /^msgstr/) { + chop; + $tran = substr($_, 8, length($_) - 9); + $intran = 1; + } elsif ($intran && /^"/) { + chop; + $tran .= substr($_, 1, length($_) - 2); + } elsif ($intran) { + $intran = 0; + + $tran =~ s/\\n/\n/g; + $tran =~ s/\\t/\t/g; + $tran =~ s/\\"/"/g; + + if (!$total && $str) { + print STDERR "Missing string for $tran"; + exit 1 + } elsif ($str && $tran) { + print pack("Nn", $total, length($tran)); + print $tran; + + #if ($tran < 60) { + #printf STDERR ("0x%x %s\n", $total, $tran); + #} + } + } +} |