stage3-chroot/etc/fedora-release \
stage3-chroot/lib64/libc.so.6 \
stage3-chroot/bin/bash \
+ stage3-chroot/init \
stage3-disk.img
stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux:
git fetch riscv && \
git checkout -f linux-4.1.y-riscv && \
make mrproper && \
- make ARCH=riscv defconfig && \
- make ARCH=riscv \
- CONFIG_CROSS_COMPILE=riscv64-unknown-elf- \
- CONFIG_CMDLINE="root=/dev/htifblk0 init=/bin/bash" \
- vmlinux
+ make ARCH=riscv defconfig
+ echo CONFIG_CMDLINE=\"root=/dev/htifblk0 init=/init\" >> stage3-kernel/linux-$(KERNEL_VERSION)/.config
+ echo CONFIG_CROSS_COMPILE=riscv64-unknown-elf- >> stage3-kernel/linux-$(KERNEL_VERSION)/.config
+ cd stage3-kernel/linux-$(KERNEL_VERSION) && \
+ make ARCH=riscv olddefconfig
+ cd stage3-kernel/linux-$(KERNEL_VERSION) && \
+ make ARCH=riscv vmlinux
ls -l $@
# Build an original (x86-64) chroot using supermin. We then aim to
wget -O $@-t ftp://ftp.gnu.org/gnu/bash/bash-$(BASH_VERSION).tar.gz
mv $@-t $@
+# Create an /init script.
+stage3-chroot/init: init.sh
+ install -m 0755 $^ $@
+
# Create the stage3 disk image.
# Note `-s +...' adds spare space to the disk image.
stage3-disk.img: stage3-chroot
--- /dev/null
+#!/bin/bash -
+# Init script installed in stage3 disk image.
+
+echo
+echo "Welcome to the Fedora/RISC-V stage3 disk image"
+echo "https://fedoraproject.org/wiki/Architectures/RISC-V"
+echo
+
+PS1='stage3:\w\$ '
+export PS1
+
+# Run bash.
+bash -i
+
+# Sync disks and shut down.
+sync
+poweroff