FINDUTILS_VERSION = 4.6.0
SED_VERSION = 4.2
PATCH_VERSION = 2.7.5
+HOSTNAME_VERSION = 3.15
all: stage1 stage2 stage3 stage4
stage3-chroot/usr/bin/find \
stage3-chroot/usr/bin/sed \
stage3-chroot/usr/bin/patch \
+ stage3-chroot/usr/bin/hostname \
stage3-chroot/usr/bin/rpm \
stage3-chroot/init \
stage3-disk.img
wget -O $@-t https://ftp.gnu.org/gnu/patch/patch-$(PATCH_VERSION).tar.gz
mv $@-t $@
+# Cross-compile hostname.
+stage3-chroot/usr/bin/hostname: hostname-$(HOSTNAME_VERSION).tar.gz
+ rm -rf hostname-$(HOSTNAME_VERSION)
+ tar -zxf $^
+ cd hostname && patch -p1 < ../hostname-rh.patch
+ cd hostname && \
+ PATH=$(ROOT)/fixed-gcc:$$PATH \
+ make \
+ CC=riscv64-unknown-linux-gnu-gcc \
+ CFLAGS="-O2 -g"
+ cd hostname && make install BASEDIR=$(ROOT)/stage3-chroot
+
+hostname-$(HOSTNAME_VERSION).tar.gz:
+ rm -f $@ $@-t
+ wget -O $@-t http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_$(HOSTNAME_VERSION).tar.gz
+ mv $@-t $@
+
# Cross-compile RPM / rpmbuild.
# We build this from a git commit, with a few hacks to the configure
# script.