Mount some standard filesystems like /proc in the stage3 init.
[fedora-riscv.git] / init.sh
1 #!/bin/bash -
2 # Init script installed in stage3 disk image.
3
4 # Root filesystem is mounted as ro, remount it as rw.
5 mount -o remount,rw /
6
7 # Mount standard filesystems.
8 mount -t proc /proc /proc
9 mount -t sysfs /sys /sys
10 mount -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
11 mkdir -p /run/lock
12
13 # XXX devtmpfs
14
15 echo
16 echo "Welcome to the Fedora/RISC-V stage3 disk image"
17 echo "https://fedoraproject.org/wiki/Architectures/RISC-V"
18 echo
19
20 PS1='stage3:\w\$ '
21 export PS1
22
23 # Run bash.
24 bash -i
25
26 # Sync disks and shut down.
27 sync
28 poweroff