From 6c2ea52b6fc65ce65304a66c7663db3b99f38acd Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 22 May 2015 13:47:32 +0200 Subject: [PATCH 1/4] 2.25.2-3: #1223894 --- 2.27-buildsys-without.patch | 117 ++++++++++++++++++++++++++++++++++++ util-linux.spec | 9 ++- 2 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 2.27-buildsys-without.patch diff --git a/2.27-buildsys-without.patch b/2.27-buildsys-without.patch new file mode 100644 index 0000000..a6116c0 --- /dev/null +++ b/2.27-buildsys-without.patch @@ -0,0 +1,117 @@ +diff -up util-linux-2.25.2/configure.ac.kzak util-linux-2.25.2/configure.ac +--- util-linux-2.25.2/configure.ac.kzak 2014-10-24 12:24:02.952545559 +0200 ++++ util-linux-2.25.2/configure.ac 2015-05-22 13:08:25.120672632 +0200 +@@ -501,8 +501,28 @@ AS_CASE([$scanf_cv_alloc_modifier], + have_scanf_alloc_modifier=no] + ) + +-UL_CHECK_LIB([util], [openpty]) +-UL_CHECK_LIB([termcap], [tgetnum]) ++ ++AC_ARG_WITH([util], AS_HELP_STRING([--without-util], [compile without libutil]), ++ [], [with_util=auto] ++) ++AS_IF([test "x$with_util" = xno], [ ++ AM_CONDITIONAL([HAVE_UTIL], [false]) ++ have_util=no ++], [ ++ UL_CHECK_LIB([util], [openpty]) ++]) ++ ++ ++AC_ARG_WITH([termcap], AS_HELP_STRING([--without-termcap], [compile without libtermcap]), ++ [], [with_termcap=auto] ++) ++AS_IF([test "x$with_termcap" = xno], [ ++ AM_CONDITIONAL([HAVE_TERMCAP], [false]) ++ have_termcap=no ++], [ ++ UL_CHECK_LIB([termcap], [tgetnum]) ++]) ++ + + AC_CHECK_TYPES([union semun], [], [], [[ + #include +@@ -725,17 +745,24 @@ AS_IF([test "x$have_slang" = xyes -o "x$ + ]) + + +-dnl Try pkg-config for libtinfo +-PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [ +- dnl If that failed, fall back to classic searching. +- AC_CHECK_LIB([tinfo], [tgetent], [ +- have_tinfo=yes +- TINFO_LIBS="-ltinfo" +- TINFO_CFLAGS=""]) ++AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo]), ++ [], [with_tinfo=auto] ++) ++have_tinfo=no ++AS_IF([test "x$with_tinfo" != xno], [ ++ dnl Try pkg-config for libtinfo ++ PKG_CHECK_MODULES(TINFO, [tinfo], [have_tinfo=yes], [ ++ dnl If that failed, fall back to classic searching. ++ AC_CHECK_LIB([tinfo], [tgetent], [ ++ have_tinfo=yes ++ TINFO_LIBS="-ltinfo" ++ TINFO_CFLAGS=""]) ++ ]) + ]) + AC_SUBST([TINFO_LIBS]) + AC_SUBST([TINFO_CFLAGS]) + AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes]) ++AS_IF([test "x$have_tinfo" = xyes], [AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo available.])]) + + + AC_ARG_WITH([utempter], +@@ -753,7 +780,6 @@ AS_IF([test "x$with_utempter" = xyes], [ + ]) + + +- + dnl + dnl libuuid + dnl +@@ -994,10 +1020,16 @@ UL_REQUIRES_SYSCALL_CHECK([nsenter], [UL + AM_CONDITIONAL([BUILD_NSENTER], [test "x$build_nsenter" = xyes]) + AC_CHECK_FUNCS([setns]) + +-dnl setpriv depends on libcap-ng. It would be possible to build +-dnl a version of setpriv with limited functionality without libcap-ng, +-dnl but this isn't currently supported. +-UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng]) ++ ++AC_ARG_WITH([cap_ng], ++ AS_HELP_STRING([--without-capng], [compile without libcap-ng]), ++ [], [with_cap_ng=auto] ++) ++AS_IF([test "x$with_cap_ng" = xno], [have_cap_ng=no],[ ++ UL_CHECK_LIB([cap-ng], [capng_apply], [cap_ng]) ++]) ++ ++ + AC_ARG_ENABLE([setpriv], + AS_HELP_STRING([--disable-setpriv], [do not build setpriv]), + [], [UL_DEFAULT_ENABLE([setpriv], [check])] +@@ -1027,12 +1059,20 @@ UL_BUILD_INIT([agetty]) + AM_CONDITIONAL([BUILD_AGETTY], [test "x$build_agetty" = xyes]) + + ++AC_ARG_WITH([libz], ++ AS_HELP_STRING([--without-libz], [compile without libz]), ++ [], [with_libz=auto] ++) ++AS_IF([test "x$with_libz" = xno], [have_z=no], [ ++ AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no]) ++]) ++ ++ + AC_ARG_ENABLE([cramfs], + AS_HELP_STRING([--disable-cramfs], [do not build fsck.cramfs, mkfs.cramfs]), + [], [UL_DEFAULT_ENABLE([cramfs], [check])] + ) + UL_BUILD_INIT([cramfs]) +-AC_CHECK_LIB([z], [crc32], [have_z=yes], [have_z=no]) + UL_REQUIRES_HAVE([cramfs], [z], [z library]) + AM_CONDITIONAL([BUILD_CRAMFS], [test "x$build_cramfs" = xyes]) + diff --git a/util-linux.spec b/util-linux.spec index fc1cc2f..fd38395 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.25.2 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Group: System Environment/Base URL: http://en.wikipedia.org/wiki/Util-linux @@ -79,6 +79,8 @@ Patch0: 2.23-login-lastlog-create.patch # 1168490 - CVE-2014-9114 util-linux: command injection flaw in blkid Patch1: 2.26-libblkid-escape.patch +# 1223894 - util-linux FTBFS during stage1 bootstrap +Patch2: 2.27-buildsys-without.patch %description The util-linux package contains a large variety of low-level system @@ -226,10 +228,10 @@ mountinfo, etc) and mount filesystems. %prep %autosetup -p1 -n %{name}-%{upstream_version} +./autogen.sh %build unset LINGUAS || : - export CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS" export SUID_CFLAGS="-fpie" export SUID_LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" @@ -838,6 +840,9 @@ exit 0 %{_libdir}/python*/site-packages/libmount/* %changelog +* Fri May 22 2015 Karel Zak 2.25.2-3 +- fix #1223894 - util-linux FTBFS during stage1 bootstrap + * Thu Nov 27 2014 Karel Zak 2.25.2-2 - fix #1168490 - CVE-2014-9114 util-linux: command injection flaw in blkid From b76b33d646becfdcf7f7c3ef91cd89a4d83a659f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 22 May 2015 13:55:31 +0200 Subject: [PATCH 2/4] 2.25.2-3: add BuildRequires --- util-linux.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util-linux.spec b/util-linux.spec index fd38395..2f25763 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -26,6 +26,12 @@ Buildrequires: libuser-devel BuildRequires: libcap-ng-devel BuildRequires: python3-devel +# due to patch to build-sys +BuildRequires: gettext-devel +BuildRequires: automake +BuildRequires: autoconf +BuildRequires: libtool + ### Sources Source0: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-%{upstream_version}.tar.xz Source1: util-linux-login.pamd From a19165d87233c3ddfc8015a65dce7d034c247123 Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Mon, 15 Jun 2015 17:12:12 +0200 Subject: [PATCH 3/4] Adding STAGE1 bootstrap recipe --- STAGE1-util-linux | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 STAGE1-util-linux diff --git a/STAGE1-util-linux b/STAGE1-util-linux new file mode 100644 index 0000000..9e6d76a --- /dev/null +++ b/STAGE1-util-linux @@ -0,0 +1,12 @@ +srpm util-linux +mcd $BUILDDIR/$1 +cat < config.cache +ax_cv_have_tls=yes +scanf_cv_alloc_modifier=ms +EOF +$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses \ + --prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \ + --disable-wall --cache-file=config.cache --without-python --without-systemd +notparallel +make $J V=1 +make $J install DESTDIR=${ROOTFS} From 8308737c49ce4dfe84c064fddac9f7e7c28d99eb Mon Sep 17 00:00:00 2001 From: Jaromir Capik Date: Tue, 30 Jun 2015 15:04:59 +0200 Subject: [PATCH 4/4] Adding --without-tinfo to STAGE1 recipe When the configure script finds no tinfo headers in the buildroot, it searches for them on the host's rootfs and when found there, it marks tinfo as present even when there's no compatible library installed for the target architecture. That causes the build to fail during cross-compiling. The above switch explicitly says we don't want tinfo. --- STAGE1-util-linux | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/STAGE1-util-linux b/STAGE1-util-linux index 9e6d76a..f492ecb 100644 --- a/STAGE1-util-linux +++ b/STAGE1-util-linux @@ -4,7 +4,7 @@ cat < config.cache ax_cv_have_tls=yes scanf_cv_alloc_modifier=ms EOF -$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses \ +$SRC/${1}-*/configure $TCONFIGARGS --without-ncurses --without-tinfo \ --prefix=/usr --libexecdir=/usr/lib${SUFFIX} --libdir=/usr/lib${SUFFIX} \ --disable-wall --cache-file=config.cache --without-python --without-systemd notparallel