Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-02-01 16:02:22 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-02-01 16:02:22 +0100
commit854da672db23e3a73ec8c006a042b1b3334e4b63 (patch)
treee952d8ca01f8d040975daec842ace8d4701e7d3d
parentab6c622e801c15627beac5cdc0e0f6d9270316aa (diff)
building up to util-linux
added support for additional packages to install (ADDITIONAL_INSTALL_PACKAGE)
-rw-r--r--README85
-rwxr-xr-xbuild_stage1.sh3
-rwxr-xr-xbuild_stage1_package.sh11
-rw-r--r--packages-i486-stage1/coreutils2
-rw-r--r--packages-i486-stage1/libcap22
-rw-r--r--packages-i486-stage1/pam27
-rw-r--r--packages-i486-stage1/template7
-rw-r--r--packages-i486-stage1/util-linux21
-rw-r--r--patches-i486-stage1/coreutils-8.28-noman.patch238
-rw-r--r--patches-i486-stage1/libcap-2.25-gperf.patch12
-rw-r--r--patches-i486-stage1/pam-1.3.0-unix-passwd-no-yp.patch67
11 files changed, 418 insertions, 77 deletions
diff --git a/README b/README
index 0259cdb..2d607f1 100644
--- a/README
+++ b/README
@@ -164,8 +164,7 @@ su cross ./create_ca-certificates-utils_shim.sh
# basic packages
PACKAGES=" \
- pam libcap coreutils
-util-linux e2fsprogs \
+ e2fsprogs \
expat bzip2 lz4 xz pcre less gzip tar libarchive curl ca-certificates-utils \
archlinux-keyring archlinux32-keyring pacman-mirrorlist pacman \
sed fakeroot texinfo grep findutils file diffutils ed patch \
@@ -177,9 +176,6 @@ libedit openssh \
sysfsutils libidn nettle iputils"
# libunwind
-# pam for libcap
-# libcap for coreutils
-# libutil-linux and util-linux for e2fsprogs
# expat, bzip2, lz4, xz for libarchive
# libarchive, curl for pacman
# file (libmagic) for ...
@@ -188,8 +184,7 @@ sysfsutils libidn nettle iputils"
# libmnl, libelf, iptables for iproute2
# libedit for openssh
# sysfsutils and libidn, nettle for iputils
-SYSROOT_PACKAGES=" pam libcap \
-libutil-linux util-linux \
+SYSROOT_PACKAGES=" \
expat bzip2 lz4 xz pcre gzip libarchive curl \
file libmpc mpfr libmnl libelf libnfnetlink iptables \
libedit sysfsutils libidn"
@@ -201,73 +196,6 @@ libedit sysfsutils libidn"
-
-
-# libcap
-sed -i 's@KERNEL_HEADERS=/usr/include@BUILD_CC=gcc CC=i486-unknown-linux-gnu-gcc AR=i486-unknown-linux-gnu-ar RANLIB=i486-unknown-linux-gnu-ranlib KERNEL_HEADERS=/usr/include@' libcap/PKGBUILD
-# https://bugs.gentoo.org/604802
-# gperf_case_strncmp (register const char *s1, register const char *s2, register size_t n)
-# gperf output is somehow broken for cross-compilation
-# https://bugs.gentoo.org/attachment.cgi?id=462080
-# TODO: https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
-# wget -O libcap-2.25-gperf.patch 'https://604802.bugs.gentoo.org/attachment.cgi?id=462080'
-# copy libcap-2.25-gperf.patch from i486 folder
-sed -i 's@source=(@source=(libcap-2.25-gperf.patch @' libcap/PKGBUILD
-sed -i "s@md5sums=(@md5sums=('SKIP' @" libcap/PKGBUILD
-sed -i '2!N; /prepare() *{ *\n *cd/ a \ patch -Np1 < ${srcdir}/libcap-2.25-gperf.patch' libcap/PKGBUILD
-# TODO: mail this to https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
-# libcap needs pam just when building a test (which we cannot execute anyway)
-# test.c:3:10: fatal error: security/pam_modules.h: No such file or directory
-# #include <security/pam_modules.h>
-# => add pam as dependency and build it
-
-
-
-
-
-# pam
-# no flex, w3m, docboox-xml/xsl (no docu and take flex from the host)
-sed -i "s@makedepends=@#makedepends=@" pam/PKGBUILD
-sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' pam/PKGBUILD
-# disable NIS/YP
-sed -i 's@./configure@./configure --disable-nis@g' pam/PKGBUILD
-# no help, still errors:
-# unix_passwd.c:56:10: fatal error: rpcsvc/yp_prot.h: No such file or directory
-# #include <rpcsvc/yp_prot.h>
-# => pam-1.3.0-unix-passwd-no-yp.patch
-sed -i 's@source=(@source=(pam-1.3.0-unix-passwd-no-yp.patch @' pam/PKGBUILD
-sed -i "s@md5sums=(@md5sums=('3f5edd685cdd2c0a2ca44bc6e75320d8' @" pam/PKGBUILD
-sed -i '/patch -Np/ a \ patch -Np1 -i "${srcdir}/pam-1.3.0-unix-passwd-no-yp.patch"' pam/PKGBUILD
-# disable docu rebuilding
-sed -i 's@./configure@./configure --disable-regenerate-docu@' pam/PKGBUILD
-# no documentation built, so nothing to remove
-sed -i '2!N; /# FS #40749\n \+rm/ s/rm/#rm/g' pam/PKGBUILD
-
-# tons of tools needed to build documentation, we ommit the documentation right now
-sed -i "s@makedepends@#makedepends@" pam/PKGBUILD
-
-# coreutils
-sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' coreutils/PKGBUILD
-# apply man generation patch (one has to wonder, is it maintained at all?)
-# help2man errors: help2man: can't get `--help' info from man/chmod.td/chmod
-# http://ftp.lfs-matrix.net/pub/clfs/conglomeration/coreutils/coreutils-8.28-noman.patch
-# based on a patch by William Harrington (kb0iic at cross-lfs dot org) 2014-10-30 for coreutils 8.23
-sed -i 's@source=(@source=(coreutils-8.28-noman.patch @' coreutils/PKGBUILD
-sed -i "s@md5sums=(@md5sums=('SKIP' @" coreutils/PKGBUILD
-
-# util-linux
-# TODO: in statage1 build script install additional packages: for util-linux also libutil-linux
-# disable some dependencies on systemd, python, libcap-ng
-sed -i 's@makedepends\(.*\)@#makedepends\1@g' util-linux/PKGBUILD
-sed -i 's@ \+depends\(.*\)@#depends\1@g' util-linux/PKGBUILD
-sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' util-linux/PKGBUILD
-# no python
-sed -i 's@--with-python=3@--without-python \\@g' util-linux/PKGBUILD
-# no systemd
-sed -i '/--without-python/ a \ --without-systemd --without-systemdsystemunitdir' util-linux/PKGBUILD
-# sed -i '/ListenStream/ aRuntimeDirectory=uuidd' "$pkgdir/usr/lib/systemd/system/uuidd.socket"
-sed -i "s@\(sed.*\)@#\1@" util-linux/PKGBUILD
-
# e2fsprogs
sed -i 's@./configure@./configure --host=i486-unknown-linux-gnu --build=x86_64-pc-linux-gnu@g' e2fsprogs/PKGBUILD
# remove superflous 'bc' make dependency
@@ -1593,6 +1521,15 @@ sed -i 's/myflags="-march=i686"/myflags=-march=i486/g' pacman/PKGBUILD
###########
sed -i 's@./configure@FORCE_UNSAFE_CONFIGURE=1 ./configure@g' coreutils/PKGBUILD
+# TODO: needed in stage 2?
+# apply man generation patch (one has to wonder, is it maintained at all?)
+# help2man errors: help2man: can't get `--help' info from man/chmod.td/chmod
+# http://ftp.lfs-matrix.net/pub/clfs/conglomeration/coreutils/coreutils-8.28-noman.patch
+# based on a patch by William Harrington (kb0iic at cross-lfs dot org) 2014-10-30 for coreutils 8.23
+#sed -i 's@source=(@source=(coreutils-8.28-noman.patch @' PKGBUILD
+#sed -i "s@md5sums=(@md5sums=('SKIP' @" PKGBUILD
+#sed -i '/build()/ i \ prepare() { \n\ cd ${pkgname}-${pkgver}\n\ patch -Np1 < ${srcdir}/coreutils-8.28-noman.patch \n }' PKGBUILD
+
# zlib
######
strip: /lib/libz.so.1: no version information available (required by /lib/libbfd-2.29.1.so)
diff --git a/build_stage1.sh b/build_stage1.sh
index 9cf932e..1446187 100755
--- a/build_stage1.sh
+++ b/build_stage1.sh
@@ -10,7 +10,8 @@
PACKAGES="iana-etc filesystem linux-api-headers tzdata
ncurses readline bash joe
attr acl gmp gdbm db perl openssl
-zlib pambase cracklib libtirpc"
+zlib pambase cracklib libtirpc pam libcap coreutils
+util-linux"
for p in $PACKAGES; do
"$SCRIPT_DIR/build_stage1_package.sh" "$p"
diff --git a/build_stage1_package.sh b/build_stage1_package.sh
index 7513611..f685ff3 100755
--- a/build_stage1_package.sh
+++ b/build_stage1_package.sh
@@ -62,7 +62,9 @@ if test $(pacman --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -
fi
# copy bigger patches into the build area
- cp $SCRIPT_DIR/patches-$TARGET_CPU-stage1/$PACKAGE-*.patch .
+ if test $(find SCRIPT_DIR/patches-$TARGET_CPU-stage1/$PACKAGE-*.patch 2>/dev/null | grep -q .); then
+ cp $SCRIPT_DIR/patches-$TARGET_CPU-stage1/$PACKAGE-*.patch .
+ fi
# disable or enable parallel builds
@@ -99,13 +101,18 @@ if test $(pacman --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -
# install into chroot via pacman
sudo pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Syy "$PACKAGE"
- pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Q
+ if test "x$ADDITIONAL_INSTALL_PACKAGE" != "x"; then
+ sudo pacman --noconfirm --config "$STAGE1_CHROOT/etc/pacman.conf" -r "$STAGE1_CHROOT" -Syy "$ADDITIONAL_INSTALL_PACKAGE"
+ fi
# optionally install into cross-compiler sysroot with bsdtar
if test "$SYSROOT_INSTALL" = 1; then
cd "$XTOOLS_ARCH/$TARGET_CPU-unknown-linux-gnu/sysroot" || exit 1
sudo bsdtar xvf $STAGE1_CHROOT/packages/$TARGET_CPU/$PACKAGE-*.pkg.tar.xz
+ if test "x$ADDITIONAL_INSTALL_PACKAGE" != "x"; then
+ sudo bsdtar xvf $STAGE1_CHROOT/packages/$TARGET_CPU/$ADDITIONAL_INSTALL_PACKAGE-*.pkg.tar.xz
+ fi
cd "$STAGE1_BUILD/$PACKAGE" || exit 1
fi
diff --git a/packages-i486-stage1/coreutils b/packages-i486-stage1/coreutils
new file mode 100644
index 0000000..1995b5a
--- /dev/null
+++ b/packages-i486-stage1/coreutils
@@ -0,0 +1,2 @@
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
diff --git a/packages-i486-stage1/libcap b/packages-i486-stage1/libcap
new file mode 100644
index 0000000..c58fb49
--- /dev/null
+++ b/packages-i486-stage1/libcap
@@ -0,0 +1,22 @@
+# libcap is needed for coreutils
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@KERNEL_HEADERS=/usr/include@BUILD_CC=gcc CC=$TARGET_ARCH-gcc AR=$TARGET_ARCH-ar RANLIB=$TARGET_ARCH-ranlib KERNEL_HEADERS=/usr/include@" PKGBUILD
+
+# https://bugs.gentoo.org/604802
+# gperf_case_strncmp (register const char *s1, register const char *s2, register size_t n)
+# gperf output is somehow broken for cross-compilation
+# https://bugs.gentoo.org/attachment.cgi?id=462080
+# TODO: https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# wget -O libcap-2.25-gperf.patch 'https://604802.bugs.gentoo.org/attachment.cgi?id=462080'
+# copy libcap-2.25-gperf.patch from i486 folder
+sed -i 's@source=(@source=(libcap-2.25-gperf.patch @' PKGBUILD
+sed -i "s@md5sums=(@md5sums=('SKIP' @" PKGBUILD
+sed -i '2!N; /prepare() *{ *\n *cd/ a \ patch -Np1 < ${srcdir}/libcap-2.25-gperf.patch' PKGBUILD
+
+# TODO: mail this to https://git.kernel.org/pub/scm/linux/kernel/git/morgan/libcap.git/log/
+# libcap needs pam just when building a test (which we cannot execute anyway)
+# test.c:3:10: fatal error: security/pam_modules.h: No such file or directory
+# #include <security/pam_modules.h>
+# => add pam as dependency and build it as we need it anyway sooner or later
diff --git a/packages-i486-stage1/pam b/packages-i486-stage1/pam
new file mode 100644
index 0000000..24f403e
--- /dev/null
+++ b/packages-i486-stage1/pam
@@ -0,0 +1,27 @@
+# pam is needed for libcap
+SYSROOT_INSTALL=1
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# no flex, w3m, docboox-xml/xsl (no docu and take flex from the host)
+sed -i "s@makedepends=@#makedepends=@" PKGBUILD
+
+# disable NIS/YP
+sed -i 's@./configure@./configure --disable-nis@g' PKGBUILD
+
+# unix_passwd.c:56:10: fatal error: rpcsvc/yp_prot.h: No such file or directory
+# #include <rpcsvc/yp_prot.h>
+# => pam-1.3.0-unix-passwd-no-yp.patch
+sed -i 's@source=(@source=(pam-1.3.0-unix-passwd-no-yp.patch @' PKGBUILD
+sed -i "s@md5sums=(@md5sums=('3f5edd685cdd2c0a2ca44bc6e75320d8' @" PKGBUILD
+sed -i '/patch -Np/ a \ patch -Np1 -i "${srcdir}/pam-1.3.0-unix-passwd-no-yp.patch"' PKGBUILD
+
+# disable docu rebuilding
+sed -i 's@./configure@./configure --disable-regenerate-docu@' PKGBUILD
+
+# no documentation built, so nothing to remove
+sed -i '2!N; /# FS #40749\n \+rm/ s/rm/#rm/g' PKGBUILD
+
+# tons of tools needed to build documentation, we ommit the documentation right now
+sed -i "s@makedepends@#makedepends@" PKGBUILD
diff --git a/packages-i486-stage1/template b/packages-i486-stage1/template
index 3d5d558..faa5d7f 100644
--- a/packages-i486-stage1/template
+++ b/packages-i486-stage1/template
@@ -15,3 +15,10 @@ NOPARALLEL_BUILD=0
# force the installation of the files in the package also into
# the sysroot of the cross-compiler
SYSROOT_INSTALL=0
+
+# ADDITIONAL_INSTALL_PACKAGE = <package name>
+# per default the package has the same name as the package file,
+# some packages generate additional package files to install
+# (for example util-linux also has a libutil-linux)
+# Note: SYSROOT_INSTALL respects this too
+ADDITIONAL_INSTALL_PACKAGE=
diff --git a/packages-i486-stage1/util-linux b/packages-i486-stage1/util-linux
new file mode 100644
index 0000000..7d4d941
--- /dev/null
+++ b/packages-i486-stage1/util-linux
@@ -0,0 +1,21 @@
+# libutil-linux is needed for e2fsprogs
+SYSROOT_INSTALL=1
+
+# TODO: install two packages libutil-linux util-linux
+ADDITIONAL_INSTALL_PACKAGE=libutil-linux
+
+# prepare configure for cross-compilation
+sed -i "s@./configure@./configure --host=$TARGET_ARCH --build=$BUILD_ARCH@" PKGBUILD
+
+# disable some dependencies on systemd, python, libcap-ng
+sed -i 's@makedepends\(.*\)@#makedepends\1@g' PKGBUILD
+sed -i 's@ \+depends\(.*\)@#depends\1@g' PKGBUILD
+
+# no python
+sed -i 's@--with-python=3@--without-python \\@g' PKGBUILD
+
+# no systemd
+sed -i '/--without-python/ a \ --without-systemd --without-systemdsystemunitdir' PKGBUILD
+sed -i "s@\(sed.*\)@#\1@" PKGBUILD
+# TODO: needed?
+# sed -i '/ListenStream/ aRuntimeDirectory=uuidd' "$pkgdir/usr/lib/systemd/system/uuidd.socket"
diff --git a/patches-i486-stage1/coreutils-8.28-noman.patch b/patches-i486-stage1/coreutils-8.28-noman.patch
new file mode 100644
index 0000000..8a40a31
--- /dev/null
+++ b/patches-i486-stage1/coreutils-8.28-noman.patch
@@ -0,0 +1,238 @@
+diff -rauN coreutils-8.28/Makefile.in coreutils-8.28-noman-patch/Makefile.in
+--- coreutils-8.28/Makefile.in 2017-09-02 04:25:09.000000000 +0200
++++ coreutils-8.28-noman-patch/Makefile.in 2017-12-08 18:55:52.273333333 +0100
+@@ -2594,7 +2594,6 @@
+ $(top_srcdir)/build-aux/texinfo.tex \
+ $(top_srcdir)/build-aux/ylwrap $(top_srcdir)/doc/local.mk \
+ $(top_srcdir)/lib/alloca.c $(top_srcdir)/lib/config.hin \
+- $(top_srcdir)/lib/local.mk $(top_srcdir)/man/local.mk \
+ $(top_srcdir)/src/local.mk $(top_srcdir)/src/single-binary.mk \
+ $(top_srcdir)/tests/local.mk ABOUT-NLS AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README THANKS TODO build-aux/compile \
+@@ -2695,7 +2694,6 @@
+ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ ERRNO_H = @ERRNO_H@
+ EXEEXT = @EXEEXT@
+-EXTRA_MANS = @EXTRA_MANS@
+ FLOAT_H = @FLOAT_H@
+ FNMATCH_H = @FNMATCH_H@
+ GETADDRINFO_LIB = @GETADDRINFO_LIB@
+@@ -3972,7 +3970,6 @@
+ lispdir = @lispdir@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
+-man1_MANS = @man1_MANS@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
+@@ -4165,8 +4162,8 @@
+ lib/xgetcwd.h lib/xnanosleep.h lib/xreadlink.h lib/xstrtod.h \
+ lib/xstrtol.h lib/xstrtod.c lib/xstrtod.h lib/xalloc.h \
+ lib/yesno.h src/dcgen src/dircolors.hin src/primes.h \
+- src/tac-pipe.c src/extract-magic man/help2man man/dummy-man \
+- $(man1_MANS:.1=.x) $(EXTRA_MANS:.1=.x) $(all_tests) init.cfg \
++ src/tac-pipe.c src/extract-magic \
++ $(all_tests) init.cfg \
+ tests/Coreutils.pm tests/CuSkip.pm tests/CuTmpdir.pm \
+ tests/d_type-check tests/envvar-check tests/factor/run.sh \
+ tests/factor/create-test.sh tests/filefrag-extent-compare \
+@@ -4275,7 +4272,7 @@
+ lib/ref-add.sed lib/ref-del.sed $(SCRIPTS) \
+ $(no_install__progs) src/coreutils_symlinks \
+ src/coreutils_shebangs src/fs-def src/fs-magic \
+- src/fs-kernel-magic $(ALL_MANS) $(factor_tests)
++ src/fs-kernel-magic $(factor_tests)
+ MOSTLYCLEANDIRS = lib/arpa lib/netinet lib/selinux lib/sys lib/sys \
+ lib/sys lib/sys lib/sys lib/sys lib/sys lib/sys
+ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+@@ -5139,18 +5136,6 @@
+ } \
+ END {$$m and (warn "$@: do not use upper case in \@var{...}\n"), exit 1}'
+
+-@HAVE_PERL_FALSE@run_help2man = $(SHELL) $(srcdir)/man/dummy-man
+-@HAVE_PERL_TRUE@run_help2man = $(PERL) -- $(srcdir)/man/help2man
+-ALL_MANS = $(man1_MANS) $(EXTRA_MANS)
+-
+-# Dependencies common to all man pages. Updated below.
+-
+-# Depend on this to get version number changes.
+-
+-# This is required so that changes to e.g., emit_bug_reporting_address
+-# provoke regeneration of all the manpages.
+-mandeps = .version $(top_srcdir)/src/system.h $(am__append_5)
+-
+ # Indirections required so that we'll still be able to know the
+ # complete list of our tests even if the user overrides TESTS
+ # from the command line (as permitted by the test harness API).
+@@ -5978,10 +5963,10 @@
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+ .SUFFIXES:
+-.SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
++.SUFFIXES: .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
+ am--refresh: Makefile
+ @:
+-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+@@ -6003,7 +5988,7 @@
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+-$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__empty):
++$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/tests/local.mk $(am__empty):
+
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+@@ -14750,149 +14735,6 @@
+
+ check-local: check-texinfo
+
+-# This is a kludge to remove generated 'man/*.1' from a non-srcdir build.
+-# Without this, "make distcheck" might fail.
+-distclean-local:
+- test x$(srcdir) = x$(builddir) || rm -f $(ALL_MANS)
+-
+-$(ALL_MANS): $(mandeps)
+-# Most prog.1 man pages depend on src/prog. List the exceptions:
+-@SINGLE_BINARY_FALSE@man/install.1: src/ginstall$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/test.1: src/[$(EXEEXT)
+-
+-@SINGLE_BINARY_FALSE@man/arch.1: src/arch$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/b2sum.1: src/b2sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/base32.1: src/base32$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/base64.1: src/base64$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/basename.1: src/basename$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cat.1: src/cat$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chcon.1: src/chcon$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chgrp.1: src/chgrp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chmod.1: src/chmod$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chown.1: src/chown$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/chroot.1: src/chroot$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cksum.1: src/cksum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/comm.1: src/comm$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/coreutils.1: src/coreutils$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cp.1: src/cp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/csplit.1: src/csplit$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/cut.1: src/cut$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/date.1: src/date$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dd.1: src/dd$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/df.1: src/df$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dir.1: src/dir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dircolors.1: src/dircolors$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/dirname.1: src/dirname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/du.1: src/du$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/echo.1: src/echo$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/env.1: src/env$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/expand.1: src/expand$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/expr.1: src/expr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/factor.1: src/factor$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/false.1: src/false$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/fmt.1: src/fmt$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/fold.1: src/fold$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/groups.1: src/groups$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/head.1: src/head$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/hostid.1: src/hostid$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/hostname.1: src/hostname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/id.1: src/id$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/join.1: src/join$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/kill.1: src/kill$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/link.1: src/link$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ln.1: src/ln$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/logname.1: src/logname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ls.1: src/ls$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/md5sum.1: src/md5sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mkdir.1: src/mkdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mkfifo.1: src/mkfifo$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mknod.1: src/mknod$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mktemp.1: src/mktemp$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/mv.1: src/mv$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nice.1: src/nice$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nl.1: src/nl$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nohup.1: src/nohup$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/nproc.1: src/nproc$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/numfmt.1: src/numfmt$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/od.1: src/od$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/paste.1: src/paste$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pathchk.1: src/pathchk$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pinky.1: src/pinky$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pr.1: src/pr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/printenv.1: src/printenv$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/printf.1: src/printf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/ptx.1: src/ptx$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/pwd.1: src/pwd$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/readlink.1: src/readlink$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/realpath.1: src/realpath$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/rm.1: src/rm$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/rmdir.1: src/rmdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/runcon.1: src/runcon$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/seq.1: src/seq$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha1sum.1: src/sha1sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha224sum.1: src/sha224sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha256sum.1: src/sha256sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha384sum.1: src/sha384sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sha512sum.1: src/sha512sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/shred.1: src/shred$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/shuf.1: src/shuf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sleep.1: src/sleep$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sort.1: src/sort$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/split.1: src/split$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stat.1: src/stat$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stdbuf.1: src/stdbuf$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/stty.1: src/stty$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sum.1: src/sum$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/sync.1: src/sync$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tac.1: src/tac$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tail.1: src/tail$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tee.1: src/tee$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/timeout.1: src/timeout$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/touch.1: src/touch$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tr.1: src/tr$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/true.1: src/true$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/truncate.1: src/truncate$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tsort.1: src/tsort$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/tty.1: src/tty$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uname.1: src/uname$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/unexpand.1: src/unexpand$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uniq.1: src/uniq$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/unlink.1: src/unlink$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/uptime.1: src/uptime$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/users.1: src/users$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/vdir.1: src/vdir$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/wc.1: src/wc$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/who.1: src/who$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/whoami.1: src/whoami$(EXEEXT)
+-@SINGLE_BINARY_FALSE@man/yes.1: src/yes$(EXEEXT)
+-
+-.x.1:
+- $(AM_V_GEN)name=`echo $@ | sed 's|.*/||; s|\.1$$||'` || exit 1; \
+- case $$name in \
+- install) prog='ginstall'; argv=$$name;; \
+- test) prog='['; argv='[';; \
+- *) prog=$$name; argv=$$prog;; \
+- esac; \
+- rm -f $@ $@-t \
+- && t=$*.td \
+- && rm -rf $$t \
+- && $(MKDIR_P) $$t \
+- && (cd $$t && $(LN_S) '$(abs_top_builddir)/src/'$$prog$(EXEEXT) \
+- $$argv$(EXEEXT)) \
+- && : $${SOURCE_DATE_EPOCH=`cat $(srcdir)/.timestamp 2>/dev/null || :`} \
+- && export SOURCE_DATE_EPOCH && $(run_help2man) \
+- --source='$(PACKAGE_STRING)' \
+- --include=$(srcdir)/man/$$name.x \
+- --output=$$t/$$name.1 \
+- --info-page='\(aq(coreutils) '$$name' invocation\(aq' \
+- $$t/$$argv$(EXEEXT) \
+- && sed \
+- -e 's|$*\.td/||g' \
+- -e '/For complete documentation/d' \
+- $$t/$$name.1 > $@-t \
+- && rm -rf $$t \
+- && chmod a-w $@-t \
+- && mv $@-t $@
+ .PHONY: check-root
+ check-root:
+ $(MAKE) check TESTS='$(root_tests)' SUBDIRS=.
diff --git a/patches-i486-stage1/libcap-2.25-gperf.patch b/patches-i486-stage1/libcap-2.25-gperf.patch
new file mode 100644
index 0000000..ddce2c4
--- /dev/null
+++ b/patches-i486-stage1/libcap-2.25-gperf.patch
@@ -0,0 +1,12 @@
+diff -rauN libcap-2.25/libcap/Makefile libcap-2.25-crossfix/libcap/Makefile
+--- libcap-2.25/libcap/Makefile 2016-01-31 01:01:41.000000000 +0100
++++ libcap-2.25-crossfix/libcap/Makefile 2017-12-07 21:44:49.040000002 +0100
+@@ -41,7 +41,7 @@
+ ./_makenames > cap_names.h
+
+ $(GPERF_OUTPUT): cap_names.list.h
+- perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
++ perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --includes --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+
+ cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+ @echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
diff --git a/patches-i486-stage1/pam-1.3.0-unix-passwd-no-yp.patch b/patches-i486-stage1/pam-1.3.0-unix-passwd-no-yp.patch
new file mode 100644
index 0000000..1ac4a11
--- /dev/null
+++ b/patches-i486-stage1/pam-1.3.0-unix-passwd-no-yp.patch
@@ -0,0 +1,67 @@
+diff -rauN pam_unix2-2.9.1/config.h.in pam_unix2-2.9.1-unix-passwd-no-yp-patch/config.h.in
+--- pam_unix2-2.9.1/config.h.in 2012-04-03 15:31:24.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/config.h.in 2017-12-08 16:15:09.870000003 +0100
+@@ -194,3 +194,6 @@
+
+ /* Define to 1 if you need to in order for `stat' and other things to work. */
+ #undef _POSIX_SOURCE
++
++/* Define to 1 if you have the <rpcsvc/yp_prot.h> header file. */
++#undef HAVE_RPCSVC_YP_PROT_H
+diff -rauN pam_unix2-2.9.1/configure.in pam_unix2-2.9.1-unix-passwd-no-yp-patch/configure.in
+--- pam_unix2-2.9.1/configure.in 2012-04-03 15:31:17.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/configure.in 2017-12-08 16:15:22.160000000 +0100
+@@ -60,6 +60,7 @@
+ AC_CHECK_HEADERS(crypt.h)
+ AC_CHECK_HEADERS(stdlib.h pwd.h sys/types.h syslog.h sys/syslog.h string.h strings.h, , AC_MSG_ERROR(some basic headers are missing))
+ AC_CHECK_HEADERS(security/pam_appl.h security/pam_modules.h, , AC_MSG_ERROR(broken libpam installation))
++AC_CHECK_HEADERS(rpcsvc/yp_prot.h)
+
+ dnl Check for Linux-PAM 0.99.x
+ AC_CHECK_HEADERS(security/pam_ext.h)
+diff -rauN pam_unix2-2.9.1/src/unix_passwd.c pam_unix2-2.9.1-unix-passwd-no-yp-patch/src/unix_passwd.c
+--- pam_unix2-2.9.1/src/unix_passwd.c 2012-04-03 15:24:51.000000000 +0200
++++ pam_unix2-2.9.1-unix-passwd-no-yp-patch/src/unix_passwd.c 2017-12-08 16:15:33.389999993 +0100
+@@ -53,8 +53,10 @@
+ #include <rpc/types.h>
+ #include <nss.h>
+ #include <syslog.h>
++#if defined(HAVE_YP_PROT_H)
+ #include <rpcsvc/yp_prot.h>
+ #include <rpcsvc/ypclnt.h>
++#endif
+
+ #define PAM_SM_PASSWORD
+ #include <security/pam_modules.h>
+@@ -413,6 +415,7 @@
+ }
+ }
+
++#if defined(HAVE_YP_PROT_H)
+ static char *
+ getnismaster (pam_handle_t *pamh, int flags)
+ {
+@@ -445,6 +448,7 @@
+
+ return master;
+ }
++#endif
+
+ static int
+ read_loop (int fd, char *buffer, int count)
+@@ -1095,6 +1099,7 @@
+
+ ulckpwdf ();
+ }
++#if defined(HAVE_YP_PROT_H)
+ else if (data->service == S_YP)
+ {
+ struct yppasswd yppwd;
+@@ -1137,6 +1142,7 @@
+ retval = PAM_AUTHTOK_ERR;
+ }
+ }
++#endif
+
+ return retval;
+ }