Hello!

Here is the patch that finally integrates LANGUAGE_CHOOSER to the
boot-floppies. _PLEASE_ test it. It almost built on my system (my disk is
too small), so it's mostly fine. A few build depends are probably missing
(libpng-dev comes to mind, but I'm not sure what exactly - I have too many
different packages installed to see which are really necessary).

Please mail me _any_ problems. I'd like this to go mainstream, so it has to
work flawlessly.

A word to japanese people: please put your national characters into the
language choosing menu - it's going to look so cool :-).

Marcin

-- 
+--------------------------------+ The reason we come up with new versions
|Marcin Owsiany                  | is not to fix bugs. It's the stupidest
|[EMAIL PROTECTED]| reason to buy a new version
+--------------------------------+ I ever heard.            - Bill Gates
Index: config
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/config,v
retrieving revision 1.46
diff -u -r1.46 config
--- config      2000/08/24 06:24:35     1.46
+++ config      2000/11/12 14:52:31
@@ -81,8 +87,9 @@
 ## Internationalization
 ##
 
-# whether to use the language chooser in dbootstrap, `true' or `false'
-USE_LANGUAGE_CHOOSER := false
+# whether to use the language chooser in dbootstrap for kernel flavours that
+# support it, `true' or `false'
+export USE_LANGUAGE_CHOOSER := true
 
 ifeq ($(USE_LANGUAGE_CHOOSER),true)
 ifneq ($(LINGUA),C)
Index: rootdisk.sh
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/rootdisk.sh,v
retrieving revision 1.169
diff -u -r1.169 rootdisk.sh
--- rootdisk.sh 2000/10/15 06:43:40     1.169
+++ rootdisk.sh 2000/11/12 14:52:33
@@ -4,6 +4,7 @@
 # Enrique Zanardi 1998
 # Hartmut Koptein, 1998; powerpc support
 # Matej Vela, 1998 [non-ISO-8859-1 charset support]
+# Marcin Owsiany, 2000 [LANGUAGE_CHOOSER integration]
 # This is free software under the GNU General Public License.
 
 . ./common.sh
@@ -86,6 +87,17 @@
        error "$archive not a directory"
 fi
 
+USE_LANGUAGE_CHOOSER=false
+export USE_LANGUAGE_CHOOSER
+
+# turn LC on for kernels with framebuffer support
+if [ "$arch" = "i386" ]; then
+       if [ "$revext" = "compact" -o "$revext" = "idepci" ]; then
+               USE_LANGUAGE_CHOOSER=true
+               export USE_LANGUAGE_CHOOSER
+       fi
+fi
+
 # must be root
 testroot
 
@@ -131,6 +143,13 @@
 
 make_tmpdir $mnt
 
+if [ "$USE_LANGUAGE_CHOOSER" = "true" ]
+then
+       info "this disk will contain language chooser"
+       info "increasing blocks number by 1000"
+       blocks=$[$blocks+1000]
+fi
+
 info "making disk image loop filesystem, size ${blocks}k"
 
 # zero the entire disk, so that when we compress the raw disk image,
@@ -235,8 +254,8 @@
 miscdevs="initrd rtc loop lp fd md ram0 consoleonly"
 alldevs="$ttydevs $idedevs $scsidevs $miscdevs"
 
-# add devices for japanese installer
-if [ "$LINGUA" = "ja" ] ; then
+# add devices for japanese installer and LANGUAGE_CHOOSER
+if [ "$LINGUA" = "ja" -o "$USE_LANGUAGE_CHOOSER" = 'true' ] ; then
        alldevs="$alldevs fb0 ptyp ptyq ptyr ptys"
 fi
 
@@ -295,6 +314,18 @@
        < $scripts/prototype/etc/inittab > $T/etc/inittab
 fi
 
+if [ "$USE_LANGUAGE_CHOOSER" = "true" ]
+then
+       info "modifying init script for LANGUAGE_CHOOSER"
+       sed -e 's,/sbin/dbootstrap,/sbin/udbootstrap,' \
+               < $scripts/prototype/etc/inittab > $T/etc/inittab
+       ( echo '#!/bin/sh';echo 'LC_CTYPE=C.UTF-8 LD_PRELOAD=/lib/libutf8_plug.so 
+/sbin/bterm -f /unifont-reduced.bgf /sbin/dbootstrap') \
+               > $T/sbin/udbootstrap
+       chmod a+rx $T/sbin/udbootstrap
+       info "including font for bterm"
+       cp utilities/bogl/unifont-reduced.bgf $T/
+fi
+
 info "modifying init script; making lazybox links"
 str=
 if [ -n "$font" ]; then
@@ -437,6 +468,11 @@
 info "determining set of required libraries"
 LIBRARIES=""
 EXECUTABLES="$R/bin/* $R/sbin/* $R/usr/bin/* ./utilities/busybox/busybox 
./utilities/dbootstrap/dbootstrap"
+if [ "$USE_LANGUAGE_CHOOSER" = "true" ]
+then
+       EXECUTABLES="$EXECUTABLES ./utilities/bogl/bterm"
+       LIBRARIES="$LIBRARIES ./utilities/bogl/libutf8_plug.so"
+fi
 
 #   ldconfig.new is statically linked
 EXECUTABLES=`echo $EXECUTABLES | sed s%$R/sbin/ldconfig.new%%g`
@@ -490,10 +526,22 @@
 info "adding busybox and links to it"
 make -C utilities/busybox PREFIX=$R install
 
-cp utilities/dbootstrap/dbootstrap $R/sbin/
 mkdir -p $R/etc
-make -C utilities/dbootstrap/po $language.trm
-cp utilities/dbootstrap/po/$language.trm $R/etc/messages.trm
+if [ "$USE_LANGUAGE_CHOOSER" = "true" ]
+then
+       cp utilities/dbootstrap/dbootstrap-lc $R/sbin/dbootstrap
+       cp utilities/bogl/bterm $R/sbin/
+       cp utilities/bogl/libutf8_plug.so $R/lib
+       make -C utilities/dbootstrap/po all-utf
+       for lang in `awk '{ print $1 }' < $scripts/messages/languages`
+       do
+               cp utilities/dbootstrap/po/utf/$lang.trm $R/etc/messages.$lang
+       done
+else
+       cp utilities/dbootstrap/dbootstrap $R/sbin/
+       make -C utilities/dbootstrap/po $language.trm
+       cp utilities/dbootstrap/po/$language.trm $R/etc/messages.trm
+fi
 
 # no keymaps for BVME and MVME
 if [ "$system" != bvme6000 -a "$system" != mvme16x -a "$system" != mvme147 ]; then
@@ -540,14 +588,14 @@
         -D__username__="${MAINTAINER}" \
         >$R/release_notes.en
 
-    for lang in `awk '{ print $$1 }' < $scripts/messages/languages`
+    for lang in `awk '{ print $1 }' < $scripts/messages/languages`
     do
         m4 $scripts/messages/$lang/release_notes \
             -D__debianversion__=$debianversion \
             -D__date__="`date +%Y-%m-%d`" \
             -D__floppyversion__="`dpkg-parsechangelog | awk -- '/^Version/ {print 
$2}'`" \
             -D__username__="${MAINTAINER}" |
-        iconv -f `grep "^$lang " $scripts/messages/languages | awk '{ print $$2 }'` 
-t utf-8 > $R/release_notes.$lang
+        iconv -f `grep "^$lang " $scripts/messages/languages | awk '{ print $2 }'` -t 
+utf-8 > $R/release_notes.$lang
     done
 else
     m4 $scripts/messages/$language/release_notes \
Index: scripts/rootdisk/messages/Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/scripts/rootdisk/messages/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- scripts/rootdisk/messages/Makefile  2000/08/29 18:56:15     1.3
+++ scripts/rootdisk/messages/Makefile  2000/11/12 14:52:44
@@ -1,6 +1,6 @@
 # This file allows installation of UTF versions of release_notes...
 
-RN_TARGET_DIR=
+RN_TARGET_DIR ?=
 
 available_languages = $(shell awk '{ print $$1 }' < languages)
 dests = $(addprefix $(RN_TARGET_DIR)/release_notes.,$(available_languages))
Index: utilities/Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/Makefile,v
retrieving revision 1.34
diff -u -r1.34 Makefile
--- utilities/Makefile  2000/10/12 21:35:59     1.34
+++ utilities/Makefile  2000/11/12 14:52:45
@@ -26,7 +26,7 @@
        $(MAKE) -j4 -C $@ KVER=${KVER} KERNEL_VERSION_CODE=${KERNEL_VERSION_CODE}
 
 clean:
-       rm -f *.o *.bak
+       rm -f *.o *.bak po.utf rn.utf all.utf
        set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
 
 distclean: clean
Index: utilities/bogl/Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/bogl/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- utilities/bogl/Makefile     2000/10/12 21:36:46     1.19
+++ utilities/bogl/Makefile     2000/11/12 14:52:45
@@ -39,8 +39,25 @@
 
 GENERATED = helvB10.c helvB12.c helvR10.c timBI18.c tux75.c
 
-all:    depend $(LIB) bterm bdftobogl libutf8_plug.so
+all:    depend $(LIB) bterm bdftobogl libutf8_plug.so unifont-reduced.bgf
 
+unifont-reduced.bgf: bdftobogl unifont-reduced.bdf
+       ./bdftobogl -b unifont-reduced.bdf > unifont-reduced.bgf
+
+unifont-reduced.bdf: ../../../bf-utf/unifont.bdf ../all.utf libutf8_plug.so 
+reduce-font
+       LD_PRELOAD=./libutf8_plug.so LC_CTYPE=C.UTF-8 ./reduce-font $< < ../all.utf > 
+$@
+
+../all.utf: ../po.utf ../rn.utf
+       cat $^ > $@
+
+../po.utf:
+       $(MAKE) -C ../dbootstrap/po all-po-utf
+       cat ../dbootstrap/po/utf/*.po > $@
+
+../rn.utf:
+       $(MAKE) RN_TARGET_DIR=. -C ../../scripts/rootdisk/messages install-utf
+       cat ../../scripts/rootdisk/messages/release_notes.* > $@
+
 $(LIB): $(OBJECTS)
        rm -f $(LIB)
        ar rcs $(LIB) $(OBJECTS)
@@ -71,7 +88,7 @@
        $(CPP) $(CFLAGS) -M $(SOURCES_DEP) > .depend
 
 clean: 
-       rm -rf reduce-font libutf8_plug.so bterm bdftobogl pngtobogl *.o $(GENERATED) 
*-test lang.h tmp.*.c bowl-boxes $(LIB)
+       rm -rf reduce-font libutf8_plug.so bterm bdftobogl pngtobogl *.o $(GENERATED) 
+*-test lang.h tmp.*.c bowl-boxes $(LIB) unifont-reduced.bgf unifont-reduced.bdf
 
 distclean: clean
        rm -f $(LIB) .depend *~ .nfs*
Index: utilities/dbootstrap/Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/Makefile,v
retrieving revision 1.83
diff -u -r1.83 Makefile
--- utilities/dbootstrap/Makefile       2000/10/12 21:40:50     1.83
+++ utilities/dbootstrap/Makefile       2000/11/12 14:52:51
@@ -25,8 +25,9 @@
 
 PROG   = dbootstrap
 PROG_G = dbootstrap_g
+PROG_LC = dbootstrap-lc
 
-all all_potato : $(PROG)
+all all_potato : $(PROG) $(PROG_LC)
 
 all_woody      : $(PROG) $(PROG_G)
 
@@ -146,32 +147,37 @@
 endif
 
 SOURCES          := $(wildcard *.c)
-ifeq ($(USE_LANGUAGE_CHOOSER),true)
+
+
 UTF_LIBS_BASE   = ../../../bf-utf
-CPPFLAGS        += -DUSE_LANGUAGE_CHOOSER
-OBJECTS_2       += langs.o
-LIBS            += $(UTF_LIBS_BASE)/newt/libnewt.a 
$(UTF_LIBS_BASE)/slang/src/objs/libslang.a
-else
-LIBS            += -lslang -lnewt
-endif
+CPPFLAGS_LC     = -DUSE_LANGUAGE_CHOOSER
+OBJECTS_LC      = $(OBJECTS:%.o=%.lc.o) langs.o
+LIBS_LC = $(UTF_LIBS_BASE)/newt/libnewt.a $(UTF_LIBS_BASE)/slang/src/objs/libslang.a
+
+LIBS_NLC         = -lslang -lnewt
 OBJECTS                 = $(SOURCES:%.c=%.o)
 OBJECTS_G       = $(filter-out boxes.o, $(OBJECTS))
 
-$(PROG) : $(LIBS)
+$(PROG) : $(LIBS) $(LIBS_NLC)
 $(PROG) : _OBJECTS = $(OBJECTS) $(OBJECTS_2)
 $(PROG)        : $(OBJECTS) $(OBJECTS_2) $(_LIBFDISK)
 
+$(PROG_LC) : $(LIBS) $(LIBS_LC) $(OBJECTS_LC)
+
 $(PROG_G) : _LIBS    = $(LIBS_G)
 $(PROG_G) : _OBJECTS = $(OBJECTS_G)
 $(PROG_G) : $(_LIBBOGL) $(OBJECTS_G) $(_LIBFDISK)
 
 $(PROG) $(PROG_G) :
-       $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS) $(OBJECTS_2) $(LIBS)
+       $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS) $(LIBS_NLC)
+       $(STRIP) $@
+
+$(PROG_LC) :
+       $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS_LC) $(LIBS) $(LIBS_LC)
        $(STRIP) $@
-ifeq ($(USE_LANGUAGE_CHOOSER),true)
        $(MAKE) -C po all-utf
-endif
 
+
 ifeq (${no_pointerize},)
 __SOURCES = ${SOURCES}
 endif
@@ -189,7 +195,7 @@
 
 langs/langs.o :
        $(MAKE) DEBUG="$(DEBUG)" LINGUA="$(LINGUA)"             \
-               CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"       \
+               CPPFLAGS="$(CPPFLAGS) $(CPPFLAGS_LC)" CFLAGS="$(CFLAGS)"        \
                -C langs $(notdir $@)
 
 lang.h : po/C.mo
@@ -240,6 +246,12 @@
        $(CC) -c $(CPPFLAGS) $(CFLAGS) -D_TESTING_ -o $*.test.o .translated/$*.c
        $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $*.test.o $(filter-out $*.o,$(_obj)) $(_LIBS)
 
+%_lc_test:
+       rm -f main.o
+       $(CC) -c $(CPPFLAGS) $(CPPFLAGS_LC) $(CFLAGS) -D_TESTING_ -o main.o 
+.translated/main.c
+       $(CC) -c $(CPPFLAGS) $(CPPFLAGS_LC) $(CFLAGS) -D_TESTING_ -o $*.test.o 
+.translated/$*.c
+       $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $*.test.o $(filter-out $*.o,$(_obj)) $(_LIBS)
+
 test.trm: po/$(TESTLANG).po
        $(MAKE) -C po $(TESTLANG).trm
        cp po/$(TESTLANG).trm test.trm 
@@ -253,6 +265,9 @@
 
 %.test.o %.o : .translated/%.c
        $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+%.lc.o : .translated/%.c
+       $(CC) -c $(CPPFLAGS) $(CPPFLAGS_LC) $(CFLAGS) -o $@ $<
 
 $(UTF_LIBS_BASE)/newt/libnewt.a:
        $(MAKE) -C $(UTF_LIBS_BASE)/newt
Index: utilities/dbootstrap/po/Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/po/Makefile,v
retrieving revision 1.32
diff -u -r1.32 Makefile
--- utilities/dbootstrap/po/Makefile    2000/10/13 06:35:32     1.32
+++ utilities/dbootstrap/po/Makefile    2000/11/12 14:53:08
@@ -27,11 +27,13 @@
 __DUMMY__   := $(shell [ -d utf ] || mkdir utf)
 
 #all:  C.mo $(TRMFILES)
-ifeq ($(USE_LANGUAGE_CHOOSER),true)
-all: all-utf
-else
-all: do-trm
-endif
+#ifeq ($(USE_LANGUAGE_CHOOSER),true)
+#all: all-utf
+#else
+#all: do-trm
+#endif
+
+all: do-trm all-utf
 
 check-%: %.po
        @echo -n "$<: "

Reply via email to