Skip to content

Commit c5c552d

Browse files
build: Makefile: 'make install' should install the complete package
Rename the old 'install' routine to 'install-kextfs' for generic testing purposes and let the 'install' routine install everything (kext+fs+launchd) and enable the auto-mount.
1 parent 1a683e4 commit c5c552d

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,29 @@ endif
143143
# ---------------------------------------------------------------------------
144144

145145
install:
146+
sudo make uninstall
147+
test -d "$(OUT)/sysfs.kext"
148+
sudo cp -r "$(OUT)/sysfs.kext" "$(EXT_DIR)/sysfs.kext"
149+
sudo chmod -R 755 "$(EXT_DIR)/sysfs.kext"
150+
sudo chown -R root:wheel "$(EXT_DIR)/sysfs.kext"
151+
sudo cp -r "$(OUT)/sysfs.fs" "$(FS_DIR)/sysfs.fs"
152+
sudo chmod -R 755 "$(FS_DIR)/sysfs.fs"
153+
sudo chown -R root:wheel "$(FS_DIR)/sysfs.fs"
154+
@echo "sysfs: installed the kext and mount bundle."
155+
@# Install the LaunchDaemon
156+
sudo install -d -m 755 -o root -g wheel "$(SBIN_DIR)"
157+
sudo install -m 755 -o root -g wheel "tools/$(MOUNT_SCRIPT)" "$(SBIN_DIR)/$(MOUNT_SCRIPT)"
158+
sudo install -m 644 -o root -g wheel "tools/$(DAEMON_PLIST)" "$(DAEMON_DIR)/$(DAEMON_PLIST)"
159+
@# A prior `launchctl disable` persists across boots in launchd's override
160+
@# store and would keep the daemon from starting even though it is RunAtLoad.
161+
-sudo launchctl enable "system/$(DAEMON_LABEL)" 2>/dev/null || true
162+
@# Create the /sys mount point on the read-only system volume via synthetic.conf.
163+
sudo sh -c 'grep -qxF sys "$(SYNTHETIC_CONF)" 2>/dev/null || printf "sys\n" >> "$(SYNTHETIC_CONF)"'
164+
@echo "sysfs: installed the auto-mount LaunchDaemon and ensured 'sys' in $(SYNTHETIC_CONF)."
165+
sudo touch $(ARM_FLAG)
166+
@echo "sysfs: auto-mount endabled at $(ARM_FLAG)"
167+
168+
install-kextfs:
146169
test -d "$(OUT)/sysfs.kext"
147170
sudo cp -r "$(OUT)/sysfs.kext" "$(EXT_DIR)/sysfs.kext"
148171
sudo chmod -R 755 "$(EXT_DIR)/sysfs.kext"
@@ -191,4 +214,4 @@ clean:
191214
$(MAKE) -C fs clean || true
192215
rm -rf $(OUT)
193216

194-
.PHONY: all kextfs install install-daemon uninstall clean
217+
.PHONY: all kextfs install install-kextfs install-daemon uninstall clean

0 commit comments

Comments
 (0)