Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmbootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
pmbootstrap
Commits
16c55eb4
Commit
16c55eb4
authored
4 years ago
by
Anri Dellal
Browse files
Options
Downloads
Patches
Plain Diff
WIP: Add support for multiple arches (untested)
parent
55303c77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pmb/build/menuconfig.py
+12
-6
12 additions, 6 deletions
pmb/build/menuconfig.py
pmb/parse/kconfig.py
+22
-14
22 additions, 14 deletions
pmb/parse/kconfig.py
with
34 additions
and
20 deletions
pmb/build/menuconfig.py
+
12
−
6
View file @
16c55eb4
...
...
@@ -62,17 +62,23 @@ def get_outputdir(args, pkgname, apkbuild):
ret
=
pmb
.
chroot
.
user
(
args
,
[
"
sh
"
,
"
-c
"
,
cmd
],
"
native
"
,
"
/home/pmos/build
"
,
output_return
=
True
).
rstrip
()
if
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/.config
"
):
logging
.
info
(
f
"
DEBUG:
{
apkbuild
[
'
_kconfig_name
'
]
}
"
f
"
arch:
{
apkbuild
[
'
arch
'
][
0
]
}
"
)
if
(
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/.config
"
)
or
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/
{
apkbuild
[
'
_kconfig_name
'
]
}
.
"
f
"
{
apkbuild
[
'
arch
'
][
0
]
}
"
)):
return
ret
# Some Mediatek kernels use a 'kernel' subdirectory
if
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/kernel/.config
"
):
return
os
.
path
.
join
(
ret
,
"
kernel
"
)
# Out-of-tree builds ($_outdir)
if
(
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/
{
apkbuild
[
'
_outdir
'
]
}
/.config
"
)
or
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/
{
apkbuild
[
'
_outdir
'
]
}
/
"
f
"
{
apkbuild
[
'
_kconfig_name
'
]
}
.diff
"
)):
return
os
.
path
.
join
(
ret
,
apkbuild
[
"
_outdir
"
])
outdir
=
apkbuild
[
'
_outdir
'
]
if
(
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/outdir/.config
"
)
or
os
.
path
.
exists
(
f
"
{
chroot
}{
ret
}
/outdir/
"
f
"
{
apkbuild
[
'
_kconfig_name
'
]
}
.
"
f
"
{
apkbuild
[
'
arch
'
][
0
]
}
"
)):
return
os
.
path
.
join
(
ret
,
outdir
)
# Not found
raise
RuntimeError
(
"
Could not find the kernel config. Consider making a
"
...
...
@@ -130,7 +136,7 @@ def menuconfig(args, pkgname):
outputdir
=
get_outputdir
(
args
,
pkgname
,
apkbuild
)
arch_kernel
=
pmb
.
parse
.
arch
.
alpine_to_kernel
(
arch
)
kconfig_name
=
apkbuild
[
"
_kconfig_name
"
]
kconfig_diff
=
f
"
{
kconfig_name
}
.
diff
"
kconfig_diff
=
f
"
{
kconfig_name
}
.
{
arch_kernel
}
"
# Run make menuconfig
logging
.
info
(
f
"
(native) make
{
kopt
}
"
)
...
...
This diff is collapsed.
Click to expand it.
pmb/parse/kconfig.py
+
22
−
14
View file @
16c55eb4
...
...
@@ -128,35 +128,43 @@ def check(args, pkgname, force_anbox_check=False, details=False):
(
"
pmb:kconfigcheck-anbox
"
in
apkbuild
[
"
options
"
]))
kconfig_name
=
apkbuild
[
"
_kconfig_name
"
]
config_arch
=
None
paths
=
None
if
kconfig_name
:
# setup chroot
config_arch
=
apkbuild
[
"
arch
"
][
0
]
pmb
.
build
.
init
(
args
)
depends
=
apkbuild
[
"
makedepends
"
]
depends
+=
[
"
diffconfig
"
,
"
mergeconfig
"
]
paths
=
[]
# setup chroot
pmb
.
build
.
init
(
args
)
pmb
.
chroot
.
apk
.
install
(
args
,
depends
)
pmb
.
build
.
copy_to_buildpath
(
args
,
f
"
linux-
{
flavor
}
"
)
logging
.
info
(
"
(native) extract kernel source
"
)
pmb
.
chroot
.
user
(
args
,
[
"
abuild
"
,
"
unpack
"
],
"
native
"
,
"
/home/pmos/build
"
)
logging
.
info
(
"
(native) apply patches
"
)
pmb
.
chroot
.
user
(
args
,
[
"
abuild
"
,
"
prepare
"
],
"
native
"
,
"
/home/pmos/build
"
,
output
=
"
interactive
"
,
env
=
{
"
CARCH
"
:
config_arch
})
outputdir
=
pmb
.
build
.
menuconfig
.
get_outputdir
(
args
,
f
"
linux-
{
flavor
}
"
,
apkbuild
)
paths
=
[
f
"
{
args
.
work
}
/chroot_native
{
outputdir
}
/.config
"
]
for
arch
in
apkbuild
[
"
arch
"
]:
pmb
.
chroot
.
user
(
args
,
[
"
abuild
"
,
"
prepare
"
],
"
native
"
,
"
/home/pmos/build
"
,
output
=
"
interactive
"
,
env
=
{
"
CARCH
"
:
arch
})
outputdir
=
pmb
.
build
.
menuconfig
.
get_outputdir
(
args
,
f
"
linux-
{
flavor
}
"
,
apkbuild
)
cfg_filename
=
f
"
{
kconfig_name
}
.
{
arch
}
"
pmb
.
chroot
.
user
(
args
,
[
"
cp
"
,
"
.config
"
,
f
"
/tmp/
{
cfg_filename
}
"
],
"
native
"
,
outputdir
)
paths
+=
[
f
"
{
args
.
work
}
/chroot_native/tmp/
{
cfg_filename
}
"
]
pmb
.
chroot
.
user
(
args
,
[
"
make
"
,
"
clean
"
],
"
native
"
,
f
'
/home/pmos/build/src/
{
apkbuild
[
"
builddir
"
]
}
'
)
else
:
paths
=
glob
.
glob
(
f
"
{
aport
}
/config-*
"
)
for
config_path
in
paths
:
# The architecture of the config is in the name, so it just needs to be
# extracted
if
not
kconfig_name
:
config_arch
=
os
.
path
.
basename
(
config_path
).
split
(
"
.
"
)[
1
]
config_path_pretty
=
f
"
linux-
{
flavor
}
/
{
os
.
path
.
basename
(
config_path
)
}
"
config_arch
=
os
.
path
.
basename
(
config_path
).
split
(
"
.
"
)[
1
]
if
kconfig_name
:
config_path_pretty
=
f
"
{
aport
}
/
{
kconfig_name
}
.
{
config_arch
}
"
else
:
config_path_pretty
=
f
"
linux-
{
flavor
}
/
"
\
f
"
{
os
.
path
.
basename
(
config_path
)
}
"
ret
&=
check_config
(
config_path
,
config_path_pretty
,
config_arch
,
pkgver
,
details
=
details
)
if
check_anbox
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment