tools: add util-linux
authorWeijie Gao <hackpascal@gmail.com>
Tue, 9 Jan 2024 15:20:18 +0000 (23:20 +0800)
committerRobert Marko <robimarko@gmail.com>
Mon, 11 Mar 2024 19:17:25 +0000 (20:17 +0100)
since kernel 6.4, commit bca2f3a9406b ("efi/zboot: Add BSS padding
before compression") introduces the use of hexdump to padding the
EFI kernel binary before compression.

util-linux which containing hexdump should then be compiled as a host
tool to guarantee not breaking the kernel build process.

Signed-off-by: Weijie Gao <hackpascal@gmail.com>
tools/Makefile
tools/util-linux/Makefile [new file with mode: 0644]

index bc169d7a95afb8e08c92e1a638ee88a75785c4c2..7607e844817f4971f334e4950f5ce93bc7dc42a5 100644 (file)
@@ -66,6 +66,7 @@ tools-y += pkgconf
 tools-y += quilt
 tools-y += squashfs4
 tools-y += sstrip
+tools-y += util-linux
 tools-y += zip
 tools-y += zlib
 tools-y += zstd
@@ -128,6 +129,7 @@ $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compil
 $(curdir)/sdcc/compile := $(curdir)/bison/compile
 $(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile
 $(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
+$(curdir)/util-linux/compile := $(curdir)/bison/compile
 $(curdir)/zstd/compile := $(curdir)/meson/compile
 
 ifneq ($(HOST_OS),Linux)
diff --git a/tools/util-linux/Makefile b/tools/util-linux/Makefile
new file mode 100644 (file)
index 0000000..acd819e
--- /dev/null
@@ -0,0 +1,132 @@
+#
+# Copyright (C) 2006-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=util-linux
+PKG_VERSION:=2.39.3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.39
+PKG_HASH:=7b6605e48d1a49f43cc4b4cfc59f313d0dd5402fa40b96810bd572e167dfed0f
+PKG_CPE_ID:=cpe:/a:kernel:util-linux
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_ARGS += \
+       --disable-poman \
+       --disable-nls \
+       --disable-asciidoc \
+       --disable-poman \
+       --disable-libuuid \
+       --disable-libblkid \
+       --disable-libmount \
+       --disable-libsmartcols \
+       --disable-libfdisk \
+       --disable-fdisks \
+       --disable-mount \
+       --disable-losetup \
+       --disable-zramctl \
+       --disable-fsck \
+       --disable-partx \
+       --disable-uuidd \
+       --disable-uuidgen \
+       --disable-blkid \
+       --disable-wipefs \
+       --disable-mountpoint \
+       --disable-fallocate \
+       --disable-unshare \
+       --disable-nsenter \
+       --disable-setpriv \
+       --disable-hardlink \
+       --disable-eject \
+       --disable-agetty \
+       --disable-cramfs \
+       --disable-bfs \
+       --disable-minix \
+       --disable-hwclock \
+       --disable-mkfs \
+       --disable-fstrim \
+       --disable-swapon \
+       --disable-lscpu \
+       --disable-lsfd \
+       --disable-lslogins \
+       --disable-wdctl \
+       --disable-cal \
+       --disable-logger \
+       --disable-whereis \
+       --disable-pipesz \
+       --disable-waitpid \
+       --disable-switch_root \
+       --disable-pivot_root \
+       --disable-lsmem \
+       --disable-chmem \
+       --disable-ipcmk \
+       --disable-ipcrm \
+       --disable-ipcs \
+       --disable-irqtop \
+       --disable-lsirq \
+       --disable-lsns \
+       --disable-rfkill \
+       --disable-scriptutils \
+       --disable-tunelp \
+       --disable-kill \
+       --disable-last \
+       --disable-utmpdump \
+       --disable-line \
+       --disable-mesg \
+       --disable-raw \
+       --disable-rename \
+       --disable-vipw \
+       --disable-newgrp \
+       --disable-chfn-chsh \
+       --disable-login \
+       --disable-nologin \
+       --disable-sulogin \
+       --disable-su \
+       --disable-runuser \
+       --disable-ul \
+       --disable-more \
+       --disable-pg \
+       --disable-setterm \
+       --disable-schedutils \
+       --disable-wall \
+       --disable-write \
+       --disable-bash-completion \
+       --disable-pylibmount \
+       --disable-pg-bell \
+       --without-util \
+       --without-selinux \
+       --without-audit \
+       --without-udev \
+       --without-ncursesw \
+       --without-ncurses \
+       --without-slang \
+       --without-tinfo \
+       --without-readline \
+       --without-utempter \
+       --without-cap-ng \
+       --without-libz \
+       --without-libmagic \
+       --without-user \
+       --without-btrfs \
+       --without-systemd \
+       --without-smack \
+       --without-econf \
+       --without-python \
+       --without-cryptsetup
+
+define Host/Install
+       $(INSTALL_BIN) $(HOST_BUILD_DIR)/hexdump $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Uninstall
+       rm -f $(STAGING_DIR_HOST)/bin/hexdump
+endef
+
+$(eval $(call HostBuild))