1 ################################################################################
5 ################################################################################
7 UTIL_LINUX_VERSION_MAJOR
= 2.29
8 UTIL_LINUX_VERSION
= $(UTIL_LINUX_VERSION_MAJOR
).1
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 # README.licensing claims that some files are GPLv2-only, but this is not true.
13 # Some files are GPLv3+ but only in tests.
14 UTIL_LINUX_LICENSE
= GPLv2
+, BSD-4c
, LGPLv2.1
+ (libblkid
, libfdisk
, libmount
), BSD-3c
(libuuid
)
15 UTIL_LINUX_LICENSE_FILES
= README.licensing Documentation
/licenses
/COPYING.GPLv2 Documentation
/licenses
/COPYING.UCB Documentation
/licenses
/COPYING.LGPLv2.1 Documentation
/licenses
/COPYING.BSD-3
16 UTIL_LINUX_INSTALL_STAGING
= YES
17 UTIL_LINUX_DEPENDENCIES
= host-pkgconf
18 # uClibc needs NTP_LEGACY for sys/timex.h -> ntp_gettime() support
19 # (used in logger.c), and the common default is N.
20 UTIL_LINUX_CONF_ENV
= scanf_cv_type_modifier
=no \
21 $(if
$(BR2_TOOLCHAIN_USES_UCLIBC
),ac_cv_header_sys_timex_h
=no
)
22 UTIL_LINUX_CONF_OPTS
+= \
24 --disable-makeinstall-chown
26 # system depends on util-linux so we enable systemd support
27 # (which needs systemd to be installed)
28 UTIL_LINUX_CONF_OPTS
+= \
30 --with-systemdsystemunitdir
=no
32 # We don't want the host-busybox dependency to be added automatically
33 HOST_UTIL_LINUX_DEPENDENCIES
= host-pkgconf
35 # We also don't want the host-python dependency
36 HOST_UTIL_LINUX_CONF_OPTS
= --without-python
38 # If both util-linux and busybox are selected, make certain util-linux
39 # wins the fight over who gets to have their utils actually installed
40 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
41 UTIL_LINUX_DEPENDENCIES
+= busybox
44 ifeq ($(BR2_PACKAGE_NCURSES
),y
)
45 UTIL_LINUX_DEPENDENCIES
+= ncurses
46 ifeq ($(BR2_PACKAGE_NCURSES_WCHAR
),y
)
47 UTIL_LINUX_CONF_OPTS
+= --with-ncursesw
48 UTIL_LINUX_CONF_ENV
+= NCURSESW5_CONFIG
=$(STAGING_DIR
)/usr
/bin
/$(NCURSES_CONFIG_SCRIPTS
)
50 UTIL_LINUX_CONF_OPTS
+= --without-ncursesw
--with-ncurses
--disable-widechar
51 UTIL_LINUX_CONF_ENV
+= NCURSES5_CONFIG
=$(STAGING_DIR
)/usr
/bin
/$(NCURSES_CONFIG_SCRIPTS
)
54 ifeq ($(BR2_USE_WCHAR
),y
)
55 UTIL_LINUX_CONF_OPTS
+= --enable-widechar
57 UTIL_LINUX_CONF_OPTS
+= --disable-widechar
59 UTIL_LINUX_CONF_OPTS
+= --without-ncursesw
--without-ncurses
62 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE
),y
)
63 UTIL_LINUX_DEPENDENCIES
+= gettext
64 UTIL_LINUX_LIBS
+= -lintl
67 ifeq ($(BR2_PACKAGE_LIBCAP_NG
),y
)
68 UTIL_LINUX_DEPENDENCIES
+= libcap-ng
71 # Unfortunately, the util-linux does LIBS="" at the end of its
72 # configure script. So we have to pass the proper LIBS value when
73 # calling the configure script to make configure tests pass properly,
74 # and then pass it again at build time.
75 UTIL_LINUX_CONF_ENV
+= LIBS
="$(UTIL_LINUX_LIBS)"
76 UTIL_LINUX_MAKE_OPTS
+= LIBS
="$(UTIL_LINUX_LIBS)"
78 ifeq ($(BR2_PACKAGE_LIBSELINUX
),y
)
79 UTIL_LINUX_DEPENDENCIES
+= libselinux
80 UTIL_LINUX_CONF_OPTS
+= --with-selinux
81 define UTIL_LINUX_SELINUX_PAMFILES_TWEAK
83 $(SED
) 's/^# \(.*pam_selinux.so.*\)$$/\1/' \
84 $(TARGET_DIR
)/etc
/pam.d
/$(f
)
88 UTIL_LINUX_CONF_OPTS
+= --without-selinux
91 # Used by cramfs utils
92 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_ZLIB
),zlib
)
95 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_LINUX_PAM
),linux-pam
)
97 # Disable/Enable utilities
98 UTIL_LINUX_CONF_OPTS
+= \
99 $(if
$(BR2_PACKAGE_UTIL_LINUX_BINARIES
),--enable-all-programs
,--disable-all-programs
) \
100 $(if
$(BR2_PACKAGE_UTIL_LINUX_AGETTY
),--enable-agetty
,--disable-agetty
) \
101 $(if
$(BR2_PACKAGE_UTIL_LINUX_BFS
),--enable-bfs
,--disable-bfs
) \
102 $(if
$(BR2_PACKAGE_UTIL_LINUX_CAL
),--enable-cal
,--disable-cal
) \
103 $(if
$(BR2_PACKAGE_UTIL_LINUX_CHFN_CHSH
),--enable-chfn-chsh
,--disable-chfn-chsh
) \
104 $(if
$(BR2_PACKAGE_UTIL_LINUX_CRAMFS
),--enable-cramfs
,--disable-cramfs
) \
105 $(if
$(BR2_PACKAGE_UTIL_LINUX_EJECT
),--enable-eject
,--disable-eject
) \
106 $(if
$(BR2_PACKAGE_UTIL_LINUX_FALLOCATE
),--enable-fallocate
,--disable-fallocate
) \
107 $(if
$(BR2_PACKAGE_UTIL_LINUX_FDFORMAT
),--enable-fdformat
,--disable-fdformat
) \
108 $(if
$(BR2_PACKAGE_UTIL_LINUX_FSCK
),--enable-fsck
,--disable-fsck
) \
109 $(if
$(BR2_PACKAGE_UTIL_LINUX_HWCLOCK
),--enable-hwclock
,--disable-hwclock
) \
110 $(if
$(BR2_PACKAGE_UTIL_LINUX_IPCRM
),--enable-ipcrm
,--disable-ipcrm
) \
111 $(if
$(BR2_PACKAGE_UTIL_LINUX_IPCS
),--enable-ipcs
,--disable-ipcs
) \
112 $(if
$(BR2_PACKAGE_UTIL_LINUX_KILL
),--enable-kill
,--disable-kill
) \
113 $(if
$(BR2_PACKAGE_UTIL_LINUX_LAST
),--enable-last
,--disable-last
) \
114 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBBLKID
),--enable-libblkid
,--disable-libblkid
) \
115 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBFDISK
),--enable-libfdisk
,--disable-libfdisk
) \
116 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
),--enable-libmount
,--disable-libmount
) \
117 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBSMARTCOLS
),--enable-libsmartcols
,--disable-libsmartcols
) \
118 $(if
$(BR2_PACKAGE_UTIL_LINUX_LIBUUID
),--enable-libuuid
,--disable-libuuid
) \
119 $(if
$(BR2_PACKAGE_UTIL_LINUX_LINE
),--enable-line
,--disable-line
) \
120 $(if
$(BR2_PACKAGE_UTIL_LINUX_LOGGER
),--enable-logger
,--disable-logger
) \
121 $(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
) \
122 $(if
$(BR2_PACKAGE_UTIL_LINUX_LOSETUP
),--enable-losetup
,--disable-losetup
) \
123 $(if
$(BR2_PACKAGE_UTIL_LINUX_LSLOGINS
),--enable-lslogins
,--disable-lslogins
) \
124 $(if
$(BR2_PACKAGE_UTIL_LINUX_MESG
),--enable-mesg
,--disable-mesg
) \
125 $(if
$(BR2_PACKAGE_UTIL_LINUX_MINIX
),--enable-minix
,--disable-minix
) \
126 $(if
$(BR2_PACKAGE_UTIL_LINUX_MORE
),--enable-more
,--disable-more
) \
127 $(if
$(BR2_PACKAGE_UTIL_LINUX_MOUNT
),--enable-mount
,--disable-mount
) \
128 $(if
$(BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
),--enable-mountpoint
,--disable-mountpoint
) \
129 $(if
$(BR2_PACKAGE_UTIL_LINUX_NEWGRP
),--enable-newgrp
,--disable-newgrp
) \
130 $(if
$(BR2_PACKAGE_UTIL_LINUX_NOLOGIN
),--enable-nologin
,--disable-nologin
) \
131 $(if
$(BR2_PACKAGE_UTIL_LINUX_NSENTER
),--enable-nsenter
,--disable-nsenter
) \
132 $(if
$(BR2_PACKAGE_UTIL_LINUX_PARTX
),--enable-partx
,--disable-partx
) \
133 $(if
$(BR2_PACKAGE_UTIL_LINUX_PG
),--enable-pg
,--disable-pg
) \
134 $(if
$(BR2_PACKAGE_UTIL_LINUX_PIVOT_ROOT
),--enable-pivot_root
,--disable-pivot_root
) \
135 $(if
$(BR2_PACKAGE_UTIL_LINUX_RAW
),--enable-raw
,--disable-raw
) \
136 $(if
$(BR2_PACKAGE_UTIL_LINUX_RENAME
),--enable-rename
,--disable-rename
) \
137 $(if
$(BR2_PACKAGE_UTIL_LINUX_RESET
),--enable-reset
,--disable-reset
) \
138 $(if
$(BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS
),--enable-schedutils
,--disable-schedutils
) \
139 $(if
$(BR2_PACKAGE_UTIL_LINUX_SETPRIV
),--enable-setpriv
,--disable-setpriv
) \
140 $(if
$(BR2_PACKAGE_UTIL_LINUX_SETTERM
),--enable-setterm
,--disable-setterm
) \
141 $(if
$(BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
),--enable-switch_root
,--disable-switch_root
) \
142 $(if
$(BR2_PACKAGE_UTIL_LINUX_TUNELP
),--enable-tunelp
,--disable-tunelp
) \
143 $(if
$(BR2_PACKAGE_UTIL_LINUX_UL
),--enable-ul
,--disable-ul
) \
144 $(if
$(BR2_PACKAGE_UTIL_LINUX_UNSHARE
),--enable-unshare
,--disable-unshare
) \
145 $(if
$(BR2_PACKAGE_UTIL_LINUX_UTMPDUMP
),--enable-utmpdump
,--disable-utmpdump
) \
146 $(if
$(BR2_PACKAGE_UTIL_LINUX_UUIDD
),--enable-uuidd
,--disable-uuidd
) \
147 $(if
$(BR2_PACKAGE_UTIL_LINUX_VIPW
),--enable-vipw
,--disable-vipw
) \
148 $(if
$(BR2_PACKAGE_UTIL_LINUX_WALL
),--enable-wall
,--disable-wall
) \
149 $(if
$(BR2_PACKAGE_UTIL_LINUX_WDCTL
),--enable-wdctl
,--disable-wdctl
) \
150 $(if
$(BR2_PACKAGE_UTIL_LINUX_WRITE
),--enable-write
,--disable-write
) \
151 $(if
$(BR2_PACKAGE_UTIL_LINUX_ZRAMCTL
),--enable-zramctl
,--disable-zramctl
)
153 # In the host version of util-linux, we only require libuuid and
154 # libmount (plus libblkid as an indirect dependency of libmount).
155 # So disable all of the programs, unless BR2_PACKAGE_HOST_UTIL_LINUX is set
157 HOST_UTIL_LINUX_CONF_OPTS
+= \
165 ifeq ($(BR2_PACKAGE_HOST_UTIL_LINUX
),y
)
166 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-makeinstall-chown
167 # disable more command because of ncurses dependency
168 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-more
170 HOST_UTIL_LINUX_CONF_OPTS
+= --disable-all-programs
173 # Install libmount Python bindings
174 ifeq ($(BR2_PACKAGE_PYTHON
)$(BR2_PACKAGE_PYTHON3
),y
)
175 UTIL_LINUX_CONF_OPTS
+= --with-python
176 UTIL_LINUX_DEPENDENCIES
+= $(if
$(BR2_PACKAGE_PYTHON
),python
,python3
)
177 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBMOUNT
),y
)
178 UTIL_LINUX_CONF_OPTS
+= --enable-pylibmount
180 UTIL_LINUX_CONF_OPTS
+= --disable-pylibmount
183 UTIL_LINUX_CONF_OPTS
+= --without-python
186 ifeq ($(BR2_PACKAGE_READLINE
),y
)
187 UTIL_LINUX_CONF_OPTS
+= --with-readline
188 UTIL_LINUX_LIBS
+= $(if
$(BR2_STATIC_LIBS
),-lcurses
)
189 UTIL_LINUX_DEPENDENCIES
+= readline
191 UTIL_LINUX_CONF_OPTS
+= --without-readline
194 ifeq ($(BR2_PACKAGE_AUDIT
),y
)
195 UTIL_LINUX_CONF_OPTS
+= --with-audit
196 UTIL_LINUX_DEPENDENCIES
+= audit
198 UTIL_LINUX_CONF_OPTS
+= --without-audit
201 # Install PAM configuration files
202 ifeq ($(BR2_PACKAGE_UTIL_LINUX_LOGIN_UTILS
),y
)
203 define UTIL_LINUX_INSTALL_PAMFILES
204 $(INSTALL
) -m
0644 package
/util-linux
/su.pam \
205 $(TARGET_DIR
)/etc
/pam.d
/su
206 $(INSTALL
) -m
0644 package
/util-linux
/su.pam \
207 $(TARGET_DIR
)/etc
/pam.d
/su-l
208 $(UTIL_LINUX_SELINUX_PAMFILES_TWEAK
)
212 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_INSTALL_PAMFILES
214 # Install agetty->getty symlink to avoid breakage when there's no busybox
215 ifeq ($(BR2_PACKAGE_UTIL_LINUX_AGETTY
),y
)
216 ifeq ($(BR2_PACKAGE_BUSYBOX
),)
217 define UTIL_LINUX_GETTY_SYMLINK
218 ln
-sf agetty
$(TARGET_DIR
)/sbin
/getty
223 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_GETTY_SYMLINK
225 ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE
)$(BR2_PACKAGE_UTIL_LINUX_LIBUUID
),yy
)
226 define UTIL_LINUX_TWEAK_UUID_PC
227 $(SED
) '/Libs\.private: .*/d' $(STAGING_DIR
)/usr
/lib
/pkgconfig
/uuid.
pc
228 printf
"Libs.private: -lintl\n" >>$(STAGING_DIR
)/usr
/lib
/pkgconfig
/uuid.
pc
230 UTIL_LINUX_POST_INSTALL_TARGET_HOOKS
+= UTIL_LINUX_TWEAK_UUID_PC
233 $(eval
$(autotools-package
))
234 $(eval
$(host-autotools-package
))