Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
add vde-2 submodule for install
Browse files Browse the repository at this point in the history
Signed-off-by: Ye Sijun <junnplus@gmail.com>
  • Loading branch information
junnplus committed Mar 10, 2022
1 parent 4659448 commit 2fd1bb6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vde-2"]
path = vde-2
url = https://github.com/virtualsquare/vde-2
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ vde_vmnet: $(OBJS)
install.bin: vde_vmnet
install vde_vmnet "$(DESTDIR)/$(PREFIX)/bin/vde_vmnet"

install.vde-2:
git submodule update --init
cd vde-2 && autoreconf -fis && CFLAGS="" LDFLAGS="" ./configure --prefix=$(VDEPREFIX) && make && make install

install.launchd.plist: launchd/*.plist
sed -e "s@/opt/vde@$(PREFIX)@g" launchd/io.github.virtualsquare.vde-2.vde_switch.plist > "$(DESTDIR)/Library/LaunchDaemons/io.github.virtualsquare.vde-2.vde_switch.plist"
sed -e "s@/opt/vde@$(PREFIX)@g" launchd/io.github.lima-vm.vde_vmnet.plist > "$(DESTDIR)/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.plist"
Expand All @@ -44,12 +48,16 @@ ifneq ($(BRIDGED),)
launchctl load -w "$(DESTDIR)/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.bridged.$(BRIDGED).plist"
endif

install: install.bin install.launchd
install: install.vde-2 install.bin install.launchd

.PHONY: uninstall.bin
uninstall.bin:
rm -f "$(DESTDIR)/$(PREFIX)/bin/vde_vmnet"

.PHONY: uninstall.vde-2
uninstall.vde-2:
cd vde-2 && make uninstall

.PHONY: uninstall.launchd
uninstall.launchd:
launchctl unload -w "$(DESTDIR)/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.plist"
Expand All @@ -67,7 +75,7 @@ ifneq ($(BRIDGED),)
rm -f "$(DESTDIR)/Library/LaunchDaemons/io.github.virtualsquare.vde-2.vde_switch.bridged.$(BRIDGED).plist"
endif

uninstall: uninstall.launchd.plist uninstall.bin
uninstall: uninstall.launchd.plist uninstall.bin uninstall.vde-2

.PHONY: clean
clean:
Expand Down
29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,19 @@

Requires macOS 10.15 or later.

### Step 1: Install vde-2 (`vde_switch`)

The version of `vde-2` must be [commit 74278b9b](https://github.com/virtualsquare/vde-2/tree/74278b9b) (2021-12-12) or later.
Install [vde-2](https://github.com/virtualsquare/vde-2) and vde_vmnet from source.
```bash
sudo make PREFIX=/opt/vde install
```

The `--prefix` dir below does not necessarily need to be `/opt/vde`, however, it is highly recommended
The `PREFIX` dir below does not necessarily need to be `/opt/vde`, however, it is highly recommended
to set the prefix to a directory that can be only written by the root.

Note that `/usr/local` is typically chowned for a non-root user on Homebrew environments, so
`/usr/local` is *not* an appropriate prefix.

```bash
git clone https://github.com/virtualsquare/vde-2.git
cd vde-2
autoreconf -fis
./configure --prefix=/opt/vde
make
sudo make install
```

### Step 2: Install `vde_vmnet`
```bash
git clone https://github.com/lima-vm/vde_vmnet
cd vde_vmnet
make PREFIX=/opt/vde
sudo make PREFIX=/opt/vde install
```

The following files will be installed:
- `/opt/vde/bin/vde_switch` (from vde-2)
- `/opt/vde/bin/vde_vmnet`
- `/Library/LaunchDaemons/io.github.virtualsquare.vde-2.vde_switch.plist`
- `/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.plist`
Expand Down Expand Up @@ -86,7 +71,7 @@ Use `/var/run/vde.bridged.en0.ctl` as the VDE socket path.
### Testing without launchd

```console
make
make install.vde-2

make install.bin
```
Expand Down
1 change: 1 addition & 0 deletions vde-2
Submodule vde-2 added at 74278b

0 comments on commit 2fd1bb6

Please sign in to comment.