File: overlay-postmount

package info (click to toggle)
overlay-boot 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: sh: 253; makefile: 59; ansic: 26
file content (46 lines) | stat: -rwxr-xr-x 1,345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh
#
# This script performs default actions. It is invoked with CONFIG set
# for the subhost.

OVERLAYDIR="$(dirname $(realpath $0))"
. $OVERLAYDIR/functions

subhost_name "$CONFIG"
subhost_config

# setup $LIVE/dev
mkdir -p "$LIVE/dev"
mount -t tmpfs -osize=50M devtmpfs "$LIVE/dev"
mknod -m 622 "$LIVE/dev/console" c 5 1
mknod -m 666 "$LIVE/dev/null" c 1 3
mknod -m 666 "$LIVE/dev/zero" c 1 5
mknod -m 666 "$LIVE/dev/ptmx" c 5 2
mknod -m 666 "$LIVE/dev/tty" c 5 0
mknod -m 444 "$LIVE/dev/random" c 1 8
mknod -m 444 "$LIVE/dev/urandom" c 1 9
chown root:tty "$LIVE/dev/console"
chown root:tty "$LIVE/dev/ptmx"
chown root:tty "$LIVE/dev/tty"
ln -sTf /proc/self/fd "$LIVE/dev/fd"
ln -sTf /proc/self/fd/0 "$LIVE/dev/stdin"
ln -sTf /proc/self/fd/1 "$LIVE/dev/stdout"
ln -sTf /proc/self/fd/2 "$LIVE/dev/stderr"
ln -sTf /proc/kcore "$LIVE/dev/core"
mkdir "$LIVE/dev/shm"
mkdir "$LIVE/dev/pts"
chmod 1777 "$LIVE/dev/shm"

mount -t devpts devpts $LIVE/dev/pts
mount -t sysfs sysfs $LIVE/sys
if [ "$RAM_SIZE" != "none" ] ; then
    mount -t tmpfs -osize=$RAM_SIZE,mode=755 tmpfs $LIVE/run
    mkdir $LIVE/run/lock
    cmod 1777 $LIVE/run/lock
fi

echo "bind-mount /etc/adjtime into subhost, if possible"
mount --bind /etc/adjtime $LIVE/etc/adjtime || true

echo "install $OVERLAYDIR/reaper to $LIVE/.reaper"
cp -p $OVERLAYDIR/reaper $LIVE/.reaper