summaryrefslogtreecommitdiffstats
path: root/meta/packages/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'meta/packages/util-linux')
-rw-r--r--meta/packages/util-linux/files/MCONFIG223
-rw-r--r--meta/packages/util-linux/files/debian-bug392236.patch203
-rw-r--r--meta/packages/util-linux/files/defines.h10
-rw-r--r--meta/packages/util-linux/files/fdiskbsdlabel_thumb.diff12
-rw-r--r--meta/packages/util-linux/files/gcc34.patch23
-rw-r--r--meta/packages/util-linux/files/glibc-fix.patch22
-rw-r--r--meta/packages/util-linux/files/make_include17
-rw-r--r--meta/packages/util-linux/files/swapargs.h3
-rw-r--r--meta/packages/util-linux/files/umount.diff19
-rw-r--r--meta/packages/util-linux/files/util-linux_2.12r-12.diff.gzbin0 -> 100566 bytes
-rw-r--r--meta/packages/util-linux/util-linux-native_2.12r.bb32
-rw-r--r--meta/packages/util-linux/util-linux.inc193
-rw-r--r--meta/packages/util-linux/util-linux_2.12r.bb7
13 files changed, 764 insertions, 0 deletions
diff --git a/meta/packages/util-linux/files/MCONFIG b/meta/packages/util-linux/files/MCONFIG
new file mode 100644
index 0000000000..3fea2c02d7
--- /dev/null
+++ b/meta/packages/util-linux/files/MCONFIG
@@ -0,0 +1,223 @@
1# MCONFIG -- Configuration stuff for util-linux
2# Created: Sat Feb 4 15:50:30 1995
3# Copyright 1995 Rickard E. Faith (faith@cs.unc.edu)
4
5# For a user-mode install, make (at least) three changes:
6# - remove the `-o root' part in INSTALLSUID
7# - set USE_TTY_GROUP=no
8# - define DESTDIR
9
10# Select for ARCH one of intel, alpha, sparc, arm, m68k, mips
11# Select for CPU i386 if the binaries must be able to run on an intel 386
12# (by default i486 code is generated, see below)
13CPU=$(shell uname -m)
14ARCH=$(shell echo $(CPU) | sed 's/i.86/intel/;s/arm.*/arm/')
15
16# If HAVE_PAM is set to "yes", then login, chfn, chsh, and newgrp
17# will use PAM for authentication. Additionally, passwd will not be
18# installed as it is not PAM aware.
19HAVE_PAM=no
20
21# If HAVE_SHADOW is set to "yes", then login, chfn, chsh, newgrp, passwd,
22# and vipw will not be built or installed from the login-utils
23# subdirectory.
24HAVE_SHADOW=yes
25
26# If HAVE_PASSWD is set to "yes", then passwd will not be built or
27# installed from the login-utils subdirectory (but login, chfn, chsh,
28# newgrp, and vipw *will* be installed).
29HAVE_PASSWD=no
30
31# If you use chfn and chsh from this package, REQUIRE_PASSWORD will require
32# non-root users to enter the account password before updating /etc/passwd.
33REQUIRE_PASSWORD=yes
34#REQUIRE_PASSWORD=no
35
36# If you use chsh from this package, ONLY_LISTED_SHELLS will require that
37# the selected shell be listed in /etc/shells -- otherwise only a warning is
38# printed. This prevents someone from setting their shell to /bin/false.
39ONLY_LISTED_SHELLS=yes
40#ONLY_LISTED_SHELLS=no
41
42
43# If HAVE_SYSVINIT is set to "yes", then simpleinit and shutdown will not
44# be built or installed from the login-utils subdirectory. (The shutdown
45# and halt that come with the SysVinit package should be used with the init
46# found in that package.)
47HAVE_SYSVINIT=no
48
49# If HAVE_SYSVINIT_UTILS is set to "yes", then last, mesg, and wall will
50# not be built or installed from the login-utils subdirectory. (The
51# shutdown and init from the SysVinit package do not depend on the last,
52# mesg, and wall from that package.)
53HAVE_SYSVINIT_UTILS=no
54
55# If HAVE_WRITE is set to "yes", then write will not be built or
56# installed from the misc-utils subdirectory.
57# (There is a network aware write in netwrite from NetKit 0.16 or later.)
58HAVE_WRITE=no
59
60# If HAVE_GETTY is set to "yes", then agetty will not be built or
61# installed from the login-utils subdirectory. Note that agetty can
62# co-exist with other gettys, so this option should never be used.
63HAVE_GETTY=no
64
65# If USE_TTY_GROUP is set to "yes", then wall and write will be installed
66# setgid to the "tty" group, and mesg will only set the group write bit.
67# Note that this is only useful if login/xterm/etc. change the group of the
68# user's tty to "tty" [The login in util-linux does this correctly, and
69# xterm will do it correctly if X is compiled with USE_TTY_GROUP set
70# properly.]
71USE_TTY_GROUP=no
72
73# If HAVE_KILL is set to "yes", then kill will not be built or
74# installed from the misc-utils subdirectory.
75# (There is also a kill in the procps package.)
76HAVE_KILL=no
77
78# If ALLOW_VCS_USE is set to "yes", then login will chown /dev/vcsN
79# to the current user, allowing her to make a screendump and do other
80# nifty things on the console, but also allowing him to keep an open
81# file descriptor after logging out to trick the next user.
82ALLOW_VCS_USE=yes
83
84# If HAVE_RESET is set to "yes", then reset won't be installed. The version
85# of reset that comes with the ncurses package is less aggressive.
86HAVE_RESET=yes
87
88# If HAVE_SLN is set to "yes", then sln won't be installed
89# (but the man page sln.8 will be installed anyway).
90# sln also comes with libc and glibc.
91HAVE_SLN=no
92
93# If HAVE_FDUTILS is set to "yes", then setfdprm won't be installed.
94HAVE_FDUTILS=no
95
96# If SILENT_PG is set to "yes", then pg will not ring the bell
97# when an invalid key is pressed
98SILENT_PG=no
99
100# If configure decides that Native Language Support (NLS) is available,
101# it sets MAY_ENABLE_NLS in defines.h. If you don't want NLS, set
102# DISABLE_NLS to "yes".
103DISABLE_NLS=no
104
105# Different optimizations for different cpus.
106# gcc 3.0 likes options -mcpu=i486 instead of -m486
107ifeq "$(ARCH)" "intel"
108 ifeq "$(HAVE_OLD_GCC)" "yes"
109 CPUHEAD=-m
110 else
111 CPUHEAD=-mcpu=i
112 endif
113 ifeq "$(CPU)" "i386"
114 CPUTAIL=386
115 else
116 CPUTAIL=486
117 endif
118 CPUOPT= $(CPUHEAD)$(CPUTAIL)
119 OPT= -pipe -O2 $(CPUOPT) -fomit-frame-pointer
120else
121 ifeq "$(ARCH)" "arm"
122 OPT= -pipe -O2 -fsigned-char -fomit-frame-pointer
123 else
124 OPT= -O2 -fomit-frame-pointer
125 endif
126endif
127
128WARNFLAGS = -Wall -Wmissing-prototypes -Wstrict-prototypes
129
130LIB=../lib
131
132ERR_O=$(LIB)/err.o
133
134# Set HAVE_SLANG to yes if you have slang (and prefer to use that for cfdisk)
135# (If neither HAVE_NCURSES nor HAVE_SLANG is defined, cfdisk is not made.)
136# HAVE_SLANG=yes
137# There is a subdirectory /usr/include/slang containing slcurses.h
138# SLANGFLAGS=-I/usr/include/slang
139# No such subdirectory - slcurses.h lives in /usr/include
140# (no extra definition required).
141LIBSLANG=-lslang
142
143#
144# Paths used for compilation (not all are actually used, see CFLAGS below)
145#
146DEV_DIR= /dev
147ETC_DIR= /etc
148SBIN_DIR= /sbin
149USRSBIN_DIR= /usr/sbin
150USRLIB_DIR= /usr/lib
151USRBIN_DIR= /usr/bin
152USRGAMES_DIR= /usr/games
153USRSHAREMISC_DIR=/usr/share/misc
154LOCALE_DIR= /usr/share/locale
155BIN_DIR= /bin
156VAR_PATH= /var
157LOG_DIR= /var/log
158MAN_DIR= /usr/share/man
159INFO_DIR= /usr/share/info
160
161#
162# Paths used for install
163#
164DEVDIR= $(DESTDIR)$(DEV_DIR)
165ETCDIR= $(DESTDIR)$(ETC_DIR)
166SBINDIR= $(DESTDIR)$(SBIN_DIR)
167USRSBINDIR= $(DESTDIR)$(USRSBIN_DIR)
168USRLIBDIR= $(DESTDIR)$(USRLIB_DIR)
169USRBINDIR= $(DESTDIR)$(USRBIN_DIR)
170USRGAMESDIR= $(DESTDIR)$(USRGAMES_DIR)
171USRSHAREMISCDIR=$(DESTDIR)$(USRSHAREMISC_DIR)
172LOCALEDIR= $(DESTDIR)$(LOCALE_DIR)
173BINDIR= $(DESTDIR)$(BIN_DIR)
174VARPATH= $(DESTDIR)$(VAR_PATH)
175LOGDIR= $(DESTDIR)$(LOG_DIR)
176MANDIR= $(DESTDIR)$(MAN_DIR)
177MAN1DIR= $(MANDIR)/man1
178MAN3DIR= $(MANDIR)/man3
179MAN5DIR= $(MANDIR)/man5
180MAN6DIR= $(MANDIR)/man6
181MAN8DIR= $(MANDIR)/man8
182INFODIR= $(DESTDIR)$(INFO_DIR)
183
184# Directory for shutdown, halt, reboot, etc.
185SHUTDOWNDIR= $(SBINDIR)
186
187# Modes
188DIRMODE= 755
189BINMODE= 755
190MANMODE= 644
191DATMODE= 644
192INFOMODE= 644
193SUIDMODE= 4755
194
195CHMOD= chmod
196INSTALL= install
197INSTALLDIR= $(INSTALL) -d -m $(DIRMODE)
198INSTALLBIN= $(INSTALL) -m $(BINMODE)
199INSTALLMAN= $(INSTALL) -m $(MANMODE)
200INSTALLDAT= $(INSTALL) -m $(DATMODE)
201INSTALLSUID= $(INSTALL) -m $(SUIDMODE)
202
203ifeq "$(DISABLE_NLS)" "yes"
204NLSFLAGS = -DDISABLE_NLS
205endif
206
207CFLAGS := $(OPT) -I$(LIB) $(WARNFLAGS) \
208 $(CURSESFLAGS) $(SLANGFLAGS) $(NLSFLAGS) \
209 -D_FILE_OFFSET_BITS=64 \
210 -DSBINDIR=\"$(SBIN_DIR)\" \
211 -DUSRSBINDIR=\"$(USRSBIN_DIR)\" \
212 -DLOGDIR=\"$(LOG_DIR)\" \
213 -DVARPATH=\"$(VAR_PATH)\" \
214 -DLOCALEDIR=\"$(LOCALE_DIR)\" \
215 $(CFLAGS)
216
217
218%.o: %.c
219 $(CC) -c $(CFLAGS) $< -o $@
220
221%: %.cc
222 $(CXX) $(CFLAGS) $< -o $@
223
diff --git a/meta/packages/util-linux/files/debian-bug392236.patch b/meta/packages/util-linux/files/debian-bug392236.patch
new file mode 100644
index 0000000000..fcd2046e34
--- /dev/null
+++ b/meta/packages/util-linux/files/debian-bug392236.patch
@@ -0,0 +1,203 @@
1Index: util-linux-2.12r/fdisk/llseek.c
2===================================================================
3--- util-linux-2.12r.orig/fdisk/llseek.c 2003-07-13 23:13:33.000000000 +0200
4+++ util-linux-2.12r/fdisk/llseek.c 2007-04-04 19:01:14.000000000 +0200
5@@ -14,30 +14,23 @@
6
7 #ifdef __linux__
8
9-#ifdef HAVE_LLSEEK
10-#include <syscall.h>
11-
12-#else /* HAVE_LLSEEK */
13+#include <sys/syscall.h>
14+#ifndef HAVE_LLSEEK
15
16 #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
17
18 #define my_llseek lseek
19
20 #else
21-#include <linux/unistd.h> /* for __NR__llseek */
22-
23-static int _llseek (unsigned int, unsigned long,
24- unsigned long, long long *, unsigned int);
25
26-#ifdef __NR__llseek
27+#ifdef SYS__llseek
28
29-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
30- unsigned long, offset_low,long long *,result,
31- unsigned int, origin)
32+#define _llseek(fd, offset_high, offset_low, result, origin) \
33+ syscall(SYS__llseek, fd, offset_high, offset_low, result, origin)
34
35 #else
36
37-/* no __NR__llseek on compilation machine - might give it explicitly */
38+/* no SYS__llseek on compilation machine - might give it explicitly */
39 static int _llseek (unsigned int fd, unsigned long oh,
40 unsigned long ol, long long *result,
41 unsigned int origin) {
42Index: util-linux-2.12r/fdisk/sfdisk.c
43===================================================================
44--- util-linux-2.12r.orig/fdisk/sfdisk.c 2005-01-04 23:31:57.000000000 +0100
45+++ util-linux-2.12r/fdisk/sfdisk.c 2007-04-04 19:01:14.000000000 +0200
46@@ -48,7 +48,7 @@
47 #include <sys/ioctl.h>
48 #include <sys/stat.h>
49 #include <sys/utsname.h>
50-#include <linux/unistd.h> /* _syscall */
51+#include <sys/syscall.h>
52 #include "nls.h"
53 #include "common.h"
54
55@@ -177,9 +177,8 @@
56 #endif
57
58 #ifndef use_lseek
59-static __attribute__used
60-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo,
61- loff_t *, res, unsigned int, wh);
62+#define _llseek(fd, hi, lo, res, wh) \
63+ syscall(SYS__llseek, fd, hi, lo, res, wh)
64 #endif
65
66 static int
67Index: util-linux-2.12r/lib/my_reboot.c
68===================================================================
69--- util-linux-2.12r.orig/lib/my_reboot.c 1999-07-09 04:56:36.000000000 +0200
70+++ util-linux-2.12r/lib/my_reboot.c 2007-04-04 19:01:14.000000000 +0200
71@@ -23,10 +23,11 @@
72 #else /* no USE_LIBC */
73
74 /* direct syscall version */
75-#include <linux/unistd.h>
76+#include <sys/syscall.h>
77
78-#ifdef _syscall3
79-_syscall3(int, reboot, int, magic, int, magic_too, int, cmd);
80+#ifdef SYS_reboot
81+#define reboot(magic, magic2, cmd) \
82+ syscall(SYS_reboot, magic, magic2, cmd)
83 #else
84 /* Let us hope we have a 3-argument reboot here */
85 extern int reboot(int, int, int);
86Index: util-linux-2.12r/misc-utils/setterm.c
87===================================================================
88--- util-linux-2.12r.orig/misc-utils/setterm.c 2003-10-17 18:17:51.000000000 +0200
89+++ util-linux-2.12r/misc-utils/setterm.c 2007-04-04 19:01:14.000000000 +0200
90@@ -119,14 +119,13 @@
91
92 #if __GNU_LIBRARY__ < 5
93 #ifndef __alpha__
94-# include <linux/unistd.h>
95-#define __NR_klogctl __NR_syslog
96-_syscall3(int, klogctl, int, type, char*, buf, int, len);
97+# include <sys/syscall.h>
98+#define klogctl(type, buf, len) \
99+ syscall(SYS_syslog, type, buf, len)
100 #else /* __alpha__ */
101 #define klogctl syslog
102 #endif
103 #endif
104-extern int klogctl(int type, char *buf, int len);
105
106 /* Constants. */
107
108Index: util-linux-2.12r/mount/swapon.c
109===================================================================
110--- util-linux-2.12r.orig/mount/swapon.c 2004-12-22 10:50:19.000000000 +0100
111+++ util-linux-2.12r/mount/swapon.c 2007-04-04 19:01:14.000000000 +0200
112@@ -82,11 +82,11 @@
113 #else
114 /* We want a swapon with two args, but have an old libc.
115 Build the kernel call by hand. */
116-#include <linux/unistd.h>
117-static
118-_syscall2(int, swapon, const char *, path, int, flags);
119-static
120-_syscall1(int, swapoff, const char *, path);
121+#include <sys/syscall.h>
122+#define swapon(path, flags) \
123+ syscall(SYS_swapon, path, flags)
124+#define swapoff(path) \
125+ syscall(SYS_swapoff, path)
126 #endif
127 #else
128 /* just do as libc says */
129Index: util-linux-2.12r/mount/umount.c
130===================================================================
131--- util-linux-2.12r.orig/mount/umount.c 2007-04-04 19:01:14.000000000 +0200
132+++ util-linux-2.12r/mount/umount.c 2007-04-04 19:02:22.000000000 +0200
133@@ -37,14 +37,13 @@
134 #else /* MNT_FORCE */
135
136 /* Does the present kernel source know about umount2? */
137-#include <linux/unistd.h>
138-#ifdef __NR_umount2
139+#include <sys/syscall.h>
140+#ifdef SYS_umount2
141
142-int umount2(const char *path, int flags);
143+#define umount2(path, flags) \
144+ syscall(SYS_umount2, path, flags)
145
146-_syscall2(int, umount2, const char *, path, int, flags);
147-
148-#else /* __NR_umount2 */
149+#else /* SYS_umount2 */
150
151 static int
152 umount2(const char *path, int flags) {
153@@ -52,7 +51,7 @@
154 errno = ENOSYS;
155 return -1;
156 }
157-#endif /* __NR_umount2 */
158+#endif /* SYS_umount2 */
159
160 #if !defined(MNT_FORCE)
161 /* dare not try to include <linux/mount.h> -- lots of errors */
162Index: util-linux-2.12r/partx/partx.c
163===================================================================
164--- util-linux-2.12r.orig/partx/partx.c 2004-08-23 22:13:27.000000000 +0200
165+++ util-linux-2.12r/partx/partx.c 2007-04-04 19:01:14.000000000 +0200
166@@ -338,10 +338,9 @@
167 #endif
168
169 #ifdef NEED__llseek
170-#include <linux/unistd.h> /* _syscall */
171-static
172-_syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo,
173- long long *, res, uint, wh);
174+#include <sys/syscall.h>
175+#define _llseek(fd, hi, lo, res, wh) \
176+ syscall(SYS__llseek, fd, hi, lo, res, wh)
177 #endif
178
179 static int
180Index: util-linux-2.12r/sys-utils/dmesg.c
181===================================================================
182--- util-linux-2.12r.orig/sys-utils/dmesg.c 2004-05-04 18:38:12.000000000 +0200
183+++ util-linux-2.12r/sys-utils/dmesg.c 2007-04-04 19:01:14.000000000 +0200
184@@ -29,7 +29,7 @@
185 * Only function 3 is allowed to non-root processes.
186 */
187
188-#include <linux/unistd.h>
189+#include <sys/syscall.h>
190 #include <stdio.h>
191 #include <getopt.h>
192 #include <stdlib.h>
193@@ -38,8 +38,8 @@
194 #if __GNU_LIBRARY__ < 5
195
196 #ifndef __alpha__
197-# define __NR_klogctl __NR_syslog
198- static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
199+# define klogctl(type, b, len) \
200+ syscall(SYS_syslog, type, b, len)
201 #else /* __alpha__ */
202 #define klogctl syslog
203 #endif
diff --git a/meta/packages/util-linux/files/defines.h b/meta/packages/util-linux/files/defines.h
new file mode 100644
index 0000000000..6ce6b86df5
--- /dev/null
+++ b/meta/packages/util-linux/files/defines.h
@@ -0,0 +1,10 @@
1#define UTIL_LINUX_VERSION "2.12"
2#define util_linux_version "util-linux-2.12"
3
4#define HAVE_blkpg_h
5#define HAVE_kd_h
6#define HAVE_locale_h
7#define HAVE_langinfo_h
8#define HAVE_sys_user_h
9#define HAVE_asm_types_h
10//#define NEED_tqueue_h
diff --git a/meta/packages/util-linux/files/fdiskbsdlabel_thumb.diff b/meta/packages/util-linux/files/fdiskbsdlabel_thumb.diff
new file mode 100644
index 0000000000..e6f82b5b46
--- /dev/null
+++ b/meta/packages/util-linux/files/fdiskbsdlabel_thumb.diff
@@ -0,0 +1,12 @@
1--- util-linux-2.12r/fdisk/fdiskbsdlabel.h.orig 2006-01-21 23:53:51.000000000 +0100
2+++ util-linux-2.12r/fdisk/fdiskbsdlabel.h 2006-01-21 23:54:35.000000000 +0100
3@@ -52,6 +52,9 @@
4 #elif defined (__s390__) || defined (__s390x__)
5 #define BSD_LABELSECTOR 1
6 #define BSD_LABELOFFSET 0
7+#elif defined (__thumb__)
8+#define BSD_LABELSECTOR 1
9+#define BSD_LABELOFFSET 0
10 #else
11 #error unknown architecture
12 #endif
diff --git a/meta/packages/util-linux/files/gcc34.patch b/meta/packages/util-linux/files/gcc34.patch
new file mode 100644
index 0000000000..8c4a20cdca
--- /dev/null
+++ b/meta/packages/util-linux/files/gcc34.patch
@@ -0,0 +1,23 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- util-linux-2.12o/disk-utils/fsck.cramfs.c~gcc34
7+++ util-linux-2.12o/disk-utils/fsck.cramfs.c
8@@ -77,15 +77,7 @@
9 #define PAD_SIZE 512
10
11 #include <asm/page.h>
12-#ifdef PAGE_SIZE
13-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
14-#elif defined __ia64__
15-#define PAGE_CACHE_SIZE (16384)
16-#elif defined __alpha__
17-#define PAGE_CACHE_SIZE (8192)
18-#else
19 #define PAGE_CACHE_SIZE (4096)
20-#endif
21
22 /* Guarantee access to at least 8kB at a time */
23 #define ROMBUFFER_BITS 13
diff --git a/meta/packages/util-linux/files/glibc-fix.patch b/meta/packages/util-linux/files/glibc-fix.patch
new file mode 100644
index 0000000000..6d0c2fcefa
--- /dev/null
+++ b/meta/packages/util-linux/files/glibc-fix.patch
@@ -0,0 +1,22 @@
1--- /tmp/cmos.c 2006-11-21 11:38:55.000000000 +0100
2+++ util-linux-2.12r/hwclock/cmos.c 2006-11-21 11:41:45.458554000 +0100
3@@ -46,15 +46,16 @@
4
5 #include <unistd.h> /* for geteuid() */
6 #include <fcntl.h> /* for O_RDWR */
7+#include <linux/version.h>
8 #include <errno.h>
9 #include "../defines.h" /* for HAVE_sys_io_h */
10 #include "nls.h"
11
12 #if defined(__i386__)
13-#ifdef HAVE_sys_io_h
14-#include <sys/io.h>
15+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
16+#include <asm/io.h>
17 #else
18-#include <asm/io.h> /* for inb, outb */
19+#include <sys/io.h> /* for inb, outb */
20 #endif
21 #elif defined(__alpha__)
22 /* <asm/io.h> fails to compile, probably because of u8 etc */
diff --git a/meta/packages/util-linux/files/make_include b/meta/packages/util-linux/files/make_include
new file mode 100644
index 0000000000..e6abcd91f7
--- /dev/null
+++ b/meta/packages/util-linux/files/make_include
@@ -0,0 +1,17 @@
1VERSION=2.12
2CC=gcc
3CFLAGS=
4LDFLAGS=
5HAVE_OLD_GCC=yes
6HAVE_RAW_H=yes
7HAVE_NCURSES=yes
8CURSESFLAGS=-DNCH=1
9LIBCURSES=-lncurses
10HAVE_TERMCAP=no
11NEED_LIBCRYPT=yes
12FOREIGN = --foreign-user
13HAVE_XGETTEXT=yes
14HAVE_OPENPTY=yes
15HAVE_PIVOT_ROOT=yes
16HAVE_GOOD_RPC=yes
17HAVE_ZLIB=yes
diff --git a/meta/packages/util-linux/files/swapargs.h b/meta/packages/util-linux/files/swapargs.h
new file mode 100644
index 0000000000..e960eef05f
--- /dev/null
+++ b/meta/packages/util-linux/files/swapargs.h
@@ -0,0 +1,3 @@
1#define SWAPON_HAS_TWO_ARGS
2#include <asm/page.h>
3#include <sys/swap.h>
diff --git a/meta/packages/util-linux/files/umount.diff b/meta/packages/util-linux/files/umount.diff
new file mode 100644
index 0000000000..78330789ef
--- /dev/null
+++ b/meta/packages/util-linux/files/umount.diff
@@ -0,0 +1,19 @@
1*** util-linux-2.12r/mount/umount.c.orig 2005-09-10 20:07:38.000000000 +0200
2--- util-linux-2.12r/mount/umount.c 2006-06-07 21:14:04.000000000 +0200
3***************
4*** 40,46 ****
5 #include <linux/unistd.h>
6 #ifdef __NR_umount2
7
8! static int umount2(const char *path, int flags);
9
10 _syscall2(int, umount2, const char *, path, int, flags);
11
12--- 40,46 ----
13 #include <linux/unistd.h>
14 #ifdef __NR_umount2
15
16! int umount2(const char *path, int flags);
17
18 _syscall2(int, umount2, const char *, path, int, flags);
19
diff --git a/meta/packages/util-linux/files/util-linux_2.12r-12.diff.gz b/meta/packages/util-linux/files/util-linux_2.12r-12.diff.gz
new file mode 100644
index 0000000000..a00cedeb15
--- /dev/null
+++ b/meta/packages/util-linux/files/util-linux_2.12r-12.diff.gz
Binary files differ
diff --git a/meta/packages/util-linux/util-linux-native_2.12r.bb b/meta/packages/util-linux/util-linux-native_2.12r.bb
new file mode 100644
index 0000000000..27c053000d
--- /dev/null
+++ b/meta/packages/util-linux/util-linux-native_2.12r.bb
@@ -0,0 +1,32 @@
1DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
2SECTION = "base"
3LICENSE = "GPL"
4DEPENDS = "zlib-native ncurses-native"
5
6inherit autotools native
7
8SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux/util-linux-${PV}.tar.bz2 \
9 file://gcc34.patch;patch=1 \
10 file://MCONFIG \
11 file://make_include \
12 file://swapargs.h \
13 file://fdiskbsdlabel_thumb.diff;patch=1 \
14 file://defines.h"
15
16S="${WORKDIR}/util-linux-${PV}"
17
18EXTRA_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"
19
20do_compile () {
21 set -e
22 install ${WORKDIR}/MCONFIG ${S}/MCONFIG
23 install ${WORKDIR}/make_include ${S}/make_include
24 install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
25 install ${WORKDIR}/defines.h ${S}/defines.h
26 oe_runmake
27}
28
29do_stage () {
30 autotools_stage_all
31}
32
diff --git a/meta/packages/util-linux/util-linux.inc b/meta/packages/util-linux/util-linux.inc
new file mode 100644
index 0000000000..a5ff009669
--- /dev/null
+++ b/meta/packages/util-linux/util-linux.inc
@@ -0,0 +1,193 @@
1DESCRIPTION = "Util-linux is a suite of essential utilities for any Linux system."
2SECTION = "base"
3LICENSE = "GPL"
4DEPENDS = "zlib ncurses"
5
6inherit autotools
7
8SRC_URI = "${KERNELORG_MIRROR}/pub/linux/utils/util-linux/util-linux-${PV}.tar.bz2 \
9 file://gcc34.patch;patch=1 \
10 file://MCONFIG \
11 file://make_include \
12 file://swapargs.h \
13 file://fdiskbsdlabel_thumb.diff;patch=1 \
14 file://umount.diff;patch=1 \
15 file://defines.h"
16
17PACKAGES_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 "
18
19FILES_${PN}-doc += "/usr/share/misc/getopt/getopt-*.*"
20
21FILES_util-linux-fdisk = "/sbin/fdisk.${PN}"
22FILES_util-linux-cfdisk = "/sbin/cfdisk"
23FILES_util-linux-sfdisk = "/sbin/sfdisk"
24FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}"
25FILES_util-linux-losetup = "/sbin/losetup.${PN}"
26FILES_util-linux-mount = "/bin/mount.${PN}"
27FILES_util-linux-umount = "/bin/umount.${PN}"
28FILES_util-linux-readprofile = "/usr/sbin/readprofile"
29
30RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile "
31RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup"
32
33do_compile () {
34 set -e
35 install ${WORKDIR}/MCONFIG ${S}/MCONFIG
36 install ${WORKDIR}/make_include ${S}/make_include
37 install ${WORKDIR}/swapargs.h ${S}/mount/swapargs.h
38 install ${WORKDIR}/defines.h ${S}/defines.h
39 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
40 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
41 'LDFLAGS=${LDFLAGS}'
42}
43
44checklink() {
45 local targ link value
46 targ="$1"
47 link="$2"
48 ext="$3"
49 if test -h "$link"
50 then
51 value="$(readlink "$link")"
52 if test "$value" = "$targ"
53 then
54 rm "$link"
55 ln -s "$targ"."${PN}" "$link$ext"
56 return 0
57 else
58 echo "$link: '$value' found '$targ' expected" >&2
59 return 1
60 fi
61 else
62 echo "$link: not a symbolic link" >&2
63 return 1
64 fi
65}
66
67do_install () {
68 # with ccache the timestamps on compiled files may
69 # end up earlier than on their inputs, this allows
70 # for the resultant compilation in the install step.
71 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
72 'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
73 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
74
75 test -f ${D}${base_sbindir}/pivot_root && \
76 mv ${D}${base_sbindir}/pivot_root ${D}${base_sbindir}/pivot_root.${PN}
77 mv ${D}${base_bindir}/dmesg ${D}${base_bindir}/dmesg.${PN}
78 mv ${D}${base_bindir}/kill ${D}${base_bindir}/kill.${PN}
79 mv ${D}${base_bindir}/more ${D}${base_bindir}/more.${PN}
80 mv ${D}${base_sbindir}/hwclock ${D}${base_sbindir}/hwclock.${PN}
81 mv ${D}${base_sbindir}/mkswap ${D}${base_sbindir}/mkswap.${PN}
82 mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
83 mv ${D}${base_sbindir}/sln ${D}${base_sbindir}/sln.${PN}
84 mv ${D}${base_sbindir}/mkfs.minix ${D}${base_sbindir}/mkfs.minix.${PN}
85 mv ${D}${base_sbindir}/fsck.minix ${D}${base_sbindir}/fsck.minix.${PN}
86 mv ${D}${bindir}/hexdump ${D}${bindir}/hexdump.${PN}
87 mv ${D}${bindir}/last ${D}${bindir}/last.${PN}
88 mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN}
89 mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN}
90 mv ${D}${bindir}/renice ${D}${bindir}/renice.${PN}
91 mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN}
92
93 mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN}
94 mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN}
95 mv ${D}${base_bindir}/umount ${D}${base_bindir}/umount.${PN}
96 mv ${D}${base_bindir}/mount ${D}${base_bindir}/mount.${PN}
97 mv ${D}${base_sbindir}/fdisk ${D}${base_sbindir}/fdisk.${PN}
98
99 checklink swapon ${D}${base_sbindir}/swapoff ".${PN}"
100 checklink shutdown ${D}${base_sbindir}/reboot ".${PN}"
101 checklink shutdown ${D}${base_sbindir}/halt ".${PN}"
102 checklink shutdown ${D}${base_sbindir}/fastboot ""
103 checklink shutdown ${D}${base_sbindir}/fasthalt ""
104}
105
106pkg_postinst_${PN} () {
107 update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
108 update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
109 update-alternatives --install ${base_bindir}/more more more.${PN} 100
110 update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
111 test -x ${base_sbindir}/pivot_root.${PN} && \
112 update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
113 update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
114 update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100
115 update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100
116 update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
117 update-alternatives --install ${bindir}/last last last.${PN} 100
118 update-alternatives --install ${bindir}/logger logger logger.${PN} 100
119 update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
120 update-alternatives --install ${bindir}/renice renice renice.${PN} 100
121 update-alternatives --install ${bindir}/wall wall wall.${PN} 100
122
123 # There seems to be problem, atleast on nslu2, with these, untill they are
124 # fixed the busybox ones have higher priority
125 update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10
126 update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
127 update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
128 update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
129}
130
131pkg_prerm_${PN} () {
132 test -x ${base_sbindir}/pivot_root.${PN} && \
133 update-alternatives --remove pivot_root pivot_root.${PN}
134 update-alternatives --remove dmesg dmesg.${PN}
135 update-alternatives --remove kill kill.${PN}
136 update-alternatives --remove more more.${PN}
137 update-alternatives --remove halt halt.${PN}
138 update-alternatives --remove hwclock hwclock.${PN}
139 update-alternatives --remove mkswap mkswap.${PN}
140 update-alternatives --remove reboot reboot.${PN}
141 update-alternatives --remove shutdown shutdown.${PN}
142 update-alternatives --remove sln sln.${PN}
143 update-alternatives --remove mkfs.minix mkfs.minix.${PN}
144 update-alternatives --remove fsck.minix fsck.minix.${PN}
145 update-alternatives --remove hexdump hexdump.${PN}
146 update-alternatives --remove last last.${PN}
147 update-alternatives --remove logger logger.${PN}
148 update-alternatives --remove mesg mesg.${PN}
149 update-alternatives --remove renice renice.${PN}
150 update-alternatives --remove wall wall.${PN}
151}
152
153pkg_postinst_util-linux-fdisk () {
154 update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100
155}
156
157pkg_prerm_util-linux-fdisk () {
158 update-alternatives --remove fdisk fdisk.${PN}
159}
160
161pkg_postinst_util-linux-mount () {
162 update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100
163}
164
165pkg_prerm_util-linux-mount () {
166 update-alternatives --remove mount mount.${PN}
167}
168
169pkg_postinst_util-linux-umount () {
170 update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100
171}
172
173pkg_prerm_util-linux-umount () {
174 update-alternatives --remove umount umount.${PN}
175}
176
177pkg_postinst_util-linux-losetup () {
178 update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100
179}
180
181pkg_prerm_util-linux-losetup () {
182 update-alternatives --remove losetup losetup.${PN}
183}
184
185pkg_postinst_util-linux-swaponoff () {
186 update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
187 update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
188}
189
190pkg_prerm_util-linux-swaponoff () {
191 update-alternatives --remove swapoff swapoff.${PN}
192 update-alternatives --remove swapon swapon.${PN}
193}
diff --git a/meta/packages/util-linux/util-linux_2.12r.bb b/meta/packages/util-linux/util-linux_2.12r.bb
new file mode 100644
index 0000000000..334c7b243d
--- /dev/null
+++ b/meta/packages/util-linux/util-linux_2.12r.bb
@@ -0,0 +1,7 @@
1require util-linux.inc
2
3SRC_URI += "file://util-linux_2.12r-12.diff.gz;patch=1"
4SRC_URI += "file://glibc-fix.patch;patch=1"
5SRC_URI += "file://debian-bug392236.patch;patch=1"
6
7PR = "r11"