stage3: Build xz before rpm, since rpm depends on xz.
[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.static -o remount,rw /
6
7 # Mount standard filesystems.
8 mount.static -t proc /proc /proc
9 mount.static -t sysfs /sys /sys
10 mount.static -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run
11 mkdir -p /run/lock
12
13 # XXX devtmpfs
14
15 # Initialize dynamic linker cache.
16 ldconfig /usr/lib64 /usr/lib /lib64 /lib
17
18 # There is no hardware clock, just ensure the date is not miles out.
19 date `date -r /usr/bin +%m%d%H%M%Y`
20
21 hostname stage3
22 echo stage3.fedoraproject.org > /etc/hostname
23
24 # Set up the PATH.  The GCC path is a hack because I wasn't able to
25 # find the right flags for configuring GCC.
26 PATH=/usr/libexec/gcc/riscv64-unknown-linux-gnu/6.1.0:\
27 /usr/local/bin:\
28 /usr/local/sbin:\
29 /usr/bin:\
30 /usr/sbin:\
31 /bin:\
32 /sbin
33 export PATH
34
35 echo
36 echo "Welcome to the Fedora/RISC-V stage3 disk image"
37 echo "https://fedoraproject.org/wiki/Architectures/RISC-V"
38 echo
39
40 PS1='stage3:\w\$ '
41 export PS1
42
43 # Run bash.
44 bash -i
45
46 # Sync disks and shut down.
47 sync
48 poweroff