From: dkwo <dkwo@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] booster: update to 0.11
Date: Mon, 08 Jan 2024 12:58:00 +0100 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48122@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 430 bytes --]
There is a new pull request by dkwo against master on the void-packages repository
https://github.com/dkwo/void-packages booster
https://github.com/void-linux/void-packages/pull/48122
booster: update to 0.11
it's not yet possible to run tests inside the build.
tested on my laptop with luks.
build init statically, generator with pie.
A patch file from https://github.com/void-linux/void-packages/pull/48122.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-booster-48122.patch --]
[-- Type: text/x-diff, Size: 6577 bytes --]
From 404994c7b50389d1f034d332261b477d188f7360 Mon Sep 17 00:00:00 2001
From: dkwo <nicolopiazzalunga@gmail.com>
Date: Tue, 28 Nov 2023 16:00:39 -0500
Subject: [PATCH] booster: update to 0.11
---
srcpkgs/booster/patches/fix-target-dir.patch | 40 ---------
srcpkgs/booster/patches/symlink.patch | 85 --------------------
srcpkgs/booster/template | 19 ++---
3 files changed, 7 insertions(+), 137 deletions(-)
delete mode 100644 srcpkgs/booster/patches/fix-target-dir.patch
delete mode 100644 srcpkgs/booster/patches/symlink.patch
diff --git a/srcpkgs/booster/patches/fix-target-dir.patch b/srcpkgs/booster/patches/fix-target-dir.patch
deleted file mode 100644
index 7d17c62899cac..0000000000000
--- a/srcpkgs/booster/patches/fix-target-dir.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From bc988b0c48d337d7b3447ad8a634551ca5080178 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
-Date: Thu, 9 Mar 2023 14:15:21 +0100
-Subject: [PATCH] generator: Fix creation of target directory
-
-This attempts to fix a regression introduced in commit
-e13aa77e49aef93cc1370a269785b471758cb546 since this commit
-the `usr/lib` target directroy is not created if the host system
-does not ship any files in `usr/lib` (e.g. Alpine). This causes
-initramfs images generated on such systems to not be bootable
-as `lib` is a symlink to the non-existend `usr/lib` then.
-
-The problem is the current implementation:
-
- filepath.Dir(filepath.Join(filepath.Dir(l.src), l.target))
-
-Would return `/usr` for `{"/lib", "usr/lib"}` and hence `/usr/lib`
-was never created. I believe this was intended to be:
-
- filepath.Join(filepath.Dir(l.src), l.target)
-
-This commit changes this accordingly and fixes booting Booster
-images on Alpine.
----
- generator/generator.go | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/generator/generator.go b/generator/generator.go
-index 4a030e5..0ab135c 100644
---- a/generator/generator.go
-+++ b/generator/generator.go
-@@ -263,7 +263,7 @@ func appendCompatibilitySymlinks(img *Image) error {
- for _, l := range symlinks {
- // Ensure that target always exist which may not be the
- // case if we only install files from /lib or /bin.
-- targetDir := filepath.Dir(filepath.Join(filepath.Dir(l.src), l.target))
-+ targetDir := filepath.Join(filepath.Dir(l.src), l.target)
- if err := img.AppendDirEntry(targetDir); err != nil {
- return err
- }
diff --git a/srcpkgs/booster/patches/symlink.patch b/srcpkgs/booster/patches/symlink.patch
deleted file mode 100644
index be61fcd98d291..0000000000000
--- a/srcpkgs/booster/patches/symlink.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 7766b079c8fd004fee9d5eba19cb98cac568773b Mon Sep 17 00:00:00 2001
-From: Anatol Pomozov <anatol.pomozov@gmail.com>
-Date: Thu, 23 Mar 2023 18:49:14 -0700
-Subject: [PATCH] generator: Do not rely on user's lookup order for binaries
-
-Until now we used `exec.LookPath` golang function to lookup binaries.
-This function depends on user's $PATH envvar and the order directories
-specified there. This could mess with our image symlink tree.
-
-What we want is to make sure that we lookup/add files at non-symlinked
-directories first (i.e. /usr/bin).
-
-Closes #213
----
- generator/generator.go | 28 ++++++++++++++++++++++++++--
- generator/generator_test.go | 6 ++++++
- 2 files changed, 32 insertions(+), 2 deletions(-)
-
-diff --git a/generator/generator.go b/generator/generator.go
-index 0ab135c..8f0a72f 100644
---- a/generator/generator.go
-+++ b/generator/generator.go
-@@ -5,7 +5,6 @@ import (
- "fmt"
- "net"
- "os"
-- "os/exec"
- "path/filepath"
- "time"
-
-@@ -290,7 +289,7 @@ func (img *Image) appendExtraFiles(binaries ...string) error {
- // If the given name is not an absolute path, assume that it refers
- // to an executable and lookup the path to the executable using $PATH.
- var err error
-- f, err = exec.LookPath(f)
-+ f, err = lookupPath(f)
- if err != nil {
- return err
- }
-@@ -303,6 +302,31 @@ func (img *Image) appendExtraFiles(binaries ...string) error {
- return nil
- }
-
-+func lookupPath(binary string) (string, error) {
-+ paths := []string{
-+ "/usr/bin",
-+ "/usr/sbin",
-+ "/bin",
-+ "/sbin",
-+ "/usr/local/bin",
-+ "/usr/local/sbin",
-+ }
-+
-+ for _, p := range paths {
-+ f := filepath.Join(p, binary)
-+ _, err := os.Stat(f)
-+ if os.IsNotExist(err) {
-+ continue
-+ }
-+ if err != nil {
-+ return "", err
-+ }
-+ return f, nil
-+ }
-+
-+ return "", os.ErrNotExist
-+}
-+
- func findFwFile(fw string) (string, error) {
- supportedFwExt := []string{
- "",
-diff --git a/generator/generator_test.go b/generator/generator_test.go
-index 57b7cce..5938cbc 100644
---- a/generator/generator_test.go
-+++ b/generator/generator_test.go
-@@ -550,3 +550,9 @@ func TestModprobeOptions(t *testing.T) {
- }
- require.Equal(t, expect, cfg.ModprobeOptions)
- }
-+
-+func TestLookupFile(t *testing.T) {
-+ path, err := lookupPath("echo")
-+ require.NoError(t, err)
-+ require.Equal(t, "/usr/bin/echo", path)
-+}
diff --git a/srcpkgs/booster/template b/srcpkgs/booster/template
index 1e904ae1d8664..fd98cae5c5eee 100644
--- a/srcpkgs/booster/template
+++ b/srcpkgs/booster/template
@@ -1,9 +1,10 @@
# Template file for 'booster'
pkgname=booster
-version=0.10
-revision=2
+version=0.11
+revision=1
build_style=go
go_import_path=github.com/anatol/booster
+go_package="${go_import_path}/generator"
hostmakedepends="git ruby-ronn"
depends="busybox-static"
short_desc="Fast and secure initramfs generator"
@@ -11,23 +12,17 @@ maintainer="travankor <travankor@tuta.io>"
license="MIT"
homepage="https://github.com/anatol/booster"
distfiles="https://github.com/anatol/booster/archive/${version}.tar.gz"
-checksum=27a7e40135ceb5504438ce0a45108ef955f5ece197932acc7686fd6c0254565c
+checksum=2f111b1729143c38ec287e5567ae9f57e0fb8118cc11afa22657da8ac9b0105a
conf_files="/etc/booster.yaml"
alternatives="
initramfs:/etc/kernel.d/post-install/20-initramfs:/usr/libexec/booster/kernel-hook-postinst
initramfs:/etc/kernel.d/post-remove/20-initramfs:/usr/libexec/booster/kernel-hook-postrm
"
+export GOFLAGS="-buildmode=pie"
-_build_component() {
- go install -p "$XBPS_MAKEJOBS" -mod=readonly -x
-}
-
-do_build() {
- ( cd generator && _build_component )
- ( cd init && CGO_ENABLED=0 _build_component )
-
+post_build() {
+ ( cd init && CGO_ENABLED=0 go install -p "${XBPS_MAKEJOBS}" -mod=readonly -v -buildmode=default )
ronn docs/manpage.md
-
echo "busybox: true" > booster.yaml
}
next reply other threads:[~2024-01-08 11:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-08 11:58 dkwo [this message]
2024-01-16 17:04 ` dkwo
2024-01-16 17:10 ` ahesford
2024-01-16 17:10 ` [PR PATCH] [Merged]: " ahesford
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48122@inbox.vuxu.org \
--to=dkwo@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).