main/postmarketos-mkinitfs: upgrade to 2.6.1 (MR 5636)

Note: this includes a breaking change in pmaports if pmos-initramfs isn't changed to support merging the initramfs+initramfs-extra. Do not cherry-pick without the required initramfs changes!
This commit is contained in:
Clayton Craft 2024-09-27 13:09:55 -07:00
parent 4546b99f5f
commit 5c201c359e
No known key found for this signature in database
GPG Key ID: 4A4CED6D7EDF950A
2 changed files with 5 additions and 67 deletions

View File

@ -1,59 +0,0 @@
From d63e60061419cb1cb1591c9f7f5f238d1201b7f1 Mon Sep 17 00:00:00 2001
From: Clayton Craft <clayton@craftyguy.net>
Date: Sat, 28 Sep 2024 08:11:19 -0700
Subject: [PATCH] add compile-time flag to disable Go GC (MR 56)
I hate this, but it's the only good way I could find to allow working around this ugly QEMU bug:
https://gitlab.com/qemu-project/qemu/-/issues/2560
---
Makefile | 5 +++++
cmd/mkinitfs/main.go | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/Makefile b/Makefile
index e4fbcdd..0b1e841 100644
--- a/Makefile
+++ b/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
diff --git a/cmd/mkinitfs/main.go b/cmd/mkinitfs/main.go
index 138667b..6494504 100644
--- a/cmd/mkinitfs/main.go
+++ b/cmd/mkinitfs/main.go
@@ -9,6 +9,8 @@ import (
"log"
"os"
"path/filepath"
+ "runtime/debug"
+ "strings"
"time"
"gitlab.postmarketos.org/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) }()
--
2.46.2

View File

@ -1,8 +1,8 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-mkinitfs
pkgver=2.5.1
pkgrel=2
pkgver=2.6.1
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
depends="
@ -27,7 +27,6 @@ triggers="$pkgname.trigger=\
source="
https://gitlab.postmarketos.org/postmarketOS/postmarketos-mkinitfs/-/archive/$pkgver/postmarketos-mkinitfs-$pkgver.tar.gz
https://gitlab.com/api/v4/projects/postmarketOS%2Fpostmarketos-mkinitfs/packages/generic/mkinitfs-vendor-$pkgver/$pkgver/mkinitfs-vendor-$pkgver.tar.gz
0001-add-compile-time-flag-to-disable-Go-GC-MR-56.patch
"
install="$pkgname.post-upgrade"
@ -50,8 +49,7 @@ prepare() {
build() {
unset LDFLAGS # passed to Go as linker flags, which are invalid
# Go garbage collector malfunctions when running x86_64 binaries in QEMU on
# an aarch64 host. See: https://gitlab.com/qemu-project/qemu/-/issues/2560
# For https://gitlab.com/qemu-project/qemu/-/issues/2560
case "$CARCH" in
x86_64)
make VERSION="$pkgver" DISABLE_GOGC=1 ;;
@ -69,7 +67,6 @@ check() {
}
sha512sums="
6f2e5c8281a8e6b340f2288b31fb102dcc98480e8bf905bf57a54a81d36a5615b194f0a56f5cd3be207784278257eb6ee3dfecaccb60c3332f4d0f45bafedaa3 postmarketos-mkinitfs-2.5.1.tar.gz
420e4bd8126f765c18b3ea48b2dc7356727958826dbe1086b753f5d46bc9b56d25ed668db8f9f4e8c9d5b1e943105850071c9c3ce442daf12eaa80516e973372 mkinitfs-vendor-2.5.1.tar.gz
2c7b95ba05fed50a05338e0300d0330f9ac82c649345553015f867dad947738c2729780e5a26585cc32180999fd8b1ecffaff0e8117c8c817b79d7119b0fdc14 0001-add-compile-time-flag-to-disable-Go-GC-MR-56.patch
53b69dcd4ad09439e9c4449947e374db714b4b5acf5847fa8fdac024e3e9803ecd9f0ea7170a696cc878cd883fda46e1e6076ea6f7936ef1166d942a1bb2ffc0 postmarketos-mkinitfs-2.6.1.tar.gz
5b96cfbfc652d744a717d19c17b446ef94f09b00152a7620112a66709057fa56f203855519ed53b948f79424715fc20b93d44aaa38051fac9ceb7eda586020b3 mkinitfs-vendor-2.6.1.tar.gz
"