summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-04-29 18:39:38 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-04-29 18:39:38 +0200
commitdb3d1c0a3a9240204c1ecbc237023bb517f146fd (patch)
tree47126992e293479137b181ad4a031564205c0512
parent80368ce9bb7b826991bb25efd687ec1122883a1c (diff)
downloadfreebsd-wifibox-alpine-db3d1c0a3a9240204c1ecbc237023bb517f146fd.zip
Try unmounting `linprocfs` to avoid build problems.
-rw-r--r--Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c984cca..49c504c 100644
--- a/Makefile
+++ b/Makefile
@@ -28,12 +28,17 @@ LN=/bin/ln
LS=/bin/ls
GZIP=/usr/bin/gzip
INSTALL_DATA=/usr/bin/install -m $(SHAREMODE)
+ID=/usr/bin/id
+UMOUNT=/sbin/umount
TOUCH=/usr/bin/touch
+TRUE=/usr/bin/true
GIT=$(LOCALBASE)/bin/git
PATCHELF=$(LOCALBASE)/bin/patchelf
BRANDELF=/usr/bin/brandelf
MKSQUASHFS=$(LOCALBASE)/bin/mksquashfs
+UID!= $(ID) -u
+
ELF_INTERPRETER= /lib/ld-musl-x86_64.so.1
APK= sbin/apk
BUSYBOX= bin/busybox
@@ -98,6 +103,11 @@ $(GUESTDIR)/.done:
$(ENV) LD_LIBRARY_PATH=$(BOOTSTRAPDIR)/lib \
$(_BUSYBOX) \
depmod -A -b $(GUESTDIR) $$($(LS) $(GUESTDIR)/lib/modules)
+ # try umounting `linprocfs` if that was mounted (on FreeBSD 13
+ # or later), usually happens for `root`
+.if $(UID) == 0
+ $(UMOUNT) $(GUESTDIR)/proc || $(TRUE)
+.endif
# install extra firmware files manually
.if exists($(PWD)/guest/lib/firmware)
$(CP) -R $(PWD)/guest/lib/firmware/ $(GUESTDIR)/lib/firmware
@@ -137,7 +147,14 @@ $(SQUASHFS_IMG): image-contents
-comp $(SQUASHFS_COMP) \
-wildcards \
$(_EXCLUDE_FW_FILES) \
- -e boot -e "proc/*" -e .done -e "var/*"
+ -e boot \
+ -e "dev/*" \
+ -e "proc/*" \
+ -e "run/*" \
+ -e "sys/*" \
+ -e "tmp/*" \
+ -e "var/*" \
+ -e .done
_TARGETS= $(SQUASHFS_IMG)