summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abs/core/mkinitcpio-busybox/PKGBUILD11
-rw-r--r--abs/core/mkinitcpio-busybox/config60
-rw-r--r--abs/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch453
3 files changed, 45 insertions, 479 deletions
diff --git a/abs/core/mkinitcpio-busybox/PKGBUILD b/abs/core/mkinitcpio-busybox/PKGBUILD
index 6f0de2d..e58f87a 100644
--- a/abs/core/mkinitcpio-busybox/PKGBUILD
+++ b/abs/core/mkinitcpio-busybox/PKGBUILD
@@ -1,7 +1,7 @@
-# $Id: PKGBUILD 90030 2010-09-06 17:22:38Z thomas $
+# $Id: PKGBUILD 123921 2011-05-14 11:29:02Z thomas $
# Maintainer: Thomas Bächler <thomas@archlinux.org>
pkgname=mkinitcpio-busybox
-pkgver=1.17.2
+pkgver=1.18.4
pkgrel=1
pkgdesc="base initramfs tools"
arch=('i686' 'x86_64')
@@ -10,8 +10,8 @@ license=('GPL')
depends=('glibc')
source=(http://busybox.net/downloads/busybox-${pkgver}.tar.bz2
config)
-sha256sums=('7a4c9d59098734c86c3bfef421719c3239ca213bba071e284e2352ff4a01cac6'
- 'd2131815c28b987b0f7bf9065e7cf567c656438fbe0d44b685dc7dba387a1ca9')
+sha256sums=('4d24d37bd6f1bd153e8cf9a984ec2f32f18464f73ca535e2cc2e8be9694097fa'
+ 'dd6dca08fbc335f1394e0f1b619df6895349c759d0c6e43456aed411e16d4194')
build() {
cd "${srcdir}/busybox-${pkgver}"
@@ -22,11 +22,10 @@ build() {
else
sed 's|^CONFIG_EXTRA_CFLAGS=.*|CONFIG_EXTRA_CFLAGS="-march=i686 -mtune=generic -Os -pipe -fno-strict-aliasing"|' "${srcdir}/config" > .config
fi
- make || return 1
+ make
}
package() {
- cd "${srcdir}/busybox-${pkgver}"
install -D -m755 "${srcdir}/busybox-${pkgver}"/busybox "${pkgdir}/lib/initcpio/busybox"
}
# vim:set ts=2 sw=2 et:
diff --git a/abs/core/mkinitcpio-busybox/config b/abs/core/mkinitcpio-busybox/config
index 6efeb93..1aa333f 100644
--- a/abs/core/mkinitcpio-busybox/config
+++ b/abs/core/mkinitcpio-busybox/config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Busybox version: 1.17.2
-# Mon Sep 6 19:17:13 2010
+# Busybox version: 1.18.2
+# Wed Jan 26 23:08:18 2011
#
CONFIG_HAVE_DOT_CONFIG=y
@@ -16,6 +16,7 @@ CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_EXTRA_COMPAT is not set
# CONFIG_INCLUDE_SUSv2 is not set
# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
@@ -23,6 +24,7 @@ CONFIG_SHOW_USAGE=y
# CONFIG_FEATURE_VERBOSE_USAGE is not set
# CONFIG_FEATURE_COMPRESS_USAGE is not set
CONFIG_FEATURE_INSTALLER=y
+# CONFIG_INSTALL_NO_USR is not set
# CONFIG_LOCALE_SUPPORT is not set
CONFIG_UNICODE_SUPPORT=y
# CONFIG_UNICODE_USING_LOCALE is not set
@@ -37,8 +39,8 @@ CONFIG_LAST_SUPPORTED_WCHAR=767
CONFIG_LONG_OPTS=y
CONFIG_FEATURE_DEVPTS=y
# CONFIG_FEATURE_CLEAN_UP is not set
-# CONFIG_FEATURE_UTMP is not set
# CONFIG_FEATURE_WTMP is not set
+# CONFIG_FEATURE_UTMP is not set
# CONFIG_FEATURE_PIDFILE is not set
CONFIG_FEATURE_SUID=y
# CONFIG_FEATURE_SUID_CONFIG is not set
@@ -73,9 +75,8 @@ CONFIG_NO_DEBUG_LIB=y
# CONFIG_EFENCE is not set
#
-# Installation Options
+# Installation Options ("make install" behavior)
#
-# CONFIG_INSTALL_NO_USR is not set
CONFIG_INSTALL_APPLET_SYMLINKS=y
# CONFIG_INSTALL_APPLET_HARDLINKS is not set
# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
@@ -92,6 +93,7 @@ CONFIG_PASSWORD_MINLEN=6
CONFIG_MD5_SIZE_VS_SPEED=3
CONFIG_FEATURE_FAST_TOP=y
# CONFIG_FEATURE_ETC_NETWORKS is not set
+# CONFIG_FEATURE_USE_TERMIOS is not set
CONFIG_FEATURE_EDITING=y
CONFIG_FEATURE_EDITING_MAX_LEN=1024
# CONFIG_FEATURE_EDITING_VI is not set
@@ -172,6 +174,7 @@ CONFIG_FEATURE_TEST_64=y
# CONFIG_TR is not set
# CONFIG_FEATURE_TR_CLASSES is not set
# CONFIG_FEATURE_TR_EQUIV is not set
+# CONFIG_BASE64 is not set
# CONFIG_CAL is not set
# CONFIG_CATV is not set
CONFIG_CHGRP=y
@@ -342,6 +345,7 @@ CONFIG_MKTEMP=y
#
# Editors
#
+# CONFIG_PATCH is not set
CONFIG_AWK=y
# CONFIG_FEATURE_AWK_LIBM is not set
# CONFIG_CMP is not set
@@ -349,7 +353,6 @@ CONFIG_AWK=y
# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
# CONFIG_FEATURE_DIFF_DIR is not set
# CONFIG_ED is not set
-# CONFIG_PATCH is not set
CONFIG_SED=y
CONFIG_VI=y
CONFIG_FEATURE_VI_MAX_LEN=4096
@@ -409,6 +412,9 @@ CONFIG_FEATURE_GREP_EGREP_ALIAS=y
# CONFIG_BOOTCHARTD is not set
# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
# CONFIG_INIT is not set
# CONFIG_FEATURE_USE_INITTAB is not set
# CONFIG_FEATURE_KILL_REMOVED is not set
@@ -418,30 +424,30 @@ CONFIG_FEATURE_KILL_DELAY=0
# CONFIG_FEATURE_EXTRA_QUIET is not set
# CONFIG_FEATURE_INIT_COREDUMPS is not set
# CONFIG_FEATURE_INITRD is not set
-# CONFIG_HALT is not set
-# CONFIG_FEATURE_CALL_TELINIT is not set
-CONFIG_TELINIT_PATH=""
+CONFIG_INIT_TERMINAL_TYPE=""
# CONFIG_MESG is not set
#
# Login/Password Management Utilities
#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
# CONFIG_FEATURE_SHADOWPASSWDS is not set
# CONFIG_USE_BB_PWD_GRP is not set
# CONFIG_USE_BB_SHADOW is not set
# CONFIG_USE_BB_CRYPT is not set
# CONFIG_USE_BB_CRYPT_SHA is not set
-# CONFIG_ADDGROUP is not set
-# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
-# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
-# CONFIG_DELGROUP is not set
-# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
-# CONFIG_FEATURE_CHECK_NAMES is not set
# CONFIG_ADDUSER is not set
# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
CONFIG_FIRST_SYSTEM_ID=0
CONFIG_LAST_SYSTEM_ID=0
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
# CONFIG_GETTY is not set
# CONFIG_LOGIN is not set
# CONFIG_PAM is not set
@@ -500,6 +506,7 @@ CONFIG_DEFAULT_DEPMOD_FILE=""
#
# Linux System Utilities
#
+# CONFIG_BLOCKDEV is not set
# CONFIG_REV is not set
# CONFIG_ACPID is not set
# CONFIG_FEATURE_ACPID_COMPAT is not set
@@ -518,6 +525,7 @@ CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
# CONFIG_FEATURE_SGI_LABEL is not set
# CONFIG_FEATURE_SUN_LABEL is not set
# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
# CONFIG_FEATURE_FDISK_ADVANCED is not set
# CONFIG_FINDFS is not set
# CONFIG_FLOCK is not set
@@ -550,7 +558,6 @@ CONFIG_LOSETUP=y
# CONFIG_MKSWAP is not set
# CONFIG_FEATURE_MKSWAP_UUID is not set
# CONFIG_MORE is not set
-# CONFIG_FEATURE_USE_TERMIOS is not set
CONFIG_MOUNT=y
CONFIG_FEATURE_MOUNT_FAKE=y
CONFIG_FEATURE_MOUNT_VERBOSE=y
@@ -607,10 +614,13 @@ CONFIG_VOLUMEID=y
# Miscellaneous Utilities
#
# CONFIG_CONSPY is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
# CONFIG_UBIATTACH is not set
# CONFIG_UBIDETACH is not set
# CONFIG_ADJTIMEX is not set
# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
# CONFIG_BEEP is not set
CONFIG_FEATURE_BEEP_FREQ=0
CONFIG_FEATURE_BEEP_LENGTH_MS=0
@@ -690,6 +700,7 @@ CONFIG_STRINGS=y
#
# Networking Utilities
#
+# CONFIG_NBDCLIENT is not set
CONFIG_NC=y
CONFIG_NC_SERVER=y
CONFIG_NC_EXTRA=y
@@ -725,6 +736,7 @@ CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
CONFIG_IFCONFIG=y
CONFIG_FEATURE_IFCONFIG_STATUS=y
CONFIG_FEATURE_IFCONFIG_SLIP=y
@@ -823,6 +835,7 @@ CONFIG_WGET=y
CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
# CONFIG_ZCIP is not set
#
@@ -846,6 +859,10 @@ CONFIG_FEATURE_MIME_CHARSET=""
#
# Process Utilities
#
+# CONFIG_IOSTAT is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
# CONFIG_SMEMCAP is not set
CONFIG_FREE=y
# CONFIG_FUSER is not set
@@ -922,10 +939,13 @@ CONFIG_ASH_CMDCMD=y
CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
# CONFIG_ASH_RANDOM_SUPPORT is not set
CONFIG_ASH_EXPAND_PRMT=y
+CONFIG_CTTYHACK=y
# CONFIG_HUSH is not set
# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
# CONFIG_HUSH_HELP is not set
# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
# CONFIG_HUSH_JOB is not set
# CONFIG_HUSH_TICK is not set
# CONFIG_HUSH_IF is not set
@@ -933,22 +953,21 @@ CONFIG_ASH_EXPAND_PRMT=y
# CONFIG_HUSH_CASE is not set
# CONFIG_HUSH_FUNCTIONS is not set
# CONFIG_HUSH_LOCAL is not set
-# CONFIG_HUSH_EXPORT_N is not set
# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_MSH is not set
CONFIG_FEATURE_SH_IS_ASH=y
# CONFIG_FEATURE_SH_IS_HUSH is not set
# CONFIG_FEATURE_SH_IS_NONE is not set
# CONFIG_FEATURE_BASH_IS_ASH is not set
# CONFIG_FEATURE_BASH_IS_HUSH is not set
CONFIG_FEATURE_BASH_IS_NONE=y
-# CONFIG_LASH is not set
-# CONFIG_MSH is not set
CONFIG_SH_MATH_SUPPORT=y
# CONFIG_SH_MATH_SUPPORT_64 is not set
CONFIG_FEATURE_SH_EXTRA_QUIET=y
# CONFIG_FEATURE_SH_STANDALONE is not set
# CONFIG_FEATURE_SH_NOFORK is not set
-CONFIG_CTTYHACK=y
#
# System Logging Utilities
@@ -963,4 +982,5 @@ CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
# CONFIG_LOGREAD is not set
# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
# CONFIG_KLOGD is not set
+# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
# CONFIG_LOGGER is not set
diff --git a/abs/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch b/abs/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch
deleted file mode 100644
index a7592de..0000000
--- a/abs/core/mkinitcpio-busybox/loadfont-setfont-optional-psf2-font-support.patch
+++ /dev/null
@@ -1,453 +0,0 @@
-From 8ce1dc03c1b2b61e51527b987579c09c991cc4b2 Mon Sep 17 00:00:00 2001
-From: Harald Becker <ralda@gmx.de>
-Date: Sun, 21 Feb 2010 12:10:26 +0000
-Subject: loadfont/setfont: optional PSF2 font support
-
-Signed-off-by: Harald Becker <ralda@gmx.de>
-Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
----
-diff --git a/console-tools/Config.in b/console-tools/Config.in
-index cd0a931..195685b 100644
---- a/console-tools/Config.in
-+++ b/console-tools/Config.in
-@@ -135,4 +135,21 @@ config SHOWKEY
- help
- Shows keys pressed.
-
-+comment "Common options for loadfont and setfont"
-+ depends on LOADFONT || SETFONT
-+
-+config FEATURE_LOADFONT_PSF2
-+ bool "Support for PSF2 console fonts"
-+ default n
-+ depends on LOADFONT || SETFONT
-+ help
-+ Support PSF2 console fonts.
-+
-+config FEATURE_LOADFONT_RAW
-+ bool "Support for old (raw) console fonts"
-+ default n
-+ depends on LOADFONT || SETFONT
-+ help
-+ Support old (raw) console fonts.
-+
- endmenu
-diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
-index e833474..e51142c 100644
---- a/console-tools/loadfont.c
-+++ b/console-tools/loadfont.c
-@@ -13,7 +13,7 @@
- #include <sys/kd.h>
-
- #ifndef KDFONTOP
--#define KDFONTOP 0x4B72
-+# define KDFONTOP 0x4B72
- struct console_font_op {
- unsigned op; /* KD_FONT_OP_* */
- unsigned flags; /* KD_FONT_FLAG_* */
-@@ -21,91 +21,137 @@ struct console_font_op {
- unsigned charcount;
- unsigned char *data; /* font data with height fixed to 32 */
- };
--
--#define KD_FONT_OP_SET 0 /* Set font */
--#define KD_FONT_OP_GET 1 /* Get font */
--#define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default,
-- data points to name / NULL */
--#define KD_FONT_OP_COPY 3 /* Copy from another console */
--
--#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
--#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
-+# define KD_FONT_OP_SET 0 /* Set font */
-+# define KD_FONT_OP_GET 1 /* Get font */
-+# define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
-+# define KD_FONT_OP_COPY 3 /* Copy from another console */
-+# define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface */
-+# define KD_FONT_FLAG_DONT_RECALC 1 /* Don't call adjust_height() */
- /* (Used internally for PIO_FONT support) */
- #endif /* KDFONTOP */
-
-
- enum {
-- PSF_MAGIC1 = 0x36,
-- PSF_MAGIC2 = 0x04,
--
-- PSF_MODE512 = 0x01,
-- PSF_MODEHASTAB = 0x02,
-- PSF_MAXMODE = 0x03,
-- PSF_SEPARATOR = 0xffff
-+ PSF1_MAGIC0 = 0x36,
-+ PSF1_MAGIC1 = 0x04,
-+ PSF1_MODE512 = 0x01,
-+ PSF1_MODEHASTAB = 0x02,
-+ PSF1_MODEHASSEQ = 0x04,
-+ PSF1_MAXMODE = 0x05,
-+ PSF1_STARTSEQ = 0xfffe,
-+ PSF1_SEPARATOR = 0xffff,
- };
-
--struct psf_header {
-- unsigned char magic1, magic2; /* Magic number */
-+struct psf1_header {
-+ unsigned char magic[2]; /* Magic number */
- unsigned char mode; /* PSF font mode */
- unsigned char charsize; /* Character size */
- };
-
--#define PSF_MAGIC_OK(x) ((x)->magic1 == PSF_MAGIC1 && (x)->magic2 == PSF_MAGIC2)
-+#define psf1h(x) ((struct psf1_header*)(x))
-+
-+#define PSF1_MAGIC_OK(x) ( \
-+ (x)->magic[0] == PSF1_MAGIC0 \
-+ && (x)->magic[1] == PSF1_MAGIC1 \
-+)
-+
-+#if ENABLE_FEATURE_LOADFONT_PSF2
-+enum {
-+ PSF2_MAGIC0 = 0x72,
-+ PSF2_MAGIC1 = 0xb5,
-+ PSF2_MAGIC2 = 0x4a,
-+ PSF2_MAGIC3 = 0x86,
-+ PSF2_HAS_UNICODE_TABLE = 0x01,
-+ PSF2_MAXVERSION = 0,
-+ PSF2_STARTSEQ = 0xfe,
-+ PSF2_SEPARATOR = 0xff
-+};
-+
-+struct psf2_header {
-+ unsigned char magic[4];
-+ unsigned int version;
-+ unsigned int headersize; /* offset of bitmaps in file */
-+ unsigned int flags;
-+ unsigned int length; /* number of glyphs */
-+ unsigned int charsize; /* number of bytes for each character */
-+ unsigned int height; /* max dimensions of glyphs */
-+ unsigned int width; /* charsize = height * ((width + 7) / 8) */
-+};
-+
-+#define psf2h(x) ((struct psf2_header*)(x))
-+
-+#define PSF2_MAGIC_OK(x) ( \
-+ (x)->magic[0] == PSF2_MAGIC0 \
-+ && (x)->magic[1] == PSF2_MAGIC1 \
-+ && (x)->magic[2] == PSF2_MAGIC2 \
-+ && (x)->magic[3] == PSF2_MAGIC3 \
-+)
-+#endif /* ENABLE_FEATURE_LOADFONT_PSF2 */
-
--static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
-+
-+static void do_loadfont(int fd, unsigned char *inbuf, int height, int width, int charsize, int fontsize)
- {
-- char *buf;
-+ unsigned char *buf;
-+ int charwidth = 32 * ((width+7)/8);
- int i;
-
-- if (unit < 1 || unit > 32)
-- bb_error_msg_and_die("bad character size %d", unit);
-+ if (height < 1 || height > 32 || width < 1 || width > 32)
-+ bb_error_msg_and_die("bad character size %dx%d", height, width);
-
-- buf = xzalloc(16 * 1024);
-+ buf = xzalloc(charwidth * ((fontsize < 128) ? 128 : fontsize));
- for (i = 0; i < fontsize; i++)
-- memcpy(buf + (32 * i), inbuf + (unit * i), unit);
-+ memcpy(buf + (i*charwidth), inbuf + (i*charsize), charsize);
-
- { /* KDFONTOP */
- struct console_font_op cfo;
--
- cfo.op = KD_FONT_OP_SET;
- cfo.flags = 0;
-- cfo.width = 8;
-- cfo.height = unit;
-+ cfo.width = width;
-+ cfo.height = height;
- cfo.charcount = fontsize;
-- cfo.data = (void*)buf;
--#if 0
-- if (!ioctl_or_perror(fd, KDFONTOP, &cfo, "KDFONTOP ioctl failed (will try PIO_FONTX)"))
-- goto ret; /* success */
--#else
-+ cfo.data = buf;
- xioctl(fd, KDFONTOP, &cfo);
--#endif
- }
-
--#if 0
--/* These ones do not honour -C tty (they set font on current tty regardless)
-- * On x86, this distinction is visible on framebuffer consoles
-- * (regular character consoles may have only one shared font anyway)
-- */
--#if defined(PIO_FONTX) && !defined(__sparc__)
-- {
-- struct consolefontdesc cfd;
--
-- cfd.charcount = fontsize;
-- cfd.charheight = unit;
-- cfd.chardata = buf;
--
-- if (!ioctl_or_perror(fd, PIO_FONTX, &cfd, "PIO_FONTX ioctl failed (will try PIO_FONT)"))
-- goto ret; /* success */
-- }
--#endif
-- xioctl(fd, PIO_FONT, buf);
-- ret:
--#endif /* 0 */
- free(buf);
- }
-
--static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
-+/*
-+ * Format of the Unicode information:
-+ *
-+ * For each font position <uc>*<seq>*<term>
-+ * where <uc> is a 2-byte little endian Unicode value (PSF1)
-+ * or an UTF-8 coded value (PSF2),
-+ * <seq> = <ss><uc><uc>*, <ss> = psf1 ? 0xFFFE : 0xFE,
-+ * <term> = psf1 ? 0xFFFF : 0xFF.
-+ * and * denotes zero or more occurrences of the preceding item.
-+ *
-+ * Semantics:
-+ * The leading <uc>* part gives Unicode symbols that are all
-+ * represented by this font position. The following sequences
-+ * are sequences of Unicode symbols - probably a symbol
-+ * together with combining accents - also represented by
-+ * this font position.
-+ *
-+ * Example:
-+ * At the font position for a capital A-ring glyph, we
-+ * may have:
-+ * 00C5,212B,FFFE,0041,030A,FFFF
-+ * Some font positions may be described by sequences only,
-+ * namely when there is no precomposed Unicode value for the glyph.
-+ */
-+#if !ENABLE_FEATURE_LOADFONT_PSF2
-+#define do_loadtable(fd, inbuf, tailsz, fontsize, psf2) \
-+ do_loadtable(fd, inbuf, tailsz, fontsize)
-+#endif
-+static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize, int psf2)
- {
-+#if !ENABLE_FEATURE_LOADFONT_PSF2
-+/* gcc 4.3.1 code size: */
-+# define psf2 0 /* +0 bytes */
-+// const int psf2 = 0; /* +8 bytes */
-+// enum { psf2 = 0 }; /* +13 bytes */
-+#endif
- struct unimapinit advice;
- struct unimapdesc ud;
- struct unipair *up;
-@@ -114,15 +160,48 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
- uint16_t unicode;
-
- maxct = tailsz; /* more than enough */
-- up = xmalloc(maxct * sizeof(struct unipair));
-+ up = xmalloc(maxct * sizeof(*up));
-
- for (glyph = 0; glyph < fontsize; glyph++) {
-- while (tailsz >= 2) {
-- unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
-- tailsz -= 2;
-- inbuf += 2;
-- if (unicode == PSF_SEPARATOR)
-- break;
-+ while (tailsz > 0) {
-+ if (!psf2) { /* PSF1 */
-+ unicode = (((uint16_t) inbuf[1]) << 8) + inbuf[0];
-+ tailsz -= 2;
-+ inbuf += 2;
-+ if (unicode == PSF1_SEPARATOR)
-+ break;
-+ } else { /* PSF2 */
-+#if ENABLE_FEATURE_LOADFONT_PSF2
-+ --tailsz;
-+ unicode = *inbuf++;
-+ if (unicode == PSF2_SEPARATOR) {
-+ break;
-+ } else if (unicode == PSF2_STARTSEQ) {
-+ bb_error_msg_and_die("unicode sequences not implemented");
-+ } else if (unicode >= 0xC0) {
-+ if (unicode >= 0xFC)
-+ unicode &= 0x01, maxct = 5;
-+ else if (unicode >= 0xF8)
-+ unicode &= 0x03, maxct = 4;
-+ else if (unicode >= 0xF0)
-+ unicode &= 0x07, maxct = 3;
-+ else if (unicode >= 0xE0)
-+ unicode &= 0x0F, maxct = 2;
-+ else
-+ unicode &= 0x1F, maxct = 1;
-+ do {
-+ if (tailsz <= 0 || *inbuf < 0x80 || *inbuf > 0xBF)
-+ bb_error_msg_and_die("illegal UTF-8 character");
-+ --tailsz;
-+ unicode = (unicode << 6) + (*inbuf++ & 0x3F);
-+ } while (--maxct > 0);
-+ } else if (unicode >= 0x80) {
-+ bb_error_msg_and_die("illegal UTF-8 character");
-+ }
-+#else
-+ return;
-+#endif
-+ }
- up[ct].unicode = unicode;
- up[ct].fontpos = glyph;
- ct++;
-@@ -139,58 +218,78 @@ static void do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
- ud.entry_ct = ct;
- ud.entries = up;
- xioctl(fd, PIO_UNIMAP, &ud);
-+#undef psf2
- }
-
--static void do_load(int fd, struct psf_header *psfhdr, size_t len)
-+static void do_load(int fd, unsigned char *buffer, size_t len)
- {
-- int unit;
-- int fontsize;
-- int hastable;
-- unsigned head0, head = head;
--
-- /* test for psf first */
-- if (len >= sizeof(struct psf_header) && PSF_MAGIC_OK(psfhdr)) {
-- if (psfhdr->mode > PSF_MAXMODE)
-+ int height;
-+ int width = 8;
-+ int charsize;
-+ int fontsize = 256;
-+ int has_table = 0;
-+ unsigned char *font = buffer;
-+ unsigned char *table;
-+
-+ if (len >= sizeof(struct psf1_header) && PSF1_MAGIC_OK(psf1h(buffer))) {
-+ if (psf1h(buffer)->mode > PSF1_MAXMODE)
- bb_error_msg_and_die("unsupported psf file mode");
-- fontsize = ((psfhdr->mode & PSF_MODE512) ? 512 : 256);
--#if !defined(PIO_FONTX) || defined(__sparc__)
-- if (fontsize != 256)
-- bb_error_msg_and_die("only fontsize 256 supported");
-+ if (psf1h(buffer)->mode & PSF1_MODE512)
-+ fontsize = 512;
-+ if (psf1h(buffer)->mode & PSF1_MODEHASTAB)
-+ has_table = 1;
-+ height = charsize = psf1h(buffer)->charsize;
-+ font += sizeof(struct psf1_header);
-+ } else
-+#if ENABLE_FEATURE_LOADFONT_PSF2
-+ if (len >= sizeof(struct psf2_header) && PSF2_MAGIC_OK(psf2h(buffer))) {
-+ if (psf2h(buffer)->version > PSF2_MAXVERSION)
-+ bb_error_msg_and_die("unsupported psf file version");
-+ fontsize = psf2h(buffer)->length;
-+ if (psf2h(buffer)->flags & PSF2_HAS_UNICODE_TABLE)
-+ has_table = 2;
-+ charsize = psf2h(buffer)->charsize;
-+ height = psf2h(buffer)->height;
-+ width = psf2h(buffer)->width;
-+ font += psf2h(buffer)->headersize;
-+ } else
- #endif
-- hastable = (psfhdr->mode & PSF_MODEHASTAB);
-- unit = psfhdr->charsize;
-- head0 = sizeof(struct psf_header);
--
-- head = head0 + fontsize * unit;
-- if (head > len || (!hastable && head != len))
-- bb_error_msg_and_die("input file: bad length");
-- } else {
-- /* file with three code pages? */
-- if (len == 9780) {
-- head0 = 40;
-- unit = 16;
-- } else {
-- /* bare font */
-- if (len & 0377)
-- bb_error_msg_and_die("input file: bad length");
-- head0 = 0;
-- unit = len / 256;
-- }
-- fontsize = 256;
-- hastable = 0;
-+#if ENABLE_FEATURE_LOADFONT_RAW
-+ if (len == 9780) { /* file with three code pages? */
-+ charsize = height = 16;
-+ font += 40;
-+ } else if ((len & 0377) == 0) { /* bare font */
-+ charsize = height = len / 256;
-+ } else
-+#endif
-+ {
-+ bb_error_msg_and_die("input file: bad length or unsupported font type");
- }
-
-- do_loadfont(fd, (unsigned char *)psfhdr + head0, unit, fontsize);
-- if (hastable)
-- do_loadtable(fd, (unsigned char *)psfhdr + head, len - head, fontsize);
-+#if !defined(PIO_FONTX) || defined(__sparc__)
-+ if (fontsize != 256)
-+ bb_error_msg_and_die("only fontsize 256 supported");
-+#endif
-+
-+ table = font + fontsize * charsize;
-+ buffer += len;
-+
-+ if (table > buffer || (!has_table && table != buffer))
-+ bb_error_msg_and_die("input file: bad length");
-+
-+ do_loadfont(fd, font, height, width, charsize, fontsize);
-+
-+ if (has_table)
-+ do_loadtable(fd, table, buffer - table, fontsize, has_table - 1);
- }
-
-+
- #if ENABLE_LOADFONT
- int loadfont_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
- int loadfont_main(int argc UNUSED_PARAM, char **argv)
- {
- size_t len;
-- struct psf_header *psfhdr;
-+ unsigned char *buffer;
-
- // no arguments allowed!
- opt_complementary = "=0";
-@@ -202,11 +301,11 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv)
- * just read the entire file.
- */
- len = 32*1024; // can't be larger
-- psfhdr = xmalloc_read(STDIN_FILENO, &len);
-+ buffer = xmalloc_read(STDIN_FILENO, &len);
- // xmalloc_open_zipped_read_close(filename, &len);
-- if (!psfhdr)
-+ if (!buffer)
- bb_perror_msg_and_die("error reading input font");
-- do_load(get_console_fd_or_die(), psfhdr, len);
-+ do_load(get_console_fd_or_die(), buffer, len);
-
- return EXIT_SUCCESS;
- }
-@@ -269,7 +368,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
- size_t len;
- unsigned opts;
- int fd;
-- struct psf_header *psfhdr;
-+ unsigned char *buffer;
- char *mapfilename;
- const char *tty_name = CURRENT_TTY;
-
-@@ -287,10 +386,10 @@ int setfont_main(int argc UNUSED_PARAM, char **argv)
- }
- // load font
- len = 32*1024; // can't be larger
-- psfhdr = xmalloc_open_zipped_read_close(*argv, &len);
-- if (!psfhdr)
-+ buffer = xmalloc_open_zipped_read_close(*argv, &len);
-+ if (!buffer)
- bb_simple_perror_msg_and_die(*argv);
-- do_load(fd, psfhdr, len);
-+ do_load(fd, buffer, len);
-
- // load the screen map, if any
- if (opts & 1) { // -m
---
-cgit v0.8.2.1