Move all to deprecated folder.

This commit is contained in:
2016-11-16 21:57:57 +01:00
parent 01738a7684
commit 05de7d6c04
9777 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,141 @@
Fix libmount build under uClibc
See https://bugs.gentoo.org/show_bug.cgi?id=406303
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/util-linux/files/util-linux-2.21.1-no-printf-alloc.patch?revision=1.2
[Gustavo: Ported to util-linux-2.26]
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
diff -Nura util-linux-2.26.orig/configure.ac util-linux-2.26/configure.ac
--- util-linux-2.26.orig/configure.ac 2015-02-19 09:11:13.146192401 -0300
+++ util-linux-2.26/configure.ac 2015-02-20 08:13:32.740006582 -0300
@@ -840,7 +840,6 @@
)
UL_BUILD_INIT([libmount])
UL_REQUIRES_BUILD([libmount], [libblkid])
-UL_REQUIRES_HAVE([libmount], [scanf_alloc_modifier], [scanf string alloc modifier])
AM_CONDITIONAL([BUILD_LIBMOUNT], [test "x$build_libmount" = xyes])
AM_CONDITIONAL([BUILD_LIBMOUNT_TESTS], [test "x$build_libmount" = xyes -a "x$enable_static" = xyes])
diff -Nura util-linux-2.26.orig/libmount/src/tab_parse.c util-linux-2.26/libmount/src/tab_parse.c
--- util-linux-2.26.orig/libmount/src/tab_parse.c 2015-02-16 09:57:34.070017496 -0300
+++ util-linux-2.26/libmount/src/tab_parse.c 2015-02-20 08:13:32.741006617 -0300
@@ -22,6 +22,10 @@
#include "pathnames.h"
#include "strutils.h"
+#ifndef HAVE_SCANF_MS_MODIFIER
+# define UL_SCNsA "%s"
+#endif
+
static int next_number(char **s, int *num)
{
char *end = NULL;
@@ -52,16 +56,31 @@
int rc, n = 0, xrc;
char *src = NULL, *fstype = NULL, *optstr = NULL;
+#ifndef HAVE_SCANF_MS_MODIFIER
+ size_t len = strlen(s) + 1;
+ src = malloc(len);
+ fstype = malloc(len);
+ fs->target = malloc(len);
+ optstr = malloc(len);
+#endif
+
rc = sscanf(s, UL_SCNsA" " /* (1) source */
UL_SCNsA" " /* (2) target */
UL_SCNsA" " /* (3) FS type */
UL_SCNsA" " /* (4) options */
"%n", /* byte count */
+#ifdef HAVE_SCANF_MS_MODIFIER
&src,
&fs->target,
&fstype,
&optstr,
+#else
+ src,
+ fs->target,
+ fstype,
+ optstr,
+#endif
&n);
xrc = rc;
@@ -127,6 +146,16 @@
unsigned int maj, min;
char *fstype = NULL, *src = NULL, *p;
+#ifndef HAVE_SCANF_MS_MODIFIER
+ size_t len = strlen(s) + 1;
+ fs->root = malloc(len);
+ fs->target = malloc(len);
+ fs->vfs_optstr = malloc(len);
+ fs->fs_optstr = malloc(len);
+ fstype = malloc(len);
+ src = malloc(len);
+#endif
+
rc = sscanf(s, "%d " /* (1) id */
"%d " /* (2) parent */
"%u:%u " /* (3) maj:min */
@@ -138,9 +167,15 @@
&fs->id,
&fs->parent,
&maj, &min,
+#ifdef HAVE_SCANF_MS_MODIFIER
&fs->root,
&fs->target,
&fs->vfs_optstr,
+#else
+ fs->root,
+ fs->target,
+ fs->vfs_optstr,
+#endif
&end);
if (rc >= 7 && end > 0)
@@ -160,9 +195,15 @@
UL_SCNsA" " /* (9) source */
UL_SCNsA, /* (10) fs options (fs specific) */
+#ifdef HAVE_SCANF_MS_MODIFIER
&fstype,
&src,
&fs->fs_optstr);
+#else
+ fstype,
+ src,
+ fs->fs_optstr);
+#endif
if (rc >= 10) {
size_t sz;
@@ -281,14 +322,25 @@
int rc;
char *src = NULL;
+#ifndef HAVE_SCANF_MS_MODIFIER
+ size_t len = strlen(s) + 1;
+ src = malloc(len);
+ fs->swaptype = malloc(len);
+#endif
+
rc = sscanf(s, UL_SCNsA" " /* (1) source */
UL_SCNsA" " /* (2) type */
"%ju" /* (3) size */
"%ju" /* (4) used */
"%d", /* priority */
+#ifdef HAVE_SCANF_MS_MODIFIER
&src,
&fs->swaptype,
+#else
+ src,
+ fs->swaptype,
+#endif
&fsz,
&usz,
&fs->priority);

View File

@@ -0,0 +1,50 @@
From 42a84250fc78bae3e885ecd1379e713663fe6487 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Sun, 6 Apr 2014 12:12:41 +0200
Subject: [PATCH 1/1] c.h: define mkostemp for older version of uClibc
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
configure.ac | 2 ++
include/c.h | 14 ++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/configure.ac b/configure.ac
index 35a1f26..a9b8d34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,6 +321,8 @@ AC_CHECK_FUNCS([ \
])
AC_FUNC_FSEEKO
+AC_CHECK_FUNCS([mkostemp])
+
AC_CHECK_FUNCS([openat fstatat unlinkat], [have_openat=yes], [have_openat=no])
AC_CHECK_FUNCS([ioperm iopl], [have_io=yes])
diff --git a/include/c.h b/include/c.h
index 4a9bf3d..1b880ed 100644
--- a/include/c.h
+++ b/include/c.h
@@ -300,4 +300,18 @@ static inline int usleep(useconds_t usec)
# define SEEK_HOLE 4
#endif
+/*
+ * mkostemp() may be missing with older version of uClibc
+ */
+#ifndef HAVE_MKOSTEMP
+static inline int mkostemp(char *template, int flags)
+{
+ int fd;
+ fd = mkstemp(template);
+ if (flags & O_CLOEXEC && fd >= 0)
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ return fd;
+}
+#endif
+
#endif /* UTIL_LINUX_C_H */
--
1.9.0

View File

@@ -0,0 +1,35 @@
From 9ce534491aea9b7975cfee5064423d0b850d8002 Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@openwide.fr>
Date: Sun, 9 Aug 2015 11:20:00 +0200
Subject: [PATCH] vipw: Remove pre-ANSI compiler support
__P() is used for compatibility with old K&R C compilers. With
ANSI C this macro has no effect.
This fixes a compilation error with musl libc because of undeclared
__P.
Ref:
https://lists.samba.org/archive/samba-technical/2015-June/108042.html
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
---
login-utils/vipw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/login-utils/vipw.c b/login-utils/vipw.c
index 668f4d8..e4c803b 100644
--- a/login-utils/vipw.c
+++ b/login-utils/vipw.c
@@ -85,7 +85,7 @@ int program;
char orig_file[FILENAMELEN]; /* original file /etc/passwd or /etc/group */
char *tmp_file; /* tmp file */
-void pw_error __P((char *, int, int));
+void pw_error (char *, int, int);
static void copyfile(int from, int to)
{
--
2.4.3

View File

@@ -0,0 +1,41 @@
From 9ed54668c15534a3b9d75e8a3e90b72ea426e596 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Fri, 9 Oct 2015 11:31:49 +0200
Subject: [PATCH] build-sys: use REALTIME_LIBS
Signed-off-by: Karel Zak <kzak@redhat.com>
---
misc-utils/Makemodule.am | 2 +-
sys-utils/Makemodule.am | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/misc-utils/Makemodule.am b/misc-utils/Makemodule.am
index e801611..b96d18b 100644
--- a/misc-utils/Makemodule.am
+++ b/misc-utils/Makemodule.am
@@ -90,7 +90,7 @@ endif
if BUILD_UUIDD
usrsbin_exec_PROGRAMS += uuidd
dist_man_MANS += misc-utils/uuidd.8
-uuidd_LDADD = $(LDADD) libuuid.la libcommon.la
+uuidd_LDADD = $(LDADD) libuuid.la libcommon.la $(REALTIME_LIBS)
uuidd_CFLAGS = $(DAEMON_CFLAGS) $(AM_CFLAGS) -I$(ul_libuuid_incdir)
uuidd_LDFLAGS = $(DAEMON_LDFLAGS) $(AM_LDFLAGS)
uuidd_SOURCES = misc-utils/uuidd.c
diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
index f306e65..3d28ff1 100644
--- a/sys-utils/Makemodule.am
+++ b/sys-utils/Makemodule.am
@@ -2,7 +2,7 @@ if BUILD_FLOCK
usrbin_exec_PROGRAMS += flock
dist_man_MANS += sys-utils/flock.1
flock_SOURCES = sys-utils/flock.c lib/monotonic.c lib/timer.c
-flock_LDADD = $(LDADD) libcommon.la -lrt
+flock_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS)
endif
if BUILD_IPCMK
--
2.5.0

View File

@@ -0,0 +1,54 @@
From f69e18629d1c91d83ab91314baf5e34088b57f6e Mon Sep 17 00:00:00 2001
From: Lada Trimasova <ltrimas@synopsys.com>
Date: Wed, 27 Jan 2016 16:26:41 +0300
Subject: [PATCH] buildsys: fix static configuration and building
In case of uClibc librt depends on libpthread. In particular
timer_create() function uses pthread_XXX(). That means in case
of static builds it's required to link not librt alone but
together with libpthread. So if checking timer_create function
in librt fails, it is necessary to check if timer_create function
successfully links with "-lpthread".
That issues was spotted in Buldroot autobuilder failures:
http://autobuild.buildroot.net/results/759/75960db671807091fe9155aee9e46a6245e32590/
http://autobuild.buildroot.org/results/112/112e8b85783f5aaba42a937a6eb064317615a21b/
Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
---
configure.ac | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 56512c0..9392bf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -382,14 +382,23 @@ AC_CHECK_FUNCS([clock_gettime], [],
AC_SUBST([REALTIME_LIBS])
have_timer="no"
-AC_CHECK_FUNCS([timer_createx],
+AC_CHECK_FUNCS([timer_create],
[have_time="yes"],
[AC_CHECK_LIB([rt], [timer_create], [
have_timer="yes"
REALTIME_LIBS="-lrt"
- ])]
+ ],[
+ AC_SEARCH_LIBS([timer_create], [rt], [
+ AC_MSG_RESULT(yes)
+ have_timer="yes"
+ REALTIME_LIBS="-lrt -lpthread"
+ ],[], [-lpthread]
+ )
+ ])]
)
+AC_SUBST([REALTIME_LIBS])
+
AC_CHECK_MEMBER([struct sockaddr.sa_len],
AC_DEFINE_UNQUOTED([HAVE_SA_LEN], [1], [Define if struct sockaddr contains sa_len]), [],
--
2.5.0

View File

@@ -0,0 +1,34 @@
From dea1bd2917ed9490ee96162288e0904e3de9da2d Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Tue, 16 Feb 2016 00:24:30 +0100
Subject: [PATCH] build-sys: fix typo
When timer_create is available have_timer must be
set to "yes". But instead have_time is used.
Replace have_time by have_timer.
Fixes:
http://autobuild.buildroot.net/results/993/9935cd0522d4f978ba2e788a690f66790686b76b
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 4559573..3950f0c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -390,7 +390,7 @@ AC_CHECK_FUNCS([clock_gettime], [],
have_timer="no"
AC_CHECK_FUNCS([timer_create],
- [have_time="yes"],
+ [have_timer="yes"],
[AC_CHECK_LIB([rt], [timer_create], [
have_timer="yes"
REALTIME_LIBS="-lrt"
--
2.5.0

View File

@@ -0,0 +1,293 @@
menuconfig BR2_PACKAGE_UTIL_LINUX
bool "util-linux"
depends on BR2_USE_WCHAR
select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
help
Various useful/essential linux libraries and utilities.
Things like mkfs, mkswap, swapon, fdisk, mount, dmesg, etc...
http://www.kernel.org/pub/linux/utils/util-linux/
if BR2_PACKAGE_UTIL_LINUX
config BR2_PACKAGE_UTIL_LINUX_LIBBLKID
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
depends on BR2_USE_MMU # fork
bool "libblkid"
help
Install libblkid.
config BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
depends on BR2_USE_MMU # util-linux/libblkid
bool "libmount"
help
Install libmount.
config BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
bool "libsmartcols"
depends on BR2_USE_MMU # fork
help
Install libsmartcols.
config BR2_PACKAGE_UTIL_LINUX_LIBUUID
bool "libuuid"
help
Install libuuid.
config BR2_PACKAGE_UTIL_LINUX_BINARIES
bool "install utilities"
depends on BR2_USE_MMU # fork()
select BR2_PACKAGE_UTIL_LINUX_LIBBLKID
select BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
select BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
select BR2_PACKAGE_UTIL_LINUX_LIBUUID
help
Install the basic set of util-linux binaries.
if BR2_PACKAGE_UTIL_LINUX_BINARIES
config BR2_PACKAGE_UTIL_LINUX_AGETTY
bool "agetty"
help
Alternative linux getty
config BR2_PACKAGE_UTIL_LINUX_BFS
bool "bfs"
help
SCO bfs filesystem support
config BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
bool "chfn/chsh"
depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
depends on !BR2_STATIC_LIBS
depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
select BR2_PACKAGE_LINUX_PAM
help
Change login shell, real user name and information
comment "chfn/chsh needs a uClibc or (e)glibc toolchain w/ wchar, locale, dynamic library"
depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
config BR2_PACKAGE_UTIL_LINUX_CRAMFS
bool "cramfs utilities"
select BR2_PACKAGE_ZLIB
help
Build fsck.cramfs and mkfs.cramfs
config BR2_PACKAGE_UTIL_LINUX_EJECT
bool "eject"
help
Eject removable media
config BR2_PACKAGE_UTIL_LINUX_FALLOCATE
bool "fallocate"
help
Preallocate space to a file
config BR2_PACKAGE_UTIL_LINUX_FDFORMAT
bool "fdformat"
help
Low-level format a floppy disk
config BR2_PACKAGE_UTIL_LINUX_FINDFS
bool "findfs"
help
Find a filesystem by label or UUID
config BR2_PACKAGE_UTIL_LINUX_FSCK
bool "fsck"
help
Check and repair a linux filesystem
config BR2_PACKAGE_UTIL_LINUX_HWCLOCK
bool "hwclock"
help
Query or set the hardware clock (RTC)
config BR2_PACKAGE_UTIL_LINUX_KILL
bool "kill"
help
Send a signal to a process
config BR2_PACKAGE_UTIL_LINUX_LAST
bool "last"
help
Show a listing of last logged in users
config BR2_PACKAGE_UTIL_LINUX_LINE
bool "line"
help
Read one line
config BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
bool "login utilities"
depends on (BR2_ENABLE_LOCALE && BR2_USE_WCHAR) # linux-pam
depends on !BR2_STATIC_LIBS
depends on !BR2_TOOLCHAIN_USES_MUSL # linux-pam
select BR2_PACKAGE_LINUX_PAM
help
Build login utilities (last, login, su, sulogin)
comment "login utilities needs a uClibc or (e)glibc toolchain w/ wchar, locale, dynamic library"
depends on !(BR2_ENABLE_LOCALE && BR2_USE_WCHAR) \
|| BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_MUSL
config BR2_PACKAGE_UTIL_LINUX_LOSETUP
bool "losetup"
help
Set up and control loop devices
config BR2_PACKAGE_UTIL_LINUX_MESG
bool "mesg"
help
Control write access to your terminal
config BR2_PACKAGE_UTIL_LINUX_MINIX
bool "minix"
help
Minix filesystem support
config BR2_PACKAGE_UTIL_LINUX_MORE
bool "more"
select BR2_PACKAGE_NCURSES
help
File perusal filter for crt viewing
config BR2_PACKAGE_UTIL_LINUX_MOUNT
bool "mount/umount"
help
Mount/unmount filesystems
config BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
bool "mountpoint"
help
See if a directory is a mountpoint
config BR2_PACKAGE_UTIL_LINUX_NEWGRP
bool "newgrp"
help
Log in to a new group
config BR2_PACKAGE_UTIL_LINUX_NOLOGIN
bool "nologin"
help
Politely refuse a login
config BR2_PACKAGE_UTIL_LINUX_NSENTER
bool "nsenter"
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
help
Enter the namespaces of another process.
comment "nsenter needs a toolchain w/ headers >= 3.0"
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
config BR2_PACKAGE_UTIL_LINUX_PARTX
bool "partition utilities"
help
Partition tools (addpart, delpart, partx)
config BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
bool "pivot_root"
help
Change the root filesystem
config BR2_PACKAGE_UTIL_LINUX_RAW
bool "raw"
help
Build a linux raw character device
config BR2_PACKAGE_UTIL_LINUX_RENAME
bool "rename"
help
Rename files
config BR2_PACKAGE_UTIL_LINUX_RESET
bool "reset"
help
Reset the terminal
config BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
bool "schedutils"
help
Scheduling utilities (chrt, ionice, taskset)
config BR2_PACKAGE_UTIL_LINUX_SETPRIV
bool "setpriv"
depends on !BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII # libcap-ng
select BR2_PACKAGE_LIBCAP_NG
help
Run a program with different Linux privilege settings
config BR2_PACKAGE_UTIL_LINUX_SETTERM
bool "setterm"
select BR2_PACKAGE_NCURSES
help
Set terminal attributes
config BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
bool "switch_root"
help
Switch to another filesystem as the root of the mount tree
config BR2_PACKAGE_UTIL_LINUX_TUNELP
bool "tunelp"
select BR2_PACKAGE_NCURSES
help
Set various parameters for the lp device
config BR2_PACKAGE_UTIL_LINUX_UL
bool "ul"
select BR2_PACKAGE_NCURSES
help
Do underlining
config BR2_PACKAGE_UTIL_LINUX_UNSHARE
bool "unshare"
help
Run program with some namespaces unshared from parent
config BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
bool "utmpdump"
help
Dump UTMP and WTMP files in raw format
config BR2_PACKAGE_UTIL_LINUX_UUIDD
bool "uuidd"
help
UUID generation daemon
config BR2_PACKAGE_UTIL_LINUX_VIPW
bool "vipw"
help
Edit the password, group, shadow-password or shadow-group file
config BR2_PACKAGE_UTIL_LINUX_WALL
bool "wall"
help
Send a message to everybody's terminal
config BR2_PACKAGE_UTIL_LINUX_WDCTL
bool "wdctl"
help
Shows hardware watchdog status
config BR2_PACKAGE_UTIL_LINUX_WRITE
bool "write"
help
Send a message to another user
config BR2_PACKAGE_UTIL_LINUX_ZRAMCTL
bool "zramctl"
help
Set up and control zram devices
endif
endif
comment "util-linux needs a toolchain w/ wchar"
depends on !BR2_USE_WCHAR

View File

@@ -0,0 +1,8 @@
config BR2_PACKAGE_HOST_UTIL_LINUX
bool "host util-linux"
help
Various useful/essential linux libraries and utilities.
Things like mkfs, mkswap, swapon, fdisk, mount, dmesg, etc...
http://www.kernel.org/pub/linux/utils/util-linux/

View File

@@ -0,0 +1,10 @@
auth required pam_unix.so nullok
account required pam_unix.so
password required pam_unix.so nullok
session required pam_limits.so
session required pam_env.so
session required pam_unix.so
session optional pam_lastlog.so

View File

@@ -0,0 +1,13 @@
auth sufficient pam_rootok.so
auth required pam_wheel.so use_uid
auth required pam_env.so
auth required pam_unix.so nullok
account required pam_unix.so
password required pam_unix.so nullok
session required pam_limits.so
session required pam_env.so
session required pam_unix.so
session optional pam_lastlog.so

View File

@@ -0,0 +1,2 @@
# From https://www.kernel.org/pub/linux/utils/util-linux/v2.27/sha256sums.asc
sha256 0a818fcdede99aec43ffe6ca5b5388bff80d162f2f7bd4541dca94fecb87a290 util-linux-2.27.1.tar.xz

View File

@@ -0,0 +1,192 @@
################################################################################
#
# util-linux
#
################################################################################
UTIL_LINUX_VERSION = $(UTIL_LINUX_VERSION_MAJOR).1
UTIL_LINUX_VERSION_MAJOR = 2.27
UTIL_LINUX_SOURCE = util-linux-$(UTIL_LINUX_VERSION).tar.xz
UTIL_LINUX_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/util-linux/v$(UTIL_LINUX_VERSION_MAJOR)
# README.licensing claims that some files are GPLv2-only, but this is not true.
# Some files are GPLv3+ but only in tests.
UTIL_LINUX_LICENSE = GPLv2+, BSD-4c, libblkid and libmount LGPLv2.1+, libuuid BSD-3c
UTIL_LINUX_LICENSE_FILES = README.licensing Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.UCB Documentation/licenses/COPYING.LGPLv2.1 Documentation/licenses/COPYING.BSD-3
UTIL_LINUX_AUTORECONF = YES
UTIL_LINUX_INSTALL_STAGING = YES
UTIL_LINUX_DEPENDENCIES = host-pkgconf
# uClibc needs NTP_LEGACY for sys/timex.h -> ntp_gettime() support
# (used in logger.c), and the common default is N.
UTIL_LINUX_CONF_ENV = scanf_cv_type_modifier=no \
$(if $(BR2_TOOLCHAIN_USES_UCLIBC),ac_cv_header_sys_timex_h=no)
UTIL_LINUX_CONF_OPTS += \
--disable-rpath \
--disable-makeinstall-chown
# system depends on util-linux so we enable systemd support
# (which needs systemd to be installed)
UTIL_LINUX_CONF_OPTS += \
--without-systemd \
--with-systemdsystemunitdir=no
# We don't want the host-busybox dependency to be added automatically
HOST_UTIL_LINUX_DEPENDENCIES = host-pkgconf
# We also don't want the host-python dependency
HOST_UTIL_LINUX_CONF_OPTS = --without-python
# If both util-linux and busybox are selected, make certain util-linux
# wins the fight over who gets to have their utils actually installed
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
UTIL_LINUX_DEPENDENCIES += busybox
endif
ifeq ($(BR2_PACKAGE_NCURSES),y)
UTIL_LINUX_DEPENDENCIES += ncurses
else
UTIL_LINUX_CONF_OPTS += --without-ncurses
endif
ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
UTIL_LINUX_DEPENDENCIES += gettext
UTIL_LINUX_MAKE_OPTS += LIBS=-lintl
endif
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
UTIL_LINUX_DEPENDENCIES += libcap-ng
endif
# Used by cramfs utils
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
# Used by login-utils
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_LINUX_PAM),linux-pam)
# Disable/Enable utilities
UTIL_LINUX_CONF_OPTS += \
$(if $(BR2_PACKAGE_UTIL_LINUX_AGETTY),--enable-agetty,--disable-agetty) \
$(if $(BR2_PACKAGE_UTIL_LINUX_BFS),--enable-bfs,--disable-bfs) \
$(if $(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH),--enable-chfn-chsh,--disable-chfn-chsh) \
$(if $(BR2_PACKAGE_UTIL_LINUX_CRAMFS),--enable-cramfs,--disable-cramfs) \
$(if $(BR2_PACKAGE_UTIL_LINUX_EJECT),--enable-eject,--disable-eject) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FALLOCATE),--enable-fallocate,--disable-fallocate) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FDFORMAT),--enable-fdformat,--disable-fdformat) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FINDFS),--enable-findfs,--disable-findfs) \
$(if $(BR2_PACKAGE_UTIL_LINUX_FSCK),--enable-fsck,--disable-fsck) \
$(if $(BR2_PACKAGE_UTIL_LINUX_HWCLOCK),--enable-hwclock,--disable-hwclock) \
$(if $(BR2_PACKAGE_UTIL_LINUX_KILL),--enable-kill,--disable-kill) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LAST),--enable-last,--disable-last) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBBLKID),--enable-libblkid,--disable-libblkid) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),--enable-libmount,--disable-libmount) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS),--enable-libsmartcols,--disable-libsmartcols) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LIBUUID),--enable-libuuid,--disable-libuuid) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LINE),--enable-line,--disable-line) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),--enable-last --enable-login --enable-runuser --enable-su --enable-sulogin,--disable-last --disable-login --disable-runuser --disable-su --disable-sulogin) \
$(if $(BR2_PACKAGE_UTIL_LINUX_LOSETUP),--enable-losetup,--disable-losetup) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MESG),--enable-mesg,--disable-mesg) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MINIX),--enable-minix,--disable-minix) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MORE),--enable-more,--disable-more) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNT),--enable-mount,--disable-mount) \
$(if $(BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT),--enable-mountpoint,--disable-mountpoint) \
$(if $(BR2_PACKAGE_UTIL_LINUX_NEWGRP),--enable-newgrp,--disable-newgrp) \
$(if $(BR2_PACKAGE_UTIL_LINUX_NOLOGIN),--enable-nologin,--disable-nologin) \
$(if $(BR2_PACKAGE_UTIL_LINUX_NSENTER),--enable-nsenter,--disable-nsenter) \
$(if $(BR2_PACKAGE_UTIL_LINUX_PARTX),--enable-partx,--disable-partx) \
$(if $(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT),--enable-pivot_root,--disable-pivot_root) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RAW),--enable-raw,--disable-raw) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RENAME),--enable-rename,--disable-rename) \
$(if $(BR2_PACKAGE_UTIL_LINUX_RESET),--enable-reset,--disable-reset) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS),--enable-schedutils,--disable-schedutils) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SETPRIV),--enable-setpriv,--disable-setpriv) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SETTERM),--enable-setterm,--disable-setterm) \
$(if $(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT),--enable-switch_root,--disable-switch_root) \
$(if $(BR2_PACKAGE_UTIL_LINUX_TUNELP),--enable-tunelp,--disable-tunelp) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UL),--enable-ul,--disable-ul) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UNSHARE),--enable-unshare,--disable-unshare) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP),--enable-utmpdump,--disable-utmpdump) \
$(if $(BR2_PACKAGE_UTIL_LINUX_UUIDD),--enable-uuidd,--disable-uuidd) \
$(if $(BR2_PACKAGE_UTIL_LINUX_VIPW),--enable-vipw,--disable-vipw) \
$(if $(BR2_PACKAGE_UTIL_LINUX_WALL),--enable-wall,--disable-wall) \
$(if $(BR2_PACKAGE_UTIL_LINUX_WDCTL),--enable-wdctl,--disable-wdctl) \
$(if $(BR2_PACKAGE_UTIL_LINUX_WRITE),--enable-write,--disable-write) \
$(if $(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL),--enable-zramctl,--disable-zramctl)
# In the host version of util-linux, we so far only require libuuid,
# and none of the util-linux utilities, so we disable all of them, unless
# BR2_PACKAGE_HOST_UTIL_LINUX is set
HOST_UTIL_LINUX_CONF_OPTS += \
--enable-libuuid \
--disable-libblkid --disable-libmount \
--without-ncurses
ifeq ($(BR2_PACKAGE_HOST_UTIL_LINUX),y)
HOST_UTIL_LINUX_CONF_OPTS += --disable-makeinstall-chown
# disable more command because of ncurses dependency
HOST_UTIL_LINUX_CONF_OPTS += --disable-more
else
HOST_UTIL_LINUX_CONF_OPTS += --disable-all-programs
endif
# Avoid building the tools if they are disabled since we can't install on
# a per-directory basis.
ifeq ($(BR2_PACKAGE_UTIL_LINUX_BINARIES),)
UTIL_LINUX_CONF_OPTS += --disable-all-programs
endif
# Install libmount Python bindings
ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
UTIL_LINUX_CONF_OPTS += --with-python
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON),python,python3)
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT),y)
UTIL_LINUX_CONF_OPTS += --enable-pylibmount
else
UTIL_LINUX_CONF_OPTS += --disable-pylibmount
endif
else
UTIL_LINUX_CONF_OPTS += --without-python
endif
# Install PAM configuration files
ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS),y)
define UTIL_LINUX_INSTALL_PAMFILES
$(INSTALL) -m 0644 package/util-linux/login.pam \
$(TARGET_DIR)/etc/pam.d/login
$(INSTALL) -m 0644 package/util-linux/su.pam \
$(TARGET_DIR)/etc/pam.d/su
$(INSTALL) -m 0644 package/util-linux/su.pam \
$(TARGET_DIR)/etc/pam.d/su-l
endef
endif
UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_INSTALL_PAMFILES
# Install agetty->getty symlink to avoid breakage when there's no busybox
ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY),y)
ifeq ($(BR2_PACKAGE_BUSYBOX),)
define UTIL_LINUX_GETTY_SYMLINK
ln -sf agetty $(TARGET_DIR)/sbin/getty
endef
endif
endif
UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_GETTY_SYMLINK
ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID),yy)
define UTIL_LINUX_TWEAK_UUID_PC
$(SED) '/Libs\.private: .*/d' $(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc
printf "Libs.private: -lintl\n" >>$(STAGING_DIR)/usr/lib/pkgconfig/uuid.pc
endef
UTIL_LINUX_POST_INSTALL_TARGET_HOOKS += UTIL_LINUX_TWEAK_UUID_PC
endif
$(eval $(autotools-package))
$(eval $(host-autotools-package))
# MKINSTALLDIRS comes from tweaked m4/nls.m4, but autoreconf uses staging
# one, so it disappears
UTIL_LINUX_INSTALL_STAGING_OPTS += MKINSTALLDIRS=$(@D)/config/mkinstalldirs
UTIL_LINUX_INSTALL_TARGET_OPTS += MKINSTALLDIRS=$(@D)/config/mkinstalldirs
HOST_UTIL_LINUX_INSTALL_OPTS += MKINSTALLDIRS=$(@D)/config/mkinstalldirs