diff options
Diffstat (limited to 'sub')
-rw-r--r-- | sub/layout/Makefile | 6 | ||||
-rwxr-xr-x | sub/layout/copylayout | 9 | ||||
-rw-r--r-- | sub/layout/permissions | 12 | ||||
-rw-r--r-- | sub/skarnet.org/Makefile | 20 |
4 files changed, 38 insertions, 9 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 diff --git a/sub/skarnet.org/Makefile b/sub/skarnet.org/Makefile index 4eee9bb..4401128 100644 --- a/sub/skarnet.org/Makefile +++ b/sub/skarnet.org/Makefile @@ -190,7 +190,24 @@ $(OUTPUT)/build-build/.lh_s6dns_installed: $(OUTPUT)/build-build/.lh_s6dns_built exec setuidgid $(NORMALUSER) touch $@ -$(OUTPUT)/build-build/.lh_skarnet_installed: $(OUTPUT)/build-build/.lh_skalibs_installed $(OUTPUT)/build-build/.lh_execline_installed $(OUTPUT)/build-build/.lh_s6pu_installed $(OUTPUT)/build-build/.lh_s6_installed $(OUTPUT)/build-build/.lh_s6li_installed $(OUTPUT)/build-build/.lh_s6dns_installed +$(OUTPUT)/build-build/.lh_s6rc_copied: $(OUTPUT)/sources/.lh_s6rc_cloned + exec setuidgid $(NORMALUSER) rm -rf $(OUTPUT)/build-build/tmp/s6-rc + exec setuidgid $(NORMALUSER) cp -a $(OUTPUT)/sources/s6-rc $(OUTPUT)/build-build/tmp/s6-rc + exec setuidgid $(NORMALUSER) touch $@ + +$(OUTPUT)/build-build/.lh_s6rc_configured: $(OUTPUT)/build-build/.lh_s6rc_copied $(OUTPUT)/build-build/.lh_skalibs_installed $(OUTPUT)/build-build/.lh_execline_installed $(OUTPUT)/build-build/.lh_s6_installed $(OUTPUT)/build-build/.lh_gcc $(OUTPUT)/build-build/.lh_s6_installed + cd $(OUTPUT)/build-build/tmp/s6-rc && setuidgid $(NORMALUSER) env CC="$(BUILD_BUILD_CC)" ./configure --enable-slashpackage --disable-shared --with-sysdeps=$(OUTPUT)/build-build/package/prog/skalibs/sysdeps --with-include=$(OUTPUT)/build-build/package/prog/skalibs/include --with-lib=$(OUTPUT)/build-build/package/prog/skalibs/library --with-include=$(OUTPUT)/build-build/package/admin/execline/include --with-lib=$(OUTPUT)/build-build/package/admin/execline/library --with-include=$(OUTPUT)/build-build/package/admin/s6/include --with-lib=$(OUTPUT)/build-build/package/admin/s6/library + exec setuidgid $(NORMALUSER) touch $@ + +$(OUTPUT)/build-build/.lh_s6rc_built: $(OUTPUT)/build-build/.lh_s6rc_configured $(OUTPUT)/build-build/.lh_skalibs_installed $(OUTPUT)/build-build/.lh_execline_installed $(OUTPUT)/build-build/.lh_s6_installed + cd $(OUTPUT)/build-build/tmp/s6-rc && setuidgid $(NORMALUSER) $(MAKE) all strip + exec setuidgid $(NORMALUSER) touch $@ + +$(OUTPUT)/build-build/.lh_s6rc_installed: $(OUTPUT)/build-build/.lh_s6rc_built + cd $(OUTPUT)/build-build/tmp/s6-rc && setuidgid $(NORMALUSER) $(MAKE) install update global-links DESTDIR=$(OUTPUT)/build-build + exec setuidgid $(NORMALUSER) touch $@ + +$(OUTPUT)/build-build/.lh_skarnet_installed: $(OUTPUT)/build-build/.lh_skalibs_installed $(OUTPUT)/build-build/.lh_execline_installed $(OUTPUT)/build-build/.lh_s6pu_installed $(OUTPUT)/build-build/.lh_s6_installed $(OUTPUT)/build-build/.lh_s6li_installed $(OUTPUT)/build-build/.lh_s6dns_installed $(OUTPUT)/build-build/.lh_s6rc_installed exec setuidgid $(NORMALUSER) touch $@ @@ -314,6 +331,7 @@ $(OUTPUT)/build-host/.lh_s6li_laidout: $(OUTPUT)/build-host/.lh_s6li_installed | exec chmod 02750 $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir/run-image/uncaught-logs exec rm -rf $(OUTPUT)/rootfs/etc/s6-linux-init/current exec mv -f $(OUTPUT)/rootfs/etc/s6-linux-init/s6lidir $(OUTPUT)/rootfs/etc/s6-linux-init/current + for i in `ls -1 $(OUTPUT)/rootfs/etc/s6-linux-init/current/bin` ; do ln -s ../etc/s6-linux-init/current/bin/$$i /bin/$$i ; done exec setuidgid $(NORMALUSER) s6-touch $@ $(OUTPUT)/build-host/.lh_mdevd_copied: $(OUTPUT)/sources/.lh_mdevd_cloned | $(OUTPUT)/build-build/.lh_skarnet_installed |