1 ################################################################################
5 ################################################################################
7 UTIL_LINUX_VERSION_MAJOR
= 2.29
8 UTIL_LINUX_VERSION
= $(UTIL_LINUX_VERSION_MAJOR
)
9 UTIL_LINUX_SOURCE
= util-linux-
$(UTIL_LINUX_VERSION
).
tar.xz
10 UTIL_LINUX_SITE
= $(BR2_KERNEL_MIRROR
)/linux
/utils
/util-linux
/v
$(UTIL_LINUX_VERSION_MAJOR
)
12 # For 0001-build-sys-prefer-pkg-config-for-ncurses.patch and
13 # 0002-build-sys-cleanup-UL_NCURSES_CHECK.patch
14 UTIL_LINUX_AUTORECONF
= YES
16 # README.licensing claims that some files are GPLv2-only, but this is not true.
17 # Some files are GPLv3+ but only in tests.
18 UTIL_LINUX_LICENSE
= GPLv2
+, BSD-4c
, LGPLv2.1
+ (libblkid
, libfdisk
, libmount
), BSD-3c
(libuuid
)
19 UTIL_LINUX_LICENSE_FILES
= README.licensing Documentation
/licenses
/COPYING.GPLv2 Documentation
/licenses
/COPYING.UCB Documentation
/licenses
/COPYING.LGPLv2.1 Documentation
/licenses
/COPYING.BSD-3
20 UTIL_LINUX_INSTALL_STAGING
= YES
21 UTIL_LINUX_DEPENDENCIES
= host-pkgconf
22 # uClibc needs NTP_LEGACY for sys/timex.h -> ntp_gettime() support
23 # (used in logger.c), and the common default is N.
24 UTIL_LINUX_CONF_ENV
= scanf_cv_type_modifier
=no \
25 $(if
$(BR2_TOOLCHAIN_USES_UCLIBC
),ac_cv_header_sys_timex_h
=no
)
26 UTIL_LINUX_CONF_OPTS
+= \
28 --disable-makeinstall-chown
30 # system depends on util-linux so we enable systemd support
31 # (which needs systemd to be installed)
32 UTIL_LINUX_CONF_OPTS
+= \
34 --with-systemdsystemunitdir
=no
36 # We don't want the host-busybox dependency to be added automatically
37 HOST_UTIL_LINUX_DEPENDENCIES
= host-pkgconf
39 # We also don't want the host-python dependency
40 HOST_UTIL_LINUX_CONF_OPTS
= --without-python
42 # If both util-linux and busybox are selected, make certain util-linux
43 # wins the fight over who gets to have their utils actually installed
44 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
45 UTIL_LINUX_DEPENDENCIES
+= busybox
48 ifeq ($(BR2_USE_WCHAR
),y
)
49 UTIL_LINUX_CONF_OPTS
+= --enable-widechar
51 UTIL_LINUX_CONF_OPTS
+= --disable-widechar
54 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR
),y
)
55 UTIL_LINUX_DEPENDENCIES
+= ncurses
56 UTIL_LINUX_CONF_OPTS
+= --with-ncursesw
57 UTIL_LINUX_CONF_ENV
+= NCURSESW5_CONFIG
=$(STAGING_DIR
)/usr
/bin
/$(NCURSES_CONFIG_SCRIPTS
)
58 else ifeq ($(BR2_PACKAGE_NCURSES
):$(BR2_USE_WCHAR
),y
:)
59 UTIL_LINUX_DEPENDENCIES
+= ncurses
60 UTIL_LINUX_CONF_OPTS
+= --without-ncursesw
--with-ncurses
61 UTIL_LINUX_CONF_ENV
+= NCURSES5_CONFIG
=$(STAGING_DIR
)/usr
/bin
/$(NCURSES_CONFIG_SCRIPTS
)
63 UTIL_LINUX_CONF_OPTS
+= --without-ncursesw
--without-ncurses
66 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE
),y
)
67 UTIL_LINUX_DEPENDENCIES
+= gettext
68 UTIL_LINUX_LIBS
+= -lintl
71 ifeq ($(BR2_PACKAGE_LIBCAP_NG
),y
)
72 UTIL_LINUX_DEPENDENCIES
+= libcap-ng
75 # Unfortunately, the util-linux does LIBS="" at the end of its
76 # configure script. So we have to pass the proper LIBS value when
77 # calling the configure script to make configure tests pass properly,
78 # and then pass it again at build time.
79 UTIL_LINUX_CONF_ENV
+= LIBS
="$(UTIL_LINUX_LIBS)"
80 UTIL_LINUX_MAKE_OPTS
+= LIBS
="$(UTIL_LINUX_LIBS)"
82 # Used by cramfs utils
83 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_ZLIB
),zlib
)
86 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LINUX_PAM
),linux-pam
)
88 # Disable/Enable utilities
89 UTIL_LINUX_CONF_OPTS
+= \
90 $(if
$(BR2_PACKAGE_UTIL_LINUX_BINARIES
),--enable-all-programs
,--disable-all-programs
) \
91 $(if
$(BR2_PACKAGE_UTIL_LINUX_AGETTY
),--enable-agetty
,--disable-agetty
) \
92 $(if
$(BR2_PACKAGE_UTIL_LINUX_BFS
),--enable-bfs
,--disable-bfs
) \
93 $(if
$(BR2_PACKAGE_UTIL_LINUX_CAL
),--enable-cal
,--disable-cal
) \
94 $(if
$(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
),--enable-chfn-chsh
,--disable-chfn-chsh
) \
95 $(if
$(BR2_PACKAGE_UTIL_LINUX_CRAMFS
),--enable-cramfs
,--disable-cramfs
) \
96 $(if
$(BR2_PACKAGE_UTIL_LINUX_EJECT
),--enable-eject
,--disable-eject
) \
97 $(if
$(BR2_PACKAGE_UTIL_LINUX_FALLOCATE
),--enable-fallocate
,--disable-fallocate
) \
98 $(if
$(BR2_PACKAGE_UTIL_LINUX_FDFORMAT
),--enable-fdformat
,--disable-fdformat
) \
99 $(if
$(BR2_PACKAGE_UTIL_LINUX_FSCK
),--enable-fsck
,--disable-fsck
) \
100 $(if
$(BR2_PACKAGE_UTIL_LINUX_HWCLOCK
),--enable-hwclock
,--disable-hwclock
) \
101 $(if
$(BR2_PACKAGE_UTIL_LINUX_IPCRM
),--enable-ipcrm
,--disable-ipcrm
) \
102 $(if
$(BR2_PACKAGE_UTIL_LINUX_IPCS
),--enable-ipcs
,--disable-ipcs
) \
103 $(if
$(BR2_PACKAGE_UTIL_LINUX_KILL
),--enable-kill
,--disable-kill
) \
104 $(if
$(BR2_PACKAGE_UTIL_LINUX_LAST
),--enable-last
,--disable-last
) \
105 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBBLKID
),--enable-libblkid
,--disable-libblkid
) \
106 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBFDISK
),--enable-libfdisk
,--disable-libfdisk
) \
107 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
),--enable-libmount
,--disable-libmount
) \
108 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
),--enable-libsmartcols
,--disable-libsmartcols
) \
109 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBUUID
),--enable-libuuid
,--disable-libuuid
) \
110 $(if
$(BR2_PACKAGE_UTIL_LINUX_LINE
),--enable-line
,--disable-line
) \
111 $(if
$(BR2_PACKAGE_UTIL_LINUX_LOGGER
),--enable-logger
,--disable-logger
) \
112 $(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
) \
113 $(if
$(BR2_PACKAGE_UTIL_LINUX_LOSETUP
),--enable-losetup
,--disable-losetup
) \
114 $(if
$(BR2_PACKAGE_UTIL_LINUX_LSLOGINS
),--enable-lslogins
,--disable-lslogins
) \
115 $(if
$(BR2_PACKAGE_UTIL_LINUX_MESG
),--enable-mesg
,--disable-mesg
) \
116 $(if
$(BR2_PACKAGE_UTIL_LINUX_MINIX
),--enable-minix
,--disable-minix
) \
117 $(if
$(BR2_PACKAGE_UTIL_LINUX_MORE
),--enable-more
,--disable-more
) \
118 $(if
$(BR2_PACKAGE_UTIL_LINUX_MOUNT
),--enable-mount
,--disable-mount
) \
119 $(if
$(BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
),--enable-mountpoint
,--disable-mountpoint
) \
120 $(if
$(BR2_PACKAGE_UTIL_LINUX_NEWGRP
),--enable-newgrp
,--disable-newgrp
) \
121 $(if
$(BR2_PACKAGE_UTIL_LINUX_NOLOGIN
),--enable-nologin
,--disable-nologin
) \
122 $(if
$(BR2_PACKAGE_UTIL_LINUX_NSENTER
),--enable-nsenter
,--disable-nsenter
) \
123 $(if
$(BR2_PACKAGE_UTIL_LINUX_PARTX
),--enable-partx
,--disable-partx
) \
124 $(if
$(BR2_PACKAGE_UTIL_LINUX_PG
),--enable-pg
,--disable-pg
) \
125 $(if
$(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
),--enable-pivot_root
,--disable-pivot_root
) \
126 $(if
$(BR2_PACKAGE_UTIL_LINUX_RAW
),--enable-raw
,--disable-raw
) \
127 $(if
$(BR2_PACKAGE_UTIL_LINUX_RENAME
),--enable-rename
,--disable-rename
) \
128 $(if
$(BR2_PACKAGE_UTIL_LINUX_RESET
),--enable-reset
,--disable-reset
) \
129 $(if
$(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
),--enable-schedutils
,--disable-schedutils
) \
130 $(if
$(BR2_PACKAGE_UTIL_LINUX_SETPRIV
),--enable-setpriv
,--disable-setpriv
) \
131 $(if
$(BR2_PACKAGE_UTIL_LINUX_SETTERM
),--enable-setterm
,--disable-setterm
) \
132 $(if
$(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
),--enable-switch_root
,--disable-switch_root
) \
133 $(if
$(BR2_PACKAGE_UTIL_LINUX_TUNELP
),--enable-tunelp
,--disable-tunelp
) \
134 $(if
$(BR2_PACKAGE_UTIL_LINUX_UL
),--enable-ul
,--disable-ul
) \
135 $(if
$(BR2_PACKAGE_UTIL_LINUX_UNSHARE
),--enable-unshare
,--disable-unshare
) \
136 $(if
$(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
),--enable-utmpdump
,--disable-utmpdump
) \
137 $(if
$(BR2_PACKAGE_UTIL_LINUX_UUIDD
),--enable-uuidd
,--disable-uuidd
) \
138 $(if
$(BR2_PACKAGE_UTIL_LINUX_VIPW
),--enable-vipw
,--disable-vipw
) \
139 $(if
$(BR2_PACKAGE_UTIL_LINUX_WALL
),--enable-wall
,--disable-wall
) \
140 $(if
$(BR2_PACKAGE_UTIL_LINUX_WDCTL
),--enable-wdctl
,--disable-wdctl
) \
141 $(if
$(BR2_PACKAGE_UTIL_LINUX_WRITE
),--enable-write
,--disable-write
) \
142 $(if
$(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL
),--enable-zramctl
,--disable-zramctl
)
144 # In the host version of util-linux, we only require libuuid and
145 # libmount (plus libblkid as an indirect dependency of libmount).
146 # So disable all of the programs, unless BR2_PACKAGE_HOST_UTIL_LINUX is set
148 HOST_UTIL_LINUX_CONF_OPTS
+= \
156 ifeq ($(BR2_PACKAGE_HOST_UTIL_LINUX
),y
)
157 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-makeinstall-chown
158 # disable more command because of ncurses dependency
159 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-more
161 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-all-programs
164 # Install libmount Python bindings
165 ifeq ($(BR2_PACKAGE_PYTHON
)$(BR2_PACKAGE_PYTHON3
),y
)
166 UTIL_LINUX_CONF_OPTS
+= --with-python
167 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_PYTHON
),python
,python3
)
168 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
),y
)
169 UTIL_LINUX_CONF_OPTS
+= --enable-pylibmount
171 UTIL_LINUX_CONF_OPTS
+= --disable-pylibmount
174 UTIL_LINUX_CONF_OPTS
+= --without-python
177 ifeq ($(BR2_PACKAGE_READLINE
),y
)
178 UTIL_LINUX_CONF_OPTS
+= --with-readline
179 UTIL_LINUX_LIBS
+= $(if
$(BR2_STATIC_LIBS
),-lcurses
)
180 UTIL_LINUX_DEPENDENCIES
+= readline
182 UTIL_LINUX_CONF_OPTS
+= --without-readline
185 ifeq ($(BR2_PACKAGE_AUDIT
),y
)
186 UTIL_LINUX_CONF_OPTS
+= --with-audit
187 UTIL_LINUX_DEPENDENCIES
+= audit
189 UTIL_LINUX_CONF_OPTS
+= --without-audit
192 # Install PAM configuration files
193 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
),y
)
194 define UTIL_LINUX_INSTALL_PAMFILES
195 $(INSTALL
) -m
0644 package
/util-linux
/su.pam \
196 $(TARGET_DIR
)/etc
/pam.d
/su
197 $(INSTALL
) -m
0644 package
/util-linux
/su.pam \
198 $(TARGET_DIR
)/etc
/pam.d
/su-l
202 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_INSTALL_PAMFILES
204 # Install agetty->getty symlink to avoid breakage when there's no busybox
205 ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY
),y
)
206 ifeq ($(BR2_PACKAGE_BUSYBOX
),)
207 define UTIL_LINUX_GETTY_SYMLINK
208 ln
-sf agetty
$(TARGET_DIR
)/sbin
/getty
213 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_GETTY_SYMLINK
215 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE
)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID
),yy
)
216 define UTIL_LINUX_TWEAK_UUID_PC
217 $(SED
) '/Libs\.private: .*/d' $(STAGING_DIR
)/usr
/lib
/pkgconfig
/uuid.
pc
218 printf
"Libs.private: -lintl\n" >>$(STAGING_DIR
)/usr
/lib
/pkgconfig
/uuid.
pc
220 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_TWEAK_UUID_PC
223 $(eval
$(autotools-package
))
224 $(eval
$(host-autotools-package
))
226 # MKINSTALLDIRS comes from tweaked m4/nls.m4, but autoreconf uses staging
227 # one, so it disappears
228 UTIL_LINUX_INSTALL_STAGING_OPTS
+= MKINSTALLDIRS
=$(@D
)/config
/mkinstalldirs
229 UTIL_LINUX_INSTALL_TARGET_OPTS
+= MKINSTALLDIRS
=$(@D
)/config
/mkinstalldirs
230 HOST_UTIL_LINUX_INSTALL_OPTS
+= MKINSTALLDIRS
=$(@D
)/config
/mkinstalldirs