Skip to content

Commit d1b924a

Browse files
committed
Add: Add custom pacman config
1 parent b627f36 commit d1b924a

3 files changed

Lines changed: 102 additions & 4 deletions

File tree

alteriso5/work/airootfs/chroot.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import (
99
type Chroot struct {
1010
Arch string
1111
Dir string
12+
Config string
1213
initilized bool
1314
}
1415

15-
func GetChrootDir(dir, arch string) (*Chroot, error) {
16+
func GetChrootDir(dir, arch, config string) (*Chroot, error) {
1617
env := Chroot{
1718
Arch: arch,
1819
Dir: dir,
@@ -40,7 +41,7 @@ func (e *Chroot) Init(pkgs ...string) error {
4041
return err
4142
}
4243

43-
args := []string{"-c", e.Dir}
44+
args := []string{"-c", "-C", e.Config, e.Dir}
4445
args = append(args, pkgs...)
4546

4647
slog.Debug("pacstrap", "args", args)

alteriso5/work/work.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ func (w *Work) GetDirs() *dirs {
4141
}
4242

4343
func (w *Work) GetChroot() (*airootfs.Chroot, error) {
44-
return airootfs.GetChrootDir(w.GetDirs().Pacstrap, w.target.Arch)
45-
44+
return airootfs.GetChrootDir(w.GetDirs().Pacstrap, w.target.Arch, path.Join(w.profile.Base, "pacman.conf"))
4645
}
4746

4847
func (w *Work) RunOnce(task *BuildTask) error {

profile/pacman.conf

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#
2+
# /etc/pacman.conf
3+
#
4+
# See the pacman.conf(5) manpage for option and repository directives
5+
6+
#
7+
# GENERAL OPTIONS
8+
#
9+
[options]
10+
# The following paths are commented out with their default values listed.
11+
# If you wish to use different paths, uncomment and update the paths.
12+
#RootDir = /
13+
#DBPath = /var/lib/pacman/
14+
#CacheDir = /var/cache/pacman/pkg/
15+
#LogFile = /var/log/pacman.log
16+
#GPGDir = /etc/pacman.d/gnupg/
17+
#HookDir = /etc/pacman.d/hooks/
18+
HoldPkg = pacman glibc
19+
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
20+
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
21+
#CleanMethod = KeepInstalled
22+
Architecture = auto
23+
24+
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
25+
#IgnorePkg =
26+
#IgnoreGroup =
27+
28+
#NoUpgrade =
29+
#NoExtract =
30+
31+
# Misc options
32+
#UseSyslog
33+
Color
34+
#NoProgressBar
35+
CheckSpace
36+
VerbosePkgLists
37+
ParallelDownloads = 5
38+
ILoveCandy
39+
40+
# By default, pacman accepts packages signed by keys that its local keyring
41+
# trusts (see pacman-key and its man page), as well as unsigned packages.
42+
SigLevel = Required DatabaseOptional
43+
LocalFileSigLevel = Optional
44+
#RemoteFileSigLevel = Required
45+
46+
# NOTE: You must run `pacman-key --init` before first using pacman; the local
47+
# keyring can then be populated with the keys of all official Arch Linux
48+
# packagers with `pacman-key --populate archlinux`.
49+
50+
#
51+
# REPOSITORIES
52+
# - can be defined here or included from another file
53+
# - pacman will search repositories in the order defined here
54+
# - local/custom mirrors can be added here or in separate files
55+
# - repositories listed first will take precedence when packages
56+
# have identical names, regardless of version number
57+
# - URLs will have $repo replaced by the name of the current repo
58+
# - URLs will have $arch replaced by the name of the architecture
59+
#
60+
# Repository entries are of the format:
61+
# [repo-name]
62+
# Server = ServerName
63+
# Include = IncludePath
64+
#
65+
# The header [repo-name] is crucial - it must be present and
66+
# uncommented to enable the repo.
67+
#
68+
69+
# The testing repositories are disabled by default. To enable, uncomment the
70+
# repo name header and Include lines. You can add preferred servers immediately
71+
# after the header, and they will be used before the default mirrors.
72+
73+
#[core-testing]
74+
#Include = /etc/pacman.d/mirrorlist
75+
76+
[core]
77+
Include = /etc/pacman.d/mirrorlist
78+
79+
#[extra-testing]
80+
#Include = /etc/pacman.d/mirrorlist
81+
82+
[extra]
83+
Include = /etc/pacman.d/mirrorlist
84+
85+
# If you want to run 32 bit applications on your x86_64 system,
86+
# enable the multilib repositories as required here.
87+
88+
#[multilib-testing]
89+
#Include = /etc/pacman.d/mirrorlist
90+
91+
[multilib]
92+
Include = /etc/pacman.d/mirrorlist
93+
94+
# An example of a custom package repository. See the pacman manpage for
95+
# tips on creating your own repositories.
96+
#[custom]
97+
#SigLevel = Optional TrustAll
98+
#Server = file:///home/custompkgs

0 commit comments

Comments
 (0)