init: Set clock from filesystem.
[fedora-riscv.git] / init.sh
diff --git a/init.sh b/init.sh
index f619f30..e76c1e8 100755 (executable)
--- a/init.sh
+++ b/init.sh
@@ -1,6 +1,23 @@
 #!/bin/bash -
 # Init script installed in stage3 disk image.
 
+# Root filesystem is mounted as ro, remount it as rw.
+mount.static -o remount,rw /
+
+# Mount standard filesystems.
+mount.static -t proc /proc /proc
+mount.static -t sysfs /sys /sys
+mount.static -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
+mkdir -p /run/lock
+
+# XXX devtmpfs
+
+# Initialize dynamic linker cache.
+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`
+
 echo
 echo "Welcome to the Fedora/RISC-V stage3 disk image"
 echo "https://fedoraproject.org/wiki/Architectures/RISC-V"