Skip to content

Commit 0be7614

Browse files
authored
Merge pull request #38 from Junnplus/submodule-vde
Add vde-2 submodule for install
2 parents 4659448 + de0bd82 commit 0be7614

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "vde-2"]
2+
path = vde-2
3+
url = https://github.com/virtualsquare/vde-2

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ vde_vmnet: $(OBJS)
2727
install.bin: vde_vmnet
2828
install vde_vmnet "$(DESTDIR)/$(PREFIX)/bin/vde_vmnet"
2929

30+
install.vde-2:
31+
git submodule update --init
32+
cd vde-2 && autoreconf -fis && CFLAGS="" LDFLAGS="" ./configure --prefix=$(VDEPREFIX) && make && make install
33+
3034
install.launchd.plist: launchd/*.plist
3135
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"
3236
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"
@@ -44,12 +48,16 @@ ifneq ($(BRIDGED),)
4448
launchctl load -w "$(DESTDIR)/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.bridged.$(BRIDGED).plist"
4549
endif
4650

47-
install: install.bin install.launchd
51+
install: install.vde-2 install.bin install.launchd
4852

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

57+
.PHONY: uninstall.vde-2
58+
uninstall.vde-2:
59+
cd vde-2 && make uninstall
60+
5361
.PHONY: uninstall.launchd
5462
uninstall.launchd:
5563
launchctl unload -w "$(DESTDIR)/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.plist"
@@ -67,7 +75,7 @@ ifneq ($(BRIDGED),)
6775
rm -f "$(DESTDIR)/Library/LaunchDaemons/io.github.virtualsquare.vde-2.vde_switch.bridged.$(BRIDGED).plist"
6876
endif
6977

70-
uninstall: uninstall.launchd.plist uninstall.bin
78+
uninstall: uninstall.launchd.plist uninstall.bin uninstall.vde-2
7179

7280
.PHONY: clean
7381
clean:

README.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,19 @@
1010

1111
Requires macOS 10.15 or later.
1212

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

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

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

23-
```bash
24-
git clone https://github.com/virtualsquare/vde-2.git
25-
cd vde-2
26-
autoreconf -fis
27-
./configure --prefix=/opt/vde
28-
make
29-
sudo make install
30-
```
31-
32-
### Step 2: Install `vde_vmnet`
33-
```bash
34-
git clone https://github.com/lima-vm/vde_vmnet
35-
cd vde_vmnet
36-
make PREFIX=/opt/vde
37-
sudo make PREFIX=/opt/vde install
38-
```
39-
4024
The following files will be installed:
25+
- `/opt/vde/bin/vde_switch` (from vde-2)
4126
- `/opt/vde/bin/vde_vmnet`
4227
- `/Library/LaunchDaemons/io.github.virtualsquare.vde-2.vde_switch.plist`
4328
- `/Library/LaunchDaemons/io.github.lima-vm.vde_vmnet.plist`
@@ -86,9 +71,9 @@ Use `/var/run/vde.bridged.en0.ctl` as the VDE socket path.
8671
### Testing without launchd
8772

8873
```console
89-
make
74+
sudo make install.vde-2
9075

91-
make install.bin
76+
sudo make install.bin
9277
```
9378

9479
```console

vde-2

Submodule vde-2 added at 74278b9

0 commit comments

Comments
 (0)