build the squashfs too

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-07-04 21:43:14 +00:00
parent 5c250d475c
commit b5592ce24e
1 changed files with 15 additions and 0 deletions

15
main.go
View File

@ -120,6 +120,8 @@ func main() {
log.Fatal(err)
}
sp := strings.Split(filepath.Base(*tsTarballPath), "_")
binPath, err := exec.LookPath("tar")
if err != nil {
log.Fatal(err)
@ -131,4 +133,17 @@ func main() {
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
{
binPath, err := exec.LookPath("mksquashfs")
if err != nil {
log.Fatal(err)
}
cmd := exec.Command(binPath, tmpDir, fmt.Sprintf("%s/tailscale_sysext_%s.raw", *out, sp[1]), "-quiet", "-noappend", "-all-root", "-root-mode", "755", "-b", "1M", "-comp", "xz", "-Xdict-size", "100%")
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
log.Fatal(err)
}
}
}