Skip to content

Commit 15aba00

Browse files
authored
Merge pull request #245 from rancher-sandbox/bundle-vde
Add `/opt/vde/bin/vde_vmnet` and prerequites to lima-and-qemu tarball
2 parents 605b027 + d0ccf73 commit 15aba00

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)