summaryrefslogtreecommitdiff
path: root/stage2-fhs-dirs.morph.yaml
blob: fe2c0d08aad724e7fbb7d0947badef1197d48c11 (plain)
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
name: stage2-fhs-dirs
kind: chunk
decription: create the FHS 2.3 directory hierarchy and the usual files

install-commands:
    # We tweak this a little for stage 2 because everything is installed into
    # the one sysroot (/tools). We can symlink /bin. We can't symlink /lib
    # because eglibc install files there that we need to built other stage 3
    # chunks, but we can get away with just symlinking the loader.
    - sh ./create-fhs-dirs "$DESTDIR"

    - rmdir "$DESTDIR/bin"
    - ln -s "$PREFIX/bin" "$DESTDIR/bin"

    # This path is hardcoded into eglibc in the file
    # sysdeps/unix/sysv/linux/configure; this ugly hack is a compromise.
    - |
      cpu=$(echo $TARGET | cut -d '-' -f 1)
      if [ "$cpu" == "x86_64" ]; then
        mkdir -p "$DESTDIR/lib64"
        ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" "$DESTDIR/lib64/ld-linux-x86-64.so.2"
      else
        loader=$(ls /lib/ld-linux*)
        ln -s "$PREFIX$loader" "$DESTDIR$loader"
      fi

    - sh ./create-dev-nodes "$DESTDIR"
    - install -m 644 passwd "$DESTDIR/etc/passwd"
    - install -m 600 shadow "$DESTDIR/etc/shadow"
    - install -m 644 interfaces "$DESTDIR/etc/network/interfaces"
    - install -m 644 group "$DESTDIR/etc/group"
    - install -m 644 ld.so.conf "$DESTDIR/etc/ld.so.conf"
    - install -m 644 issue "$DESTDIR/etc/issue"
    - install -m 644 services "$DESTDIR/etc/services"
    - echo baserock > "$DESTDIR"/etc/hostname