From c12a31dc69f5af8122de762d85ea1ddde3d7f1af Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 10 Aug 2016 15:17:41 +0100 Subject: [PATCH] Add bzip2 to the stage3 chroot. --- .gitignore | 1 + Makefile | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index 07a58de..a274f3c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ stamp-* /bash-4.3/ /beecrypt-4.2.1/ +/bzip2-1.0.6/ /coreutils-8.25/ /file-5.25/ /gmp-6.1.1/ diff --git a/Makefile b/Makefile index 41dade4..d69846e 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ GREP_VERSION = 2.25 LESS_VERSION = 481 STRACE_COMMIT = f320e1897832fd07a62e18ed288e75d8e79f4c5b STRACE_SHORT_COMMIT = f320e189 +BZIP2_VERSION = 1.0.6 all: stage1 stage2 stage3 stage4 @@ -285,6 +286,7 @@ stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \ stage3-chroot/usr/bin/grep \ stage3-chroot/usr/bin/less \ stage3-chroot/usr/bin/strace \ + stage3-chroot/usr/bin/bzip2 \ stage3-chroot/init \ stage3-disk.img @@ -755,6 +757,25 @@ strace-$(STRACE_SHORT_COMMIT).tar.gz: wget -O $@-t 'https://github.com/riscv/riscv-strace/archive/$(STRACE_COMMIT)/riscv-strace-$(STRACE_SHORTCOMMIT).tar.gz' mv $@-t $@ +# Cross-compile bzip2. +stage3-chroot/usr/bin/bzip2: bzip2-$(BZIP2_VERSION).tar.gz + rm -rf bzip2-$(BZIP2_VERSION) + tar -zxf $^ + cd bzip2-$(BZIP2_VERSION) && \ + PATH=$(ROOT)/fixed-gcc:$$PATH \ + make libbz2.a bzip2 bzip2recover \ + PREFIX=/usr \ + CC=riscv64-unknown-linux-gnu-gcc \ + AR=riscv64-unknown-linux-gnu-ar \ + RANLIB=riscv64-unknown-linux-gnu-ranlib + cd bzip2-$(BZIP2_VERSION) && \ + make install PREFIX=$(ROOT)/stage3-chroot/usr + +bzip2-$(BZIP2_VERSION).tar.gz: + rm -f $@ $@-t + wget -O $@-t http://www.bzip.org/1.0.6/bzip2-$(BZIP2_VERSION).tar.gz + mv $@-t $@ + # Create an /init script. stage3-chroot/init: init.sh install -m 0755 $^ $@ -- 1.8.3.1