summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-11-04 20:07:27 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-11-04 20:07:27 +0000
commit74686ff5738ed0443ab68bd1490910c8576a9c17 (patch)
treeab914fcd55ec8519c0379390a858cca4db8d7041
parent366f85bcf4ee29b1e410ef3c53fbe140c71f1293 (diff)
downloadlh-bootstrap-74686ff5738ed0443ab68bd1490910c8576a9c17.tar.xz
fix bearssl, update musl, add socklog
-rw-r--r--Makefile3
-rwxr-xr-xlayout/rootfs/etc/s6-rc/source-base/syslogd/run8
-rwxr-xr-xmake5
-rw-r--r--sub/bearssl/Makefile2
-rw-r--r--sub/musl/Makefile7
-rw-r--r--sub/socklog/Makefile32
-rw-r--r--sub/socklog/patch.sed5
7 files changed, 49 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 0430c58..fc4a000 100644
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,7 @@ $(OUTPUT)/build-build/.lh_done: $(OUTPUT)/build-build/.lh_gcc $(OUTPUT)/build-bu
# The rootfs
-$(OUTPUT)/tmp/.lh_rootfs_installed: $(OUTPUT)/tmp/.lh_layout_installed $(OUTPUT)/build-host/.lh_skarnet_installed $(OUTPUT)/build-host/.lh_bb_installed $(OUTPUT)/build-host/.lh_bbsuid_installed $(OUTPUT)/build-host/.lh_dnscache_installed $(OUTPUT)/build-host/.lh_dropbear_installed $(OUTPUT)/tmp/.lh_initramfs_done $(OUTPUT)/build-host/kernel/.lh_installed
+$(OUTPUT)/tmp/.lh_rootfs_installed: $(OUTPUT)/tmp/.lh_layout_installed $(OUTPUT)/build-host/.lh_skarnet_installed $(OUTPUT)/build-host/.lh_socklog_installed $(OUTPUT)/build-host/.lh_bb_installed $(OUTPUT)/build-host/.lh_bbsuid_installed $(OUTPUT)/build-host/.lh_dnscache_installed $(OUTPUT)/build-host/.lh_dropbear_installed $(OUTPUT)/tmp/.lh_initramfs_done $(OUTPUT)/build-host/kernel/.lh_installed
exec setuidgid $(NORMALUSER) touch $@
@@ -141,6 +141,7 @@ include sub/layout/Makefile
include sub/initramfs/Makefile
include sub/bearssl/Makefile
include sub/skarnet.org/Makefile
+include sub/socklog/Makefile
include sub/busybox/Makefile
include sub/dnscache/Makefile
include sub/dropbear/Makefile
diff --git a/layout/rootfs/etc/s6-rc/source-base/syslogd/run b/layout/rootfs/etc/s6-rc/source-base/syslogd/run
index e3aa36a..1036f5e 100755
--- a/layout/rootfs/etc/s6-rc/source-base/syslogd/run
+++ b/layout/rootfs/etc/s6-rc/source-base/syslogd/run
@@ -1,8 +1,4 @@
#!/command/execlineb -P
-fdmove -c 2 1
+fdclose 0
exec -c
-s6-envuidgid syslog
-fdmove 1 3
-s6-ipcserver -U -1 -- /dev/log
-fdmove -c 1 2
-ucspilogd IPCREMOTEEUID IPCREMOTEEGID
+socklog
diff --git a/make b/make
index 3c958ef..6c767ea 100755
--- a/make
+++ b/make
@@ -23,6 +23,11 @@ USE_TAP=${USE_TAP:-false} # TODO: backend specific, move to backends
USE_VIRTIO_NETWORK=${USE_VIRTIO_NETWORK:-false} # allow end user to choose
USE_VIRTIO_DISK=${USE_VIRTIO_DISK:-false}
+# Properly build musl and friends if the default toolchain produces PIE
+if ${BUILD_BUILD_CC} -dM -E - < /dev/null | grep -qF __PIE__ ; then
+ BUILD_BUILD_CC="$BUILD_BUILD_CC -fPIC"
+fi
+
# By default, give up if all services aren't up 30 seconds after boot.
# This allows shutting down the machine (via s6-poweroff) even if the
# network fails to start, for instance.
diff --git a/sub/bearssl/Makefile b/sub/bearssl/Makefile
index c5029ec..9daa1fd 100644
--- a/sub/bearssl/Makefile
+++ b/sub/bearssl/Makefile
@@ -17,7 +17,7 @@ $(OUTPUT)/build-host/.lh_$(BEARSSL_NAME)_copied: $(OUTPUT)/sources/.lh_$(BEARSSL
exec setuidgid $(NORMALUSER) s6-touch $@
$(OUTPUT)/build-host/.lh_$(BEARSSL_NAME)_built: $(OUTPUT)/build-host/.lh_$(BEARSSL_NAME)_copied $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/build-build/.lh_skarnet_installed
- exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/$(BEARSSL_NAME)-$(BEARSSL_VERSION) $(MAKE) CC=$(TRIPLE)-muslgcc LD=$(TRIPLE)-muslgcc LDDLL=$(TRIPLE)-muslgcc
+ exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/$(BEARSSL_NAME)-$(BEARSSL_VERSION) $(MAKE) lib dll tools CC=$(TRIPLE)-muslgcc LD=$(TRIPLE)-muslgcc LDDLL=$(TRIPLE)-muslgcc
exec setuidgid $(NORMALUSER) s6-touch $@
$(OUTPUT)/build-host/.lh_$(BEARSSL_NAME)_installed: $(OUTPUT)/build-host/.lh_$(BEARSSL_NAME)_built $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed
diff --git a/sub/musl/Makefile b/sub/musl/Makefile
index 0d23c83..b91b834 100644
--- a/sub/musl/Makefile
+++ b/sub/musl/Makefile
@@ -1,10 +1,7 @@
MUSL_BASE ?= /opt/musl-git
-# Version from 2017-07-17
-# MUSL_VERSION := a08910fc2cc739f631b75b2d09b8d72a0d64d285
-
-# Version from 2017-10-31
-MUSL_VERSION := 1b9406b03c0a94ebe2076a8fc1746a8c45e78a83
+# release 1.1.18
+MUSL_VERSION := eb03bde2f24582874cb72b56c7811bf51da0c817
# Build-build
diff --git a/sub/socklog/Makefile b/sub/socklog/Makefile
new file mode 100644
index 0000000..e0c9673
--- /dev/null
+++ b/sub/socklog/Makefile
@@ -0,0 +1,32 @@
+
+$(OUTPUT)/sources/socklog-2.1.0.tar.gz: | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) cd $(OUTPUT)/sources wget http://smarden.org/socklog/socklog-2.1.0.tar.gz
+
+$(OUTPUT)/sources/.lh_socklog_dled: $(OUTPUT)/sources/socklog-2.1.0.tar.gz | $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) s6-touch $@
+
+$(OUTPUT)/build-host/.lh_socklog_copied: $(OUTPUT)/sources/.lh_socklog_dled | $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) s6-rmrf $(OUTPUT)/build-host/package/admin/socklog-2.1.0
+ exec setuidgid $(NORMALUSER) s6-mkdir -p -- $(OUTPUT)/build-host/package
+ exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/package tar zxpvf $(OUTPUT)/sources/socklog-2.1.0.tar.gz
+ exec setuidgid $(NORMALUSER) s6-touch $@
+
+$(OUTPUT)/build-host/.lh_socklog_patched: $(OUTPUT)/build-host/.lh_socklog_copied | $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) sed -f $(WD)/sub/socklog/patch.sed $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src/Makefile > $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src/Makefile.patched
+ exec setuidgid $(NORMALUSER) s6-touch $@
+
+$(OUTPUT)/build-host/.lh_socklog_configured: $(OUTPUT)/build-host/.lh_socklog_copied | $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) s6-echo "muslgcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -include errno.h" > $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src/conf-cc
+ exec setuidgid $(NORMALUSER) s6-echo "muslgcc -s -static" > $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src/conf-ld
+ exec setuidgid $(NORMALUSER) s6-touch $@
+
+$(OUTPUT)/build-host/.lh_socklog_built: $(OUTPUT)/build-host/.lh_socklog_configured $(OUTPUT)/build-host/.lh_socklog_patched $(OUTPUT)/build-host/bin/muslgcc | $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec setuidgid $(NORMALUSER) cd $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src $(MAKE) -f Makefile.patched socklog
+ exec setuidgid $(NORMALUSER) s6-touch $@
+
+$(OUTPUT)/build-host/.lh_socklog_installed: $(OUTPUT)/build-host/.lh_socklog_built | $(OUTPUT)/tmp/.lh_prepared $(OUTPUT)/build-build/.lh_skarnet_installed
+ exec s6-mkdir -p -m 0755 $(OUTPUT)/rootfs/package/admin/socklog-2.1.0/command
+ exec makenamelink $(OUTPUT)/rootfs/package/admin socklog socklog-2.1.0 $(OUTPUT)/tmp
+ exec cp -f $(OUTPUT)/build-host/package/admin/socklog-2.1.0/src/socklog $(OUTPUT)/rootfs/package/admin/socklog-2.1.0/command/socklog
+ exec makelinks $(OUTPUT)/rootfs /command /package/admin/socklog/command
+ exec setuidgid $(NORMALUSER) s6-touch $@
diff --git a/sub/socklog/patch.sed b/sub/socklog/patch.sed
new file mode 100644
index 0000000..0540d27
--- /dev/null
+++ b/sub/socklog/patch.sed
@@ -0,0 +1,5 @@
+s/choose compile load tryshsgr\.c hasshsgr\.h1 hasshsgr\.h2 chkshsgr /choose compile load tryshsgr.c hasshsgr.h1 hasshsgr.h2 /
+s/ar cr /$(TRIPLE)-ar cr /
+s/ranlib /$(TRIPLE)-ranlib /
+s%\./chkshsgr ||%true ||%
+s%\./choose clr tryshsgr hasshsgr\.h1 hasshsgr\.h2 > hasshsgr\.h%cat hasshsgr.h1 > hasshsgr.h%