#!/bin/bash -
# Init script installed in stage3 disk image.
-LD_LIBRARY_PATH=/usr/lib64
-export LD_LIBRARY_PATH
-
# Root filesystem is mounted as ro, remount it as rw.
mount.static -o remount,rw /
# XXX devtmpfs
# Initialize dynamic linker cache.
-ldconfig
+ldconfig /usr/lib64 /usr/lib /lib64 /lib
+
+# There is no hardware clock, just ensure the date is not miles out.
+date `date -r /usr/bin +%m%d%H%M%Y`
+
+hostname stage3
+echo stage3.fedoraproject.org > /etc/hostname
+
+# Set up the PATH. The GCC path is a hack because I wasn't able to
+# find the right flags for configuring GCC.
+PATH=/usr/libexec/gcc/riscv64-unknown-linux-gnu/6.1.0:\
+/usr/local/bin:\
+/usr/local/sbin:\
+/usr/bin:\
+/usr/sbin:\
+/bin:\
+/sbin
+export PATH
echo
echo "Welcome to the Fedora/RISC-V stage3 disk image"