mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-26 04:35:39 +03:00
46 lines
1.6 KiB
Diff
46 lines
1.6 KiB
Diff
From 6973fcc7ac110b2b62c431a091968dc3212fa512 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
|
|
Date: Sat, 11 Jun 2022 16:18:04 +0200
|
|
Subject: [PATCH] generator: Convert constants pointing to directory to
|
|
variables
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
This allows modifying their value via the `-X` flag provided by
|
|
`go tool link`. This eases packaging of Booster as distributions
|
|
which use different paths for these directories don't need to patch
|
|
Booster but instead can set these variables using:
|
|
|
|
go build --ldflags="-X main.consolefontsDir=/foo/bar/…"
|
|
---
|
|
generator/console.go | 2 +-
|
|
generator/generator.go | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/generator/console.go b/generator/console.go
|
|
index 05aeb3b..e66747c 100644
|
|
--- a/generator/console.go
|
|
+++ b/generator/console.go
|
|
@@ -14,7 +14,7 @@ import (
|
|
)
|
|
|
|
// path to console fonts, adjust it to your distro (e.g. Fedora uses /usr/lib/kbd/consolefonts path for it)
|
|
-const consolefontsDir = "/usr/share/kbd/consolefonts/"
|
|
+var consolefontsDir = "/usr/share/kbd/consolefonts/"
|
|
|
|
func (img *Image) enableVirtualConsole(vConsolePath, localePath string) (*VirtualConsole, error) {
|
|
debug("enabling virtual console")
|
|
diff --git a/generator/generator.go b/generator/generator.go
|
|
index fdd92be..474cebc 100644
|
|
--- a/generator/generator.go
|
|
+++ b/generator/generator.go
|
|
@@ -58,7 +58,7 @@ const (
|
|
netStatic
|
|
)
|
|
|
|
-const (
|
|
+var (
|
|
imageModulesDir = "/usr/lib/modules/"
|
|
firmwareDir = "/usr/lib/firmware/"
|
|
)
|