summaryrefslogtreecommitdiff
path: root/recipes/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/util-linux')
-rw-r--r--recipes/util-linux/files/MCONFIG223
-rw-r--r--recipes/util-linux/files/defines.h10
-rw-r--r--recipes/util-linux/files/fdiskbsdlabel-avr32.patch11
-rw-r--r--recipes/util-linux/files/fdiskbsdlabel_thumb.diff12
-rw-r--r--recipes/util-linux/files/gcc34.patch23
-rw-r--r--recipes/util-linux/files/glibc-fix.patch62
-rw-r--r--recipes/util-linux/files/glibc-umount2.patch18
-rw-r--r--recipes/util-linux/files/make_include17
-rw-r--r--recipes/util-linux/files/mtx-1/make_include16
-rw-r--r--recipes/util-linux/files/mtx-2/make_include16
-rw-r--r--recipes/util-linux/files/swapargs.h2
-rw-r--r--recipes/util-linux/files/umount.diff19
-rw-r--r--recipes/util-linux/files/util-linux-2.12r-cramfs-1.patch87
-rw-r--r--recipes/util-linux/files/util-linux_2.12r-12.diff.gzbin0 -> 100566 bytes
-rw-r--r--recipes/util-linux/util-linux-2.12/ioctl.diff52
-rw-r--r--recipes/util-linux/util-linux-2.12/my_dev_t.h.diff8
-rw-r--r--recipes/util-linux/util-linux-native_2.12r.bb32
-rw-r--r--recipes/util-linux/util-linux.inc195
-rw-r--r--recipes/util-linux/util-linux_2.12.bb11
-rw-r--r--recipes/util-linux/util-linux_2.12o.bb3
-rw-r--r--recipes/util-linux/util-linux_2.12q.bb7
-rw-r--r--recipes/util-linux/util-linux_2.12r.bb9
22 files changed, 833 insertions, 0 deletions
diff --git a/recipes/util-linux/files/MCONFIG b/recipes/util-linux/files/MCONFIG
new file mode 100644
index 0000000000..3fea2c02d7
--- /dev/null
+++ b/recipes/util-linux/files/MCONFIG
@@ -0,0 +1,223 @@
+# MCONFIG -- Configuration stuff for util-linux
+# Created: Sat Feb 4 15:50:30 1995
+# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
+
+# For a user-mode install, make (at least) three changes:
+# - remove the `-o root' part in INSTALLSUID
+# - set USE_TTY_GROUP=no
+# - define DESTDIR
+
+# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
+# Select for CPU i386 if the binaries must be able to run on an intel 386
+# (by default i486 code is generated, see below)
+CPU=$(shell uname -m)
+ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
+
+# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
+# will use PAM for authentication. Additionally, passwd will not be
+# installed as it is not PAM aware.
+HAVE_PAM=no
+
+# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
+# and vipw will not be built or installed from the login-utils
+# subdirectory.
+HAVE_SHADOW=yes
+
+# If HAVE_PASSWD is set to "yes", then passwd will not be built or
+# installed from the login-utils subdirectory (but login, chfn, chsh,
+# newgrp, and vipw *will* be installed).
+HAVE_PASSWD=no
+
+# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
+# non-root users to enter the account password before updating /etc/passwd.
+REQUIRE_PASSWORD=yes
+#REQUIRE_PASSWORD=no
+
+# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
+# the selected shell be listed in /etc/shells -- otherwise only a warning is
+# printed. This prevents someone from setting their shell to /bin/false.
+ONLY_LISTED_SHELLS=yes
+#ONLY_LISTED_SHELLS=no
+
+
+# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
+# be built or installed from the login-utils subdirectory. (The shutdown
+# and halt that come with the SysVinit package should be used with the init
+# found in that package.)
+HAVE_SYSVINIT=no
+
+# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
+# not be built or installed from the login-utils subdirectory. (The
+# shutdown and init from the SysVinit package do not depend on the last,
+# mesg, and wall from that package.)
+HAVE_SYSVINIT_UTILS=no
+
+# If HAVE_WRITE is set to "yes", then write will not be built or
+# installed from the misc-utils subdirectory.
+# (There is a network aware write in netwrite from NetKit 0.16 or later.)
+HAVE_WRITE=no
+
+# If HAVE_GETTY is set to "yes", then agetty will not be built or
+# installed from the login-utils subdirectory. Note that agetty can
+# co-exist with other gettys, so this option should never be used.
+HAVE_GETTY=no
+
+# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
+# setgid to the "tty" group, and mesg will only set the group write bit.
+# Note that this is only useful if login/xterm/etc. change the group of the
+# user's tty to "tty" [The login in util-linux does this correctly, and
+# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
+# properly.]
+USE_TTY_GROUP=no
+
+# If HAVE_KILL is set to "yes", then kill will not be built or
+# installed from the misc-utils subdirectory.
+# (There is also a kill in the procps package.)
+HAVE_KILL=no
+
+# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
+# to the current user, allowing her to make a screendump and do other
+# nifty things on the console, but also allowing him to keep an open
+# file descriptor after logging out to trick the next user.
+ALLOW_VCS_USE=yes
+
+# If HAVE_RESET is set to "yes", then reset won't be installed. The version
+# of reset that comes with the ncurses package is less aggressive.
+HAVE_RESET=yes
+
+# If HAVE_SLN is set to "yes", then sln won't be installed
+# (but the man page sln.8 will be installed anyway).
+# sln also comes with libc and glibc.
+HAVE_SLN=no
+
+# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
+HAVE_FDUTILS=no
+
+# If SILENT_PG is set to "yes", then pg will not ring the bell
+# when an invalid key is pressed
+SILENT_PG=no
+
+# If configure decides that Native Language Support (NLS) is available,
+# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
+# DISABLE_NLS to "yes".
+DISABLE_NLS=no
+
+# Different optimizations for different cpus.
+# gcc 3.0 likes options -mcpu=i486 instead of -m486
+ifeq "$(ARCH)" "intel"
+ ifeq "$(HAVE_OLD_GCC)" "yes"
+ CPUHEAD=-m
+ else
+ CPUHEAD=-mcpu=i
+ endif
+ ifeq "$(CPU)" "i386"
+ CPUTAIL=386
+ else
+ CPUTAIL=486
+ endif
+ CPUOPT= $(CPUHEAD)$(CPUTAIL)
+ OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
+else
+ ifeq "$(ARCH)" "arm"
+ OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
+ else
+ OPT= -O2 -fomit-frame-pointer
+ endif
+endif
+
+WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
+
+LIB=../lib
+
+ERR_O=$(LIB)/err.o
+
+# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
+# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
+# HAVE_SLANG=yes
+# There is a subdirectory /usr/include/slang containing slcurses.h
+# SLANGFLAGS=-I/usr/include/slang
+# No such subdirectory - slcurses.h lives in /usr/include
+# (no extra definition required).
+LIBSLANG=-lslang
+
+#
+# Paths used for compilation (not all are actually used, see CFLAGS below)
+#
+DEV_DIR= /dev
+ETC_DIR= /etc
+SBIN_DIR= /sbin
+USRSBIN_DIR= /usr/sbin
+USRLIB_DIR= /usr/lib
+USRBIN_DIR= /usr/bin
+USRGAMES_DIR= /usr/games
+USRSHAREMISC_DIR=/usr/share/misc
+LOCALE_DIR= /usr/share/locale
+BIN_DIR= /bin
+VAR_PATH= /var
+LOG_DIR= /var/log
+MAN_DIR= /usr/share/man
+INFO_DIR= /usr/share/info
+
+#
+# Paths used for install
+#
+DEVDIR= $(DESTDIR)$(DEV_DIR)
+ETCDIR= $(DESTDIR)$(ETC_DIR)
+SBINDIR= $(DESTDIR)$(SBIN_DIR)
+USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR)
+USRLIBDIR= $(DESTDIR)$(USRLIB_DIR)
+USRBINDIR= $(DESTDIR)$(USRBIN_DIR)
+USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR)
+USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR)
+LOCALEDIR= $(DESTDIR)$(LOCALE_DIR)
+BINDIR= $(DESTDIR)$(BIN_DIR)
+VARPATH= $(DESTDIR)$(VAR_PATH)
+LOGDIR= $(DESTDIR)$(LOG_DIR)
+MANDIR= $(DESTDIR)$(MAN_DIR)
+MAN1DIR= $(MANDIR)/man1
+MAN3DIR= $(MANDIR)/man3
+MAN5DIR= $(MANDIR)/man5
+MAN6DIR= $(MANDIR)/man6
+MAN8DIR= $(MANDIR)/man8
+INFODIR= $(DESTDIR)$(INFO_DIR)
+
+# Directory for shutdown, halt, reboot, etc.
+SHUTDOWNDIR= $(SBINDIR)
+
+# Modes
+DIRMODE= 755
+BINMODE= 755
+MANMODE= 644
+DATMODE= 644
+INFOMODE= 644
+SUIDMODE= 4755
+
+CHMOD= chmod
+INSTALL= install
+INSTALLDIR= $(INSTALL) -d -m $(DIRMODE)
+INSTALLBIN= $(INSTALL) -m $(BINMODE)
+INSTALLMAN= $(INSTALL) -m $(MANMODE)
+INSTALLDAT= $(INSTALL) -m $(DATMODE)
+INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
+
+ifeq "$(DISABLE_NLS)" "yes"
+NLSFLAGS = -DDISABLE_NLS
+endif
+
+CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \
+ $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \
+ -D_FILE_OFFSET_BITS=64 \
+ -DSBINDIR=\"$(SBIN_DIR)\" \
+ -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \
+ -DLOGDIR=\"$(LOG_DIR)\" \
+ -DVARPATH=\"$(VAR_PATH)\" \
+ -DLOCALEDIR=\"$(LOCALE_DIR)\" \
+ $(CFLAGS)
+
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+%: %.cc
+ $(CXX) $(CFLAGS) $< -o $@
+
diff --git a/recipes/util-linux/files/defines.h b/recipes/util-linux/files/defines.h
new file mode 100644
index 0000000000..6ce6b86df5
--- /dev/null
+++ b/recipes/util-linux/files/defines.h
@@ -0,0 +1,10 @@
+#define UTIL_LINUX_VERSION "2.12"
+#define util_linux_version "util-linux-2.12"
+
+#define HAVE_blkpg_h
+#define HAVE_kd_h
+#define HAVE_locale_h
+#define HAVE_langinfo_h
+#define HAVE_sys_user_h
+#define HAVE_asm_types_h
+//#define NEED_tqueue_h
diff --git a/recipes/util-linux/files/fdiskbsdlabel-avr32.patch b/recipes/util-linux/files/fdiskbsdlabel-avr32.patch
new file mode 100644
index 0000000000..4a7d8f4dc8
--- /dev/null
+++ b/recipes/util-linux/files/fdiskbsdlabel-avr32.patch
@@ -0,0 +1,11 @@
+--- /tmp/fdiskbsdlabel.h 2007-09-14 08:52:56.188364759 +0200
++++ util-linux-2.12r/fdisk/fdiskbsdlabel.h 2007-09-14 08:53:31.279986639 +0200
+@@ -43,7 +43,7 @@
+
+ #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec"
+
+-#if defined (i386) || defined (__sparc__) || defined (__arm__) || defined (__mips__) || defined (__s390__) || defined (__sh__) || defined(__x86_64__)
++#if defined (i386) || defined (__sparc__) || defined (__arm__) || defined (__mips__) || defined (__s390__) || defined (__sh__) || defined(__x86_64__) || defined(__avr32__)
+ #define BSD_LABELSECTOR 1
+ #define BSD_LABELOFFSET 0
+ #elif defined (__alpha__) || defined (__powerpc__) || defined (__ia64__) || defined (__hppa__)
diff --git a/recipes/util-linux/files/fdiskbsdlabel_thumb.diff b/recipes/util-linux/files/fdiskbsdlabel_thumb.diff
new file mode 100644
index 0000000000..e6f82b5b46
--- /dev/null
+++ b/recipes/util-linux/files/fdiskbsdlabel_thumb.diff
@@ -0,0 +1,12 @@
+--- util-linux-2.12r/fdisk/fdiskbsdlabel.h.orig 2006-01-21 23:53:51.000000000 +0100
++++ util-linux-2.12r/fdisk/fdiskbsdlabel.h 2006-01-21 23:54:35.000000000 +0100
+@@ -52,6 +52,9 @@
+ #elif defined (__s390__) || defined (__s390x__)
+ #define BSD_LABELSECTOR 1
+ #define BSD_LABELOFFSET 0
++#elif defined (__thumb__)
++#define BSD_LABELSECTOR 1
++#define BSD_LABELOFFSET 0
+ #else
+ #error unknown architecture
+ #endif
diff --git a/recipes/util-linux/files/gcc34.patch b/recipes/util-linux/files/gcc34.patch
new file mode 100644
index 0000000000..8c4a20cdca
--- /dev/null
+++ b/recipes/util-linux/files/gcc34.patch
@@ -0,0 +1,23 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- util-linux-2.12o/disk-utils/fsck.cramfs.c~gcc34
++++ util-linux-2.12o/disk-utils/fsck.cramfs.c
+@@ -77,15 +77,7 @@
+ #define PAD_SIZE 512
+
+ #include <asm/page.h>
+-#ifdef PAGE_SIZE
+-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
+-#elif defined __ia64__
+-#define PAGE_CACHE_SIZE (16384)
+-#elif defined __alpha__
+-#define PAGE_CACHE_SIZE (8192)
+-#else
+ #define PAGE_CACHE_SIZE (4096)
+-#endif
+
+ /* Guarantee access to at least 8kB at a time */
+ #define ROMBUFFER_BITS 13
diff --git a/recipes/util-linux/files/glibc-fix.patch b/recipes/util-linux/files/glibc-fix.patch
new file mode 100644
index 0000000000..d72c1701ef
--- /dev/null
+++ b/recipes/util-linux/files/glibc-fix.patch
@@ -0,0 +1,62 @@
+--- /tmp/llseek.c 2006-11-21 11:31:31.000000000 +0100
++++ util-linux-2.12r/fdisk/llseek.c 2006-11-21 11:33:21.218554000 +0100
+@@ -31,9 +31,18 @@
+
+ #ifdef __NR__llseek
+
++#ifdef _syscall5
++
+ static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
+ unsigned long, offset_low,long long *,result,
+ unsigned int, origin)
++#else
++static int _llseek (unsigned int fd, unsigned long oh,
++ unsigned long ol, long long *result,
++ unsigned int origin) {
++ return syscall (__NR__llseek, fd, oh, ol, result, origin);
++}
++#endif /* _syscall5 */
+
+ #else
+
+--- /tmp/sfdisk.c 2006-11-21 11:36:13.000000000 +0100
++++ util-linux-2.12r/fdisk/sfdisk.c 2006-11-21 11:37:17.678554000 +0100
+@@ -177,9 +177,16 @@
+ #endif
+
+ #ifndef use_lseek
++#ifdef _syscall5
+ static __attribute__used
+ _syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
+ loff_t *, res, unsigned int, wh);
++#else
++int _llseek (unsigned int fd, ulong hi, ulong lo,
++ loff_t *res, unsigned int wh) {
++ return syscall (__NR__llseek, fd, hi, lo, res, wh);
++}
++#endif /* _syscall5 */
+ #endif
+
+ static int
+--- /tmp/cmos.c 2006-11-21 11:38:55.000000000 +0100
++++ util-linux-2.12r/hwclock/cmos.c 2006-11-21 11:41:45.458554000 +0100
+@@ -46,15 +46,16 @@
+
+ #include <unistd.h> /* for geteuid() */
+ #include <fcntl.h> /* for O_RDWR */
++#include <linux/version.h>
+ #include <errno.h>
+ #include "../defines.h" /* for HAVE_sys_io_h */
+ #include "nls.h"
+
+ #if defined(__i386__)
+-#ifdef HAVE_sys_io_h
+-#include <sys/io.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
++#include <asm/io.h>
+ #else
+-#include <asm/io.h> /* for inb, outb */
++#include <sys/io.h> /* for inb, outb */
+ #endif
+ #elif defined(__alpha__)
+ /* <asm/io.h> fails to compile, probably because of u8 etc */
diff --git a/recipes/util-linux/files/glibc-umount2.patch b/recipes/util-linux/files/glibc-umount2.patch
new file mode 100644
index 0000000000..3da3a85cfc
--- /dev/null
+++ b/recipes/util-linux/files/glibc-umount2.patch
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10sparcumount.dpatch by Jeff Bailey <jbailey@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Sparc and Arm have umount2 in glibc.
+
+@DPATCH@
+--- util-linux/mount/umount.c 2005-05-20 11:39:07.000000000 +0000
++++ util-linux/mount/umount.c 2005-05-20 11:39:15.000000000 +0000
+@@ -31,7 +31,7 @@
+ #include <arpa/inet.h>
+ #endif
+
+-#if defined(MNT_FORCE) && !defined(__sparc__) && !defined(__arm__)
++#if defined(MNT_FORCE)
+ /* Interesting ... it seems libc knows about MNT_FORCE and presumably
+ about umount2 as well -- need not do anything */
+ #else /* MNT_FORCE */
diff --git a/recipes/util-linux/files/make_include b/recipes/util-linux/files/make_include
new file mode 100644
index 0000000000..e6abcd91f7
--- /dev/null
+++ b/recipes/util-linux/files/make_include
@@ -0,0 +1,17 @@
+VERSION=2.12
+CC=gcc
+CFLAGS=
+LDFLAGS=
+HAVE_OLD_GCC=yes
+HAVE_RAW_H=yes
+HAVE_NCURSES=yes
+CURSESFLAGS=-DNCH=1
+LIBCURSES=-lncurses
+HAVE_TERMCAP=no
+NEED_LIBCRYPT=yes
+FOREIGN = --foreign-user
+HAVE_XGETTEXT=yes
+HAVE_OPENPTY=yes
+HAVE_PIVOT_ROOT=yes
+HAVE_GOOD_RPC=yes
+HAVE_ZLIB=yes
diff --git a/recipes/util-linux/files/mtx-1/make_include b/recipes/util-linux/files/mtx-1/make_include
new file mode 100644
index 0000000000..a2713298f6
--- /dev/null
+++ b/recipes/util-linux/files/mtx-1/make_include
@@ -0,0 +1,16 @@
+VERSION=2.12
+CC=gcc
+CFLAGS=
+LDFLAGS=
+HAVE_OLD_GCC=yes
+HAVE_RAW_H=yes
+HAVE_NCURSES=yes
+CURSESFLAGS=-DNCH=1
+LIBCURSES=-lncurses
+HAVE_TERMCAP=no
+NEED_LIBCRYPT=yes
+FOREIGN = --foreign-user
+HAVE_XGETTEXT=yes
+HAVE_OPENPTY=yes
+HAVE_GOOD_RPC=yes
+HAVE_ZLIB=yes
diff --git a/recipes/util-linux/files/mtx-2/make_include b/recipes/util-linux/files/mtx-2/make_include
new file mode 100644
index 0000000000..a2713298f6
--- /dev/null
+++ b/recipes/util-linux/files/mtx-2/make_include
@@ -0,0 +1,16 @@
+VERSION=2.12
+CC=gcc
+CFLAGS=
+LDFLAGS=
+HAVE_OLD_GCC=yes
+HAVE_RAW_H=yes
+HAVE_NCURSES=yes
+CURSESFLAGS=-DNCH=1
+LIBCURSES=-lncurses
+HAVE_TERMCAP=no
+NEED_LIBCRYPT=yes
+FOREIGN = --foreign-user
+HAVE_XGETTEXT=yes
+HAVE_OPENPTY=yes
+HAVE_GOOD_RPC=yes
+HAVE_ZLIB=yes
diff --git a/recipes/util-linux/files/swapargs.h b/recipes/util-linux/files/swapargs.h
new file mode 100644
index 0000000000..52fd10411b
--- /dev/null
+++ b/recipes/util-linux/files/swapargs.h
@@ -0,0 +1,2 @@
+#define SWAPON_HAS_TWO_ARGS
+#include <sys/swap.h>
diff --git a/recipes/util-linux/files/umount.diff b/recipes/util-linux/files/umount.diff
new file mode 100644
index 0000000000..78330789ef
--- /dev/null
+++ b/recipes/util-linux/files/umount.diff
@@ -0,0 +1,19 @@
+*** util-linux-2.12r/mount/umount.c.orig 2005-09-10 20:07:38.000000000 +0200
+--- util-linux-2.12r/mount/umount.c 2006-06-07 21:14:04.000000000 +0200
+***************
+*** 40,46 ****
+ #include <linux/unistd.h>
+ #ifdef __NR_umount2
+
+! static int umount2(const char *path, int flags);
+
+ _syscall2(int, umount2, const char *, path, int, flags);
+
+--- 40,46 ----
+ #include <linux/unistd.h>
+ #ifdef __NR_umount2
+
+! int umount2(const char *path, int flags);
+
+ _syscall2(int, umount2, const char *, path, int, flags);
+
diff --git a/recipes/util-linux/files/util-linux-2.12r-cramfs-1.patch b/recipes/util-linux/files/util-linux-2.12r-cramfs-1.patch
new file mode 100644
index 0000000000..1771bdc528
--- /dev/null
+++ b/recipes/util-linux/files/util-linux-2.12r-cramfs-1.patch
@@ -0,0 +1,87 @@
+Submitted by: Jeremy Utley <jeremy@linuxfromscratch.org>
+Date: 2004-12-25
+Initial Package Version: 2.12p (should apply to versions back to at least k)
+Upstream Status: Not Submitted - Test Version
+Origin: Alexander Patrakov, adapted from debian build of cramfs utilities
+Description: Util-Linux fails in cramfs compilation due to changes in the
+linux-libc-headers package 2.6.9 and after. This patch is a proper fix to the
+problem, but may in fact not be accepted upstream.
+
+
+Index: util-linux-2.12r/disk-utils/fsck.cramfs.c
+===================================================================
+--- util-linux-2.12r.orig/disk-utils/fsck.cramfs.c 2008-05-16 00:34:36.000000000 -0700
++++ util-linux-2.12r/disk-utils/fsck.cramfs.c 2008-05-16 09:39:50.000000000 -0700
+@@ -76,8 +76,7 @@
+
+ #define PAD_SIZE 512
+
+-#include <asm/page.h>
+-#define PAGE_CACHE_SIZE (4096)
++#define PAGE_CACHE_SIZE page_size
+
+ /* Guarantee access to at least 8kB at a time */
+ #define ROMBUFFER_BITS 13
+@@ -87,11 +86,13 @@
+ static unsigned long read_buffer_block = ~0UL;
+
+ /* Uncompressing data structures... */
+-static char outbuffer[PAGE_CACHE_SIZE*2];
++static char *outbuffer;
+ z_stream stream;
+
+ #endif /* INCLUDE_FS_TESTS */
+
++static size_t page_size;
++
+ /* Input status of 0 to print help and exit without an error. */
+ static void usage(int status)
+ {
+@@ -456,9 +457,17 @@
+ int c; /* for getopt */
+ int start = 0;
+
++ page_size = sysconf(_SC_PAGESIZE);
++
+ if (argc)
+ progname = argv[0];
+
++ outbuffer = malloc(page_size * 2);
++ if (!outbuffer) {
++ fprintf(stderr, _("failed to allocate outbuffer\n"));
++ exit(8);
++ }
++
+ /* command line options */
+ while ((c = getopt(argc, argv, "hx:v")) != EOF) {
+ switch (c) {
+Index: util-linux-2.12r/disk-utils/mkfs.cramfs.c
+===================================================================
+--- util-linux-2.12r.orig/disk-utils/mkfs.cramfs.c 2004-12-11 06:56:01.000000000 -0800
++++ util-linux-2.12r/disk-utils/mkfs.cramfs.c 2008-05-16 09:38:06.000000000 -0700
+@@ -46,16 +46,8 @@
+ static const char *progname = "mkcramfs";
+ static int verbose = 0;
+
+-#ifdef __ia64__
+-#define PAGE_CACHE_SIZE (16384)
+-#elif defined __alpha__
+-#define PAGE_CACHE_SIZE (8192)
+-#else
+-#define PAGE_CACHE_SIZE (4096)
+-#endif
+-
+ /* The kernel assumes PAGE_CACHE_SIZE as block size. */
+-static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */
++static unsigned int blksize; /* settable via -b option */
+ static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
+ static int image_length = 0;
+
+@@ -730,6 +722,7 @@
+ u32 crc = crc32(0L, Z_NULL, 0);
+ int c;
+
++ blksize = sysconf(_SC_PAGESIZE);
+ total_blocks = 0;
+
+ if (argc) {
diff --git a/recipes/util-linux/files/util-linux_2.12r-12.diff.gz b/recipes/util-linux/files/util-linux_2.12r-12.diff.gz
new file mode 100644
index 0000000000..a00cedeb15
--- /dev/null
+++ b/recipes/util-linux/files/util-linux_2.12r-12.diff.gz
Binary files differ
diff --git a/recipes/util-linux/util-linux-2.12/ioctl.diff b/recipes/util-linux/util-linux-2.12/ioctl.diff
new file mode 100644
index 0000000000..06cf9c02d9
--- /dev/null
+++ b/recipes/util-linux/util-linux-2.12/ioctl.diff
@@ -0,0 +1,52 @@
+diff -Naur util-linux-2.12/disk-utils/blockdev.c util-linux-2.12-ok/disk-utils/blockdev.c
+--- util-linux-2.12/disk-utils/blockdev.c 2002-03-08 23:57:02.000000000 +0100
++++ util-linux-2.12-ok/disk-utils/blockdev.c 2004-11-09 14:21:13.000000000 +0100
+@@ -24,8 +24,8 @@
+ #define BLKRASET _IO(0x12,98)
+ #define BLKRAGET _IO(0x12,99)
+ #define BLKSSZGET _IO(0x12,104)
+-#define BLKBSZGET _IOR(0x12,112,sizeof(int))
+-#define BLKBSZSET _IOW(0x12,113,sizeof(int))
++#define BLKBSZGET _IOR(0x12,112,int)
++#define BLKBSZSET _IOW(0x12,113,int)
+ #endif
+
+ /* Maybe <linux/hdreg.h> could be included */
+diff -Naur util-linux-2.12/disk-utils/elvtune.c util-linux-2.12-ok/disk-utils/elvtune.c
+--- util-linux-2.12/disk-utils/elvtune.c 2002-03-08 23:57:49.000000000 +0100
++++ util-linux-2.12-ok/disk-utils/elvtune.c 2004-11-09 14:21:44.000000000 +0100
+@@ -37,8 +37,8 @@
+ int max_bomb_segments;
+ } blkelv_ioctl_arg_t;
+
+-#define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
+-#define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
++#define BLKELVGET _IOR(0x12,106,blkelv_ioctl_arg_t)
++#define BLKELVSET _IOW(0x12,107,blkelv_ioctl_arg_t)
+
+ static void
+ usage(void) {
+diff -Naur util-linux-2.12/fdisk/common.h util-linux-2.12-ok/fdisk/common.h
+--- util-linux-2.12/fdisk/common.h 2003-07-13 15:59:53.000000000 +0200
++++ util-linux-2.12-ok/fdisk/common.h 2004-11-09 14:37:41.000000000 +0100
+@@ -6,7 +6,7 @@
+ #define BLKGETSIZE _IO(0x12,96) /* return device size */
+ #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
+ #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
+-#define BLKGETSIZE64 _IOR(0x12,114,8) /* 8 = sizeof(u64) */
++#define BLKGETSIZE64 _IOR(0x12,114,unsigned long long)/* 8 = sizeof(u64) */
+
+ /* including <linux/hdreg.h> also fails */
+ struct hd_geometry {
+diff -Naur util-linux-2.12/partx/gpt.c util-linux-2.12-ok/partx/gpt.c
+--- util-linux-2.12/partx/gpt.c 2002-08-04 02:20:16.000000000 +0200
++++ util-linux-2.12-ok/partx/gpt.c 2004-11-09 14:23:18.000000000 +0100
+@@ -41,7 +41,7 @@
+ #define BLKGETLASTSECT _IO(0x12,108) /* get last sector of block device */
+ #define BLKGETSIZE _IO(0x12,96) /* return device size */
+ #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
+-#define BLKGETSIZE64 _IOR(0x12,114,sizeof(uint64_t)) /* return device size in bytes (u64 *arg) */
++#define BLKGETSIZE64 _IOR(0x12,114,uint64_t) /* return device size in bytes (u64 *arg) */
+
+ struct blkdev_ioctl_param {
+ unsigned int block;
diff --git a/recipes/util-linux/util-linux-2.12/my_dev_t.h.diff b/recipes/util-linux/util-linux-2.12/my_dev_t.h.diff
new file mode 100644
index 0000000000..ebb7033fa8
--- /dev/null
+++ b/recipes/util-linux/util-linux-2.12/my_dev_t.h.diff
@@ -0,0 +1,8 @@
+--- util-linux-2.12.orig/mount/my_dev_t.h
++++ util-linux-2.12/mount/my_dev_t.h
+@@ -4,4 +4,4 @@
+ /* for ancient systems use "unsigned short" */
+
+ #include <linux/posix_types.h>
+-#define my_dev_t __kernel_dev_t
++#define my_dev_t __kernel_old_dev_t
diff --git a/recipes/util-linux/util-linux-native_2.12r.bb b/recipes/util-linux/util-linux-native_2.12r.bb
new file mode 100644
index 0000000000..27c053000d
--- /dev/null
+++ b/recipes/util-linux/util-linux-native_2.12r.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
+SECTION = "base"
+LICENSE = "GPL"
+DEPENDS = "zlib-native ncurses-native"
+
+inherit autotools native
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux/util-linux-${PV}.tar.bz2 \
+ file://gcc34.patch;patch=1 \
+ file://MCONFIG \
+ file://make_include \
+ file://swapargs.h \
+ file://fdiskbsdlabel_thumb.diff;patch=1 \
+ file://defines.h"
+
+S="${WORKDIR}/util-linux-${PV}"
+
+EXTRA_OEMAKE="'OPT=${BUILD_CFLAGS}' 'CC=${BUILD_CC}' 'LD=${BUILD_LD}' 'LDFLAGS=${BUILD_LDFLAGS}' SBINDIR=${base_sbindir} USRSBINDIR=${base_sbindir} LOGDIR=${localstatedir}/log VARPATH=${localstatedir} LOCALEDIR=${datadir}/locale"
+
+do_compile () {
+ set -e
+ install ${WORKDIR}/MCONFIG ${S}/MCONFIG
+ install ${WORKDIR}/make_include ${S}/make_include
+ install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
+ install ${WORKDIR}/defines.h ${S}/defines.h
+ oe_runmake
+}
+
+do_stage () {
+ autotools_stage_all
+}
+
diff --git a/recipes/util-linux/util-linux.inc b/recipes/util-linux/util-linux.inc
new file mode 100644
index 0000000000..2b527678c4
--- /dev/null
+++ b/recipes/util-linux/util-linux.inc
@@ -0,0 +1,195 @@
+DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
+SECTION = "base"
+LICENSE = "GPL"
+DEPENDS = "zlib ncurses"
+
+inherit autotools
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux/util-linux-${PV}.tar.bz2 \
+ file://gcc34.patch;patch=1 \
+ file://MCONFIG \
+ file://make_include \
+ file://swapargs.h \
+ file://fdiskbsdlabel_thumb.diff;patch=1 \
+ file://umount.diff;patch=1 \
+ file://defines.h"
+
+PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-swaponoff util-linux-losetup util-linux-umount util-linux-mount util-linux-readprofile "
+
+FILES_${PN}-doc += "/usr/share/misc/getopt/getopt-*.*"
+
+FILES_util-linux-fdisk = "/sbin/fdisk.${PN}"
+FILES_util-linux-cfdisk = "/sbin/cfdisk"
+FILES_util-linux-sfdisk = "/sbin/sfdisk"
+FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}"
+FILES_util-linux-losetup = "/sbin/losetup.${PN}"
+FILES_util-linux-mount = "/bin/mount.${PN} ${sysconfdir}/default/mountall"
+FILES_util-linux-umount = "/bin/umount.${PN}"
+FILES_util-linux-readprofile = "/usr/sbin/readprofile"
+
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile "
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup"
+
+do_compile () {
+ set -e
+ install ${WORKDIR}/MCONFIG ${S}/MCONFIG
+ install ${WORKDIR}/make_include ${S}/make_include
+ install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
+ install ${WORKDIR}/defines.h ${S}/defines.h
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}'
+}
+
+checklink() {
+ local targ link value
+ targ="$1"
+ link="$2"
+ ext="$3"
+ if test -h "$link"
+ then
+ value="$(readlink "$link")"
+ if test "$value" = "$targ"
+ then
+ rm "$link"
+ ln -s "$targ"."${PN}" "$link$ext"
+ return 0
+ else
+ echo "$link: '$value' found '$targ' expected" >&2
+ return 1
+ fi
+ else
+ echo "$link: not a symbolic link" >&2
+ return 1
+ fi
+}
+
+do_install () {
+ # with ccache the timestamps on compiled files may
+ # end up earlier than on their inputs, this allows
+ # for the resultant compilation in the install step.
+ oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+ 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+ 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+ test -f ${D}${base_sbindir}/pivot_root && \
+ mv ${D}${base_sbindir}/pivot_root ${D}${base_sbindir}/pivot_root.${PN}
+ mv ${D}${base_bindir}/dmesg ${D}${base_bindir}/dmesg.${PN}
+ mv ${D}${base_bindir}/kill ${D}${base_bindir}/kill.${PN}
+ mv ${D}${base_bindir}/more ${D}${base_bindir}/more.${PN}
+ mv ${D}${base_sbindir}/hwclock ${D}${base_sbindir}/hwclock.${PN}
+ mv ${D}${base_sbindir}/mkswap ${D}${base_sbindir}/mkswap.${PN}
+ mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
+ mv ${D}${base_sbindir}/sln ${D}${base_sbindir}/sln.${PN}
+ mv ${D}${base_sbindir}/mkfs.minix ${D}${base_sbindir}/mkfs.minix.${PN}
+ mv ${D}${base_sbindir}/fsck.minix ${D}${base_sbindir}/fsck.minix.${PN}
+ mv ${D}${bindir}/hexdump ${D}${bindir}/hexdump.${PN}
+ mv ${D}${bindir}/last ${D}${bindir}/last.${PN}
+ mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN}
+ mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN}
+ mv ${D}${bindir}/renice ${D}${bindir}/renice.${PN}
+ mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN}
+
+ mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN}
+ mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN}
+ mv ${D}${base_bindir}/umount ${D}${base_bindir}/umount.${PN}
+ mv ${D}${base_bindir}/mount ${D}${base_bindir}/mount.${PN}
+ mv ${D}${base_sbindir}/fdisk ${D}${base_sbindir}/fdisk.${PN}
+ install -d ${D}${sysconfdir}/default/
+ echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
+
+ checklink swapon ${D}${base_sbindir}/swapoff ".${PN}"
+ checklink shutdown ${D}${base_sbindir}/reboot ".${PN}"
+ checklink shutdown ${D}${base_sbindir}/halt ".${PN}"
+ checklink shutdown ${D}${base_sbindir}/fastboot ""
+ checklink shutdown ${D}${base_sbindir}/fasthalt ""
+}
+
+pkg_postinst_${PN} () {
+ update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
+ update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
+ update-alternatives --install ${base_bindir}/more more more.${PN} 100
+ update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
+ test -x ${base_sbindir}/pivot_root.${PN} && \
+ update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
+ update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
+ update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100
+ update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100
+ update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
+ update-alternatives --install ${bindir}/last last last.${PN} 100
+ update-alternatives --install ${bindir}/logger logger logger.${PN} 100
+ update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
+ update-alternatives --install ${bindir}/renice renice renice.${PN} 100
+ update-alternatives --install ${bindir}/wall wall wall.${PN} 100
+
+ # There seems to be problem, atleast on nslu2, with these, untill they are
+ # fixed the busybox ones have higher priority
+ update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10
+ update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
+ update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
+ update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
+}
+
+pkg_prerm_${PN} () {
+ test -x ${base_sbindir}/pivot_root.${PN} && \
+ update-alternatives --remove pivot_root pivot_root.${PN}
+ update-alternatives --remove dmesg dmesg.${PN}
+ update-alternatives --remove kill kill.${PN}
+ update-alternatives --remove more more.${PN}
+ update-alternatives --remove halt halt.${PN}
+ update-alternatives --remove hwclock hwclock.${PN}
+ update-alternatives --remove mkswap mkswap.${PN}
+ update-alternatives --remove reboot reboot.${PN}
+ update-alternatives --remove shutdown shutdown.${PN}
+ update-alternatives --remove sln sln.${PN}
+ update-alternatives --remove mkfs.minix mkfs.minix.${PN}
+ update-alternatives --remove fsck.minix fsck.minix.${PN}
+ update-alternatives --remove hexdump hexdump.${PN}
+ update-alternatives --remove last last.${PN}
+ update-alternatives --remove logger logger.${PN}
+ update-alternatives --remove mesg mesg.${PN}
+ update-alternatives --remove renice renice.${PN}
+ update-alternatives --remove wall wall.${PN}
+}
+
+pkg_postinst_util-linux-fdisk () {
+ update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100
+}
+
+pkg_prerm_util-linux-fdisk () {
+ update-alternatives --remove fdisk fdisk.${PN}
+}
+
+pkg_postinst_util-linux-mount () {
+ update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100
+}
+
+pkg_prerm_util-linux-mount () {
+ update-alternatives --remove mount mount.${PN}
+}
+
+pkg_postinst_util-linux-umount () {
+ update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100
+}
+
+pkg_prerm_util-linux-umount () {
+ update-alternatives --remove umount umount.${PN}
+}
+
+pkg_postinst_util-linux-losetup () {
+ update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100
+}
+
+pkg_prerm_util-linux-losetup () {
+ update-alternatives --remove losetup losetup.${PN}
+}
+
+pkg_postinst_util-linux-swaponoff () {
+ update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
+ update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
+}
+
+pkg_prerm_util-linux-swaponoff () {
+ update-alternatives --remove swapoff swapoff.${PN}
+ update-alternatives --remove swapon swapon.${PN}
+}
diff --git a/recipes/util-linux/util-linux_2.12.bb b/recipes/util-linux/util-linux_2.12.bb
new file mode 100644
index 0000000000..5787e655ba
--- /dev/null
+++ b/recipes/util-linux/util-linux_2.12.bb
@@ -0,0 +1,11 @@
+PR = "r5"
+
+require util-linux.inc
+
+SRC_URI = "http://ftp.cwi.nl/aeb/util-linux/util-linux-${PV}.tar.gz \
+ file://MCONFIG \
+ file://make_include \
+ file://swapargs.h \
+ file://defines.h \
+ file://my_dev_t.h.diff;patch=1 \
+ file://ioctl.diff;patch=1;pnum=1"
diff --git a/recipes/util-linux/util-linux_2.12o.bb b/recipes/util-linux/util-linux_2.12o.bb
new file mode 100644
index 0000000000..bb874d9573
--- /dev/null
+++ b/recipes/util-linux/util-linux_2.12o.bb
@@ -0,0 +1,3 @@
+require util-linux.inc
+
+PR = "r8"
diff --git a/recipes/util-linux/util-linux_2.12q.bb b/recipes/util-linux/util-linux_2.12q.bb
new file mode 100644
index 0000000000..5313ee838f
--- /dev/null
+++ b/recipes/util-linux/util-linux_2.12q.bb
@@ -0,0 +1,7 @@
+# fdisk gets a #error unknown architecture when compiling for ARM thumb
+#FIXME: remove this
+ARM_INSTRUCTION_SET = "arm"
+
+require util-linux.inc
+
+PR = "r7"
diff --git a/recipes/util-linux/util-linux_2.12r.bb b/recipes/util-linux/util-linux_2.12r.bb
new file mode 100644
index 0000000000..0498253a8d
--- /dev/null
+++ b/recipes/util-linux/util-linux_2.12r.bb
@@ -0,0 +1,9 @@
+require util-linux.inc
+
+SRC_URI += "file://util-linux_2.12r-12.diff.gz;patch=1"
+SRC_URI += "file://glibc-fix.patch;patch=1"
+SRC_URI += "file://glibc-umount2.patch;patch=1"
+SRC_URI += "file://fdiskbsdlabel-avr32.patch;patch=1"
+SRC_URI += "file://util-linux-2.12r-cramfs-1.patch;patch=1"
+
+PR = "r15"