summaryrefslogtreecommitdiff
path: root/sub/layout/copylayout
blob: 32b991dac337f0012a7790ac74227b32773ae902 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e

output="$1"

s6-hiercopy layout/rootfs $output/rootfs
find "$output/rootfs" -type f -name .empty -size 0c -exec s6-rmrf {} \;

buildtime=$(s6-clock)

hostarch=$(s6-echo $TRIPLE | cut -f1 -d-)
sed -i -e "s/%%HOSTNAME%%/lh-$hostarch/g" $output/rootfs/run/service/s6-linux-init-early-getty/run $output/rootfs/etc/motd $output/rootfs/etc/issue.net $output/rootfs/root/.execline-shell
sed -i -e "s/%%CONSOLE%%/$console/g" $output/rootfs/run/service/s6-linux-init-early-getty/run

s6-mkfifo -m 0600 $output/rootfs/run/service/s6-svscan-log/fifo

while read file user group perms ; do
  if s6-test -n "$file" -a "$file" != "#" ; then
    $output/build-build/command/s6-chown -u $user -g $group -- $output/$file
    $output/build-build/command/s6-chmod $perms $output/$file
  fi
done < sub/layout/permissions