summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2022-05-28 12:44:37 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2022-05-31 22:02:42 +0200
commit97c67abab07a57840f95d04fadbd13b3c0f5b328 (patch)
treecdd484a2af71b89ff7a75c5eb808e6e18f00801d /Makefile
parenta6085330a18c8a257d2e185aab016c483335f86a (diff)
downloadfreebsd-wifibox-alpine-97c67abab07a57840f95d04fadbd13b3c0f5b328.zip
Incorporate `hostapd`.
The inclusion of `hostapd` [1] brings a lot of related changes because the build process have to extended to take the challenge. - Convert `wpa_passthru` to a more a generic services, called `uds_passthru` to deal with the control socket forwarding. It can also log the `socat` errors properly. - Make the `Makefile` more parametric therefore the virtual disk image can be customized better. - Default configurations are now moved fully to the guest's side. - Tweak the packages to be more flexible. - Document everything. [1] https://w1.fi/hostapd/
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 49c504c..9671c20 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,10 @@ PREFIX?=/usr/local
LOCALBASE?=/usr/local
MINIROOTFS?=$(PWD)/alpine-minirootfs.tar.gz
PACKAGES?=$(PWD)/*.apk
+BOOT_SERVICES?=networking urandom bootmisc modules hostname hwclock sysctl syslog
+DEFAULT_SERVICES?=acpid crond
+SYSINIT_SERVICES?=devfs dmesg hwdrivers mdev
+ETC_SRCS?=$(PWD)/etc/wpa_supplicant
ROOT=$(PREFIX)/share/wifibox
SHAREDIR=$(DESTDIR)$(ROOT)
@@ -17,6 +21,7 @@ BOOTDIR=$(GUESTDIR)/boot
SHAREMODE?=0644
+ECHO=/bin/echo
ENV=/usr/bin/env
MKDIR=/bin/mkdir
CP=/bin/cp
@@ -54,11 +59,6 @@ SQUASHFS_COMP?= lzo
SQUASHFS_IMG= $(PWD)/alpine-$(VERSION).squashfs.img
SQUASHFS_VMLINUZ= $(BOOTDIR)/vmlinuz*
-BOOT_SERVICES= networking urandom bootmisc modules hostname hwclock sysctl syslog \
- wpa_supplicant wpa_passthru
-DEFAULT_SERVICES= acpid crond iptables udhcpd
-SYSINIT_SERVICES= devfs dmesg hwdrivers mdev
-
.if !defined(VERSION)
VERSION!= $(GIT) describe --tags --always
.endif
@@ -108,9 +108,9 @@ $(GUESTDIR)/.done:
.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
+ # install extra files manually
+.if exists($(PWD)/guest)
+ $(CP) -R $(PWD)/guest/ $(GUESTDIR)
.endif
# rc-update add
.for runlevel in boot default sysinit
@@ -118,6 +118,13 @@ $(GUESTDIR)/.done:
$(LN) -s /etc/init.d/${service} $(GUESTDIR)/etc/runlevels/${runlevel}
.endfor
.endfor
+ # add extra file system pass-through mounts
+.if defined(EXTRA_VIRTFS_MOUNTS)
+.for mnt in $(EXTRA_VIRTFS_MOUNTS)
+ $(ECHO) "${mnt:C@:@ @} 9p trans=virtio,rw 0 0" \
+ >> $(GUESTDIR)/etc/fstab
+.endfor
+.endif
$(TOUCH) $(GUESTDIR)/.done
image-contents: $(GUESTDIR)/.done
@@ -167,7 +174,7 @@ install:
$(SED) ${_SUB_LIST_EXP} share/grub.cfg > $(SHAREDIR)/grub.cfg
$(MKDIR) -p $(ETCDIR)
- $(CP) etc/* $(ETCDIR)/
+ $(CP) -R $(ETC_SRCS)/* $(ETCDIR)/
$(MKDIR) -p $(MANDIR)/man5
$(SED) ${_SUB_LIST_EXP} man/wifibox-alpine.5 \