Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4e771ab96f | ||
|
4d7dd79bcf | ||
|
d63e600614 |
5
Makefile
5
Makefile
@@ -13,6 +13,11 @@ GOFLAGS?=
|
||||
LDFLAGS+=-s -w -X main.Version=$(VERSION)
|
||||
RM?=rm -f
|
||||
GOTEST=go test -count=1 -race
|
||||
DISABLE_GOGC?=
|
||||
|
||||
ifeq ($(DISABLE_GOGC),1)
|
||||
LDFLAGS+=-X main.DisableGC=true
|
||||
endif
|
||||
|
||||
GOSRC!=find * -name '*.go'
|
||||
GOSRC+=go.mod go.sum
|
||||
|
@@ -9,6 +9,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitlab.com/postmarketOS/postmarketos-mkinitfs/internal/archive"
|
||||
@@ -26,8 +28,14 @@ import (
|
||||
|
||||
// set at build time
|
||||
var Version string
|
||||
var DisableGC string
|
||||
|
||||
func main() {
|
||||
// To allow working around silly GC-related issues, like https://gitlab.com/qemu-project/qemu/-/issues/2560
|
||||
if strings.ToLower(DisableGC) == "true" {
|
||||
debug.SetGCPercent(-1)
|
||||
}
|
||||
|
||||
retCode := 0
|
||||
defer func() { os.Exit(retCode) }()
|
||||
|
||||
|
@@ -40,11 +40,6 @@ func MergeUsr(file string) string {
|
||||
}
|
||||
}
|
||||
|
||||
// Convert /usr/sbin --> /usr/bin
|
||||
if part, found := strings.CutPrefix(file, "/usr/sbin"); found {
|
||||
file = filepath.Join("/usr/bin/", part)
|
||||
}
|
||||
|
||||
return file
|
||||
}
|
||||
|
||||
|
@@ -18,11 +18,11 @@ func TestMergeUsr(t *testing.T) {
|
||||
},
|
||||
{
|
||||
in: "/sbin/foo",
|
||||
expected: "/usr/bin/foo",
|
||||
expected: "/usr/sbin/foo",
|
||||
},
|
||||
{
|
||||
in: "/usr/sbin/foo",
|
||||
expected: "/usr/bin/foo",
|
||||
expected: "/usr/sbin/foo",
|
||||
},
|
||||
{
|
||||
in: "/usr/bin/foo",
|
||||
|
@@ -4,4 +4,4 @@ deviceinfo_uboot_boardname="foobar-bazz"
|
||||
deviceinfo_initfs_compression="zstd:--foo=1 -T0 --bar=bazz"
|
||||
# empty option
|
||||
deviceinfo_initfs_extra_compression=""
|
||||
deviceinfo_create_initfs_extra="true"
|
||||
deviceinfo_create_initfs_extra="true" # in-line comment that should be ignored
|
||||
|
Reference in New Issue
Block a user