[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

LANGUAGE_CHOOSER - continued



As I promised, here is the patch, which allows creation of root floppy
images with LANGUAGE_CHOOSER. I'm waiting for permission to commit it.

Possible problems I can see:

(1). Tested only on i386 (I only have access to such boxen), idepci flavor.
This should run on anything that has enough free space and framebuffer
support AFAIK.

The change in size between 2.2.16 idepci root.bin and a root.bin with
LANGUAGE_CHOOSER=true is about 375 KB gzipped, 1.1 MB raw.

Detailed description:

sizes of gzipped images:
idepci from 2.2.16:	 957787
idepci with LC:		1342191

numbers of free inodes:
idepci from 2.2.16:	170
idepci with LC:		60

directories that changed sizes:

 11k  ->   12k	dev		(fb, ptys)
 82k  -> 1021k	etc		(messages)
952k  ->  968k	lib		(libutf8_plug.so)
  1k  ->   32k	release_notes
815k  ->  924k	sbin		(bterm, udbootstrap)
  0   ->   57k	unifont-reduced.bgf
206k  ->  208k	usr		(bterm terminfo entry)

About 9 MB of memory is used just after startup   

Please try to test if all this works for different architectures, and tell
me if/why it doesn't.

(2). I added libutf8_plug.so to $LIBRARIES (under "determining set of required
libraries" in rootdisk.sh). I don't know if I should have, I thought this is
needed for library reduction, but now during the build tar cries that it
can't find the file (maybe because it is not run from top directory?):

I: copying required libraries to root filesystem
tar: ./utilities/bogl/libutf8_plug.so: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

This doesn't seem to break anything, though.

(3). Currently it won't build if you don't type 'make utils' earlier. Anyway,
IIRC this was also the case before, if you built e.g. only root.bin

(4). The release_notes.?? files in scripts/rootdisk/messages/ are not cleaned
on 'make clean' in top directory. Is this a right directory to keep them in
during build? If so, then I should add a cleaning command to top level
Makefile, right? If not, then where should they be kept?

(5). As I understand, LC won't be on all disk sets - only on those, which
have enough free space and framebuffer support. This will cause problems in
current build setup, where e.g. root1440idepci.bin contains a UTF-8
dbootstrap and things, but root1440.bin should be just plain old vanillia
root.bin, with standard.

This will mean we'll have to either:

1) make some kind of cleanup between building flavors with LC and those
   without it

 or

2) make two flavors of the things that differ between LC and non-LC
   versions, and name them differently, like:

	root.bin depends on dbootstrap
		while
	root-idepci.bin depends on dbootstrap-lc

(dbootstrap is the plain old version, while dbootstrap-lc is linked against
patched versions of slang and newt)

Does anyone have some idea for 3) ?


regards
Marcin

-- 
+--------------------------------+ The reason we come up with new versions
|Marcin Owsiany                  | is not to fix bugs. It's the stupidest
|porridge@pandora.info.bielsko.pl| 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/10/21 21:10:36
@@ -82,7 +88,7 @@
 ##
 
 # whether to use the language chooser in dbootstrap, `true' or `false'
-USE_LANGUAGE_CHOOSER := 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/10/21 21:10:41
@@ -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
@@ -131,6 +132,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 +243,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 +303,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 +457,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`
@@ -492,8 +517,19 @@
 
 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/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
+	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 +576,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/10/21 21:10:45
@@ -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/10/21 21:10:48
@@ -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/10/21 21:10:48
@@ -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*

Reply to: