diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-01-29 15:00:01 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-01-29 15:00:01 +0000 |
commit | 3dcb6c6a73cd16acc7bcae9e54cda16fed89f35b (patch) | |
tree | e2b2b231622470ddc95a74f62b3cebcdcc492914 /sub/layout | |
parent | 5809b2dc1536794cff7df2ab4f79d2fe7b6720bc (diff) | |
download | lh-bootstrap-3dcb6c6a73cd16acc7bcae9e54cda16fed89f35b.tar.xz |
Reimport userfs, rwfs and s6-rc from master
Diffstat (limited to 'sub/layout')
-rw-r--r-- | sub/layout/Makefile | 6 | ||||
-rwxr-xr-x | sub/layout/copylayout | 9 | ||||
-rw-r--r-- | sub/layout/permissions | 12 |
3 files changed, 19 insertions, 8 deletions
diff --git a/sub/layout/Makefile b/sub/layout/Makefile index ed63328..85ac809 100644 --- a/sub/layout/Makefile +++ b/sub/layout/Makefile @@ -3,5 +3,9 @@ $(OUTPUT)/tmp/.lh_layout_copied: $(OUTPUT)/tmp/.lh_prepared layout | $(OUTPUT)/b exec sub/layout/copylayout $(OUTPUT) exec setuidgid $(NORMALUSER) s6-touch $@ -$(OUTPUT)/tmp/.lh_layout_installed: $(OUTPUT)/tmp/.lh_layout_copied | $(OUTPUT)/build-build/.lh_skarnet_installed +$(OUTPUT)/tmp/.lh_layout_s6rcdb_made: $(OUTPUT)/tmp/.lh_layout_copied | $(OUTPUT)/build-build/.lh_skarnet_installed + stamp=$$(s6-clock) && s6-rc-compile -v2 -h sysfdh $(OUTPUT)/rootfs/etc/s6-rc/compiled-$$stamp $(OUTPUT)/rootfs/etc/s6-rc/source-base && s6-ln -s compiled-$$stamp $(OUTPUT)/rootfs/etc/s6-rc/compiled.new && s6-rename $(OUTPUT)/rootfs/etc/s6-rc/compiled.new $(OUTPUT)/rootfs/etc/s6-rc/compiled + exec setuidgid $(NORMALUSER) s6-touch $@ + +$(OUTPUT)/tmp/.lh_layout_installed: $(OUTPUT)/tmp/.lh_layout_copied $(OUTPUT)/tmp/.lh_layout_s6rcdb_made | $(OUTPUT)/build-build/.lh_skarnet_installed exec setuidgid $(NORMALUSER) s6-touch $@ diff --git a/sub/layout/copylayout b/sub/layout/copylayout index 96dad43..01e1574 100755 --- a/sub/layout/copylayout +++ b/sub/layout/copylayout @@ -3,13 +3,17 @@ output="$1" s6-hiercopy layout/rootfs $output/rootfs -chown -R 0:0 $output/rootfs +chown -R 0:0 $output/rootfs $output/rwfs $output/userfs find "$output/rootfs" -type f -name .empty -size 0c -exec s6-rmrf {} \; +s6-hiercopy layout/rwfs $output/rwfs +find "$output/rwfs" -type f -name .empty -size 0c -exec s6-rmrf {} \; +s6-hiercopy layout/userfs $output/userfs +find "$output/userfs" -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/etc/motd $output/rootfs/etc/issue.net $output/rootfs/root/.execline-shell +sed -i -e "s/%%HOSTNAME%%/lh-$hostarch/g" $output/rootfs/etc/motd $output/rootfs/etc/issue.net $output/rootfs/root/.execline-shell $output/rootfs/etc/s6-rc/source-base/00/up while read file user group perms ; do if s6-test -n "$file" -a "$file" != "#" ; then @@ -18,7 +22,6 @@ while read file user group perms ; do fi done < sub/layout/permissions - # If dynamic: copy shared libs from the toolchain into the target if ! ${BUILD_HOST_STATIC} ; then diff --git a/sub/layout/permissions b/sub/layout/permissions index 76f737e..7f3102f 100644 --- a/sub/layout/permissions +++ b/sub/layout/permissions @@ -1,5 +1,9 @@ rootfs/etc/shadow 0 0 0600 -rootfs/tmp 0 0 1777 -rootfs/var/log/klogd 102 61 2700 -rootfs/var/log/ntpclient 106 62 2700 -rootfs/var/log/sshd-4 138 61 2700 + +rwfs/var/tmp 0 0 1777 +rwfs/var/log/klogd 102 61 2700 + +userfs/home/guest 1000 100 2755 +userfs/home/guest/.execline-shell 1000 100 0755 +userfs/home/guest/.execline-loginshell 1000 100 0755 +userfs/home/guest/.ssh 1000 100 2700 |