Skip to content

Commit d0ccf73

Browse files
committed
Add /opt/vde/bin/vde_vmnet and prerequites to lima-and-qemu tarball
It is kind-of heavy-handed by hardcoding the 2 dependencies, but extending the opensnoop processing just to deal with /opt/vde would be rather convoluted (it would only cover the dylib; the executables have to be added manually anyways). Installation will have to move the `vde` directory from the tarball into a location only root can write to. Signed-off-by: Jan Dubois <[email protected]>
1 parent 278abae commit d0ccf73

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

hack/lima-and-qemu.pl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,28 @@
115115
system("codesign --sign - --force --preserve-metadata=entitlements $file");
116116
}
117117

118-
unlink("$repo_root/$dist.tar.gz");
119118
my $files = join(" ", map s|^$install_dir/||r, keys %deps);
119+
120+
# Package vde_vmnet and prerequisites from /opt/vde → vde in the tarball
121+
my $opt_vde = "/opt/vde";
122+
die if -e "/tmp/$dist/vde";
123+
if (-f "$opt_vde/bin/vde_vmnet") {
124+
my $dylib = "libvdeplug.3.dylib";
125+
system("mkdir -p /tmp/$dist/vde/lib");
126+
system("cp $opt_vde/lib/$dylib /tmp/$dist/vde/lib/$dylib");
127+
$files .= " vde/lib/$dylib";
128+
129+
system("mkdir -p /tmp/$dist/vde/bin");
130+
for my $tool (qw(vde_switch vde_vmnet)) {
131+
system("cp $opt_vde/bin/$tool /tmp/$dist/vde/bin/$tool");
132+
system "install_name_tool -change $opt_vde/lib/$dylib \@executable_path/../$dylib /tmp/$dist/vde/bin/$tool 2>&1";
133+
$files .= " vde/bin/$tool";
134+
}
135+
}
136+
137+
unlink("$repo_root/$dist.tar.gz");
120138
system("tar cvfz $repo_root/$dist.tar.gz -C /tmp/$dist $files");
139+
121140
exit;
122141

123142
# File references may involve multiple symlinks that need to be recorded as well, e.g.

0 commit comments

Comments
 (0)