menuconfig: add gconfig/xconfig support (#1509)

* change "pmbootstrap kconfig_check" to "pmbootstrap kconfig check"
* change "pmbootstrap menuconfig" to "pmbootstrap kconfig edit [-x|-g]"
  (with legacy alias, because the first syntax was referenced to a lot)
* enable X11 interfaces: -x: xconfig, -g: gconfig
* new function to copy the xauthority file:
  pmb.chroot.other.copy_xauthority()
* remove menufconfig() function from the kernel template and all kernel
  aports ([skip ci] because it would rebuild all kernels and run out of
  time). Alpine has dropped this as well, and it wouldn't work with the
  new code anyway.
This commit is contained in:
steamport 2018-06-09 02:52:24 -04:00 committed by Oliver Smith
parent 98d7376800
commit 30df0725ca
95 changed files with 138 additions and 611 deletions

3
.gitignore vendored
View File

@ -110,3 +110,6 @@ ENV/
# Pytest
.pytest_cache
# JetBrains IDEs (PyCharm, etc)
.idea

View File

@ -28,8 +28,8 @@ yes "" | ./pmbootstrap.py init
fold_end "init"
# pmbootstrap kconfig_check
fold_start "kconfig_check" "pmbootstrap kconfig_check"
./pmbootstrap.py kconfig_check
fold_start "kconfig_check" "pmbootstrap kconfig check"
./pmbootstrap.py kconfig check
fold_end "kconfig_check"
# pmbootstrap build --strict

View File

@ -81,12 +81,12 @@ $ pmbootstrap bootimg_analyze ~/Downloads/twrp-3.2.1-0-fp2.img
Check kernel configs:
```
$ pmbootstrap kconfig_check
$ pmbootstrap kconfig check
```
Edit a kernel config:
```
$ pmbootstrap menuconfig --arch=armhf postmarketos-mainline
$ pmbootstrap kconfig edit --arch=armhf postmarketos-mainline
```
### System Image

View File

@ -75,15 +75,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -63,13 +63,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -78,15 +78,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -46,12 +46,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -82,16 +82,6 @@ prepare() {
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -42,12 +42,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp out/.config "$startdir"/$_config
}
build() {
unset LDFLAGS
rm .config # Avoid complaints that the source is not clean

View File

@ -46,12 +46,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -76,16 +76,6 @@ prepare() {
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -35,12 +35,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -78,16 +78,6 @@ prepare() {
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -52,12 +52,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS

View File

@ -52,12 +52,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -44,12 +44,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -43,12 +43,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -74,16 +74,6 @@ prepare() {
oldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build || return 1
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -77,15 +77,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -58,13 +58,6 @@ prepare() {
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -43,12 +43,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -79,15 +79,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -37,12 +37,6 @@ prepare() {
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -46,12 +46,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -46,12 +46,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -60,12 +60,6 @@ prepare() {
sed -i "s/\$(shell git describe --dirty)/$_wlan_commit/g" drivers/net/wireless/wl12xx/Makefile
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$builddir"
unset LDFLAGS

View File

@ -78,15 +78,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -43,12 +43,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -84,15 +84,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -80,15 +80,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build || return 1
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -80,15 +80,6 @@ prepare() {
oldconfig
}
# this is so we can do `abuild menuconfig` to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -94,15 +94,6 @@ prepare() {
oldconfig
}
# this is so we can do `abuild menuconfig` to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
echo "--[ menuconfig ]--"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -44,12 +44,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -52,12 +52,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -51,12 +51,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -102,16 +102,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
#ARCH="$_carch" "$ksrcdir"/scripts/kconfig/merge_config.sh "$ksrcdir"/arch/arm/config/latona_defconfig "$ksrcdir"/android/configs/android-base.cfg "$ksrcdir"/android/configs/android-recommended.cfg
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -57,12 +57,6 @@ prepare() {
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -96,15 +96,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -44,12 +44,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -78,13 +78,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -46,12 +46,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -37,12 +37,6 @@ prepare() {
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -42,12 +42,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -42,12 +42,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -84,15 +84,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -54,13 +54,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -44,12 +44,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -50,12 +50,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -79,15 +79,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -36,12 +36,6 @@ prepare() {
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -77,15 +77,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -42,12 +42,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -53,12 +53,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -80,15 +80,6 @@ prepare() {
silentoldconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -82,12 +82,6 @@ prepare() {
silentoldconfig
}
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -80,15 +80,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -45,12 +45,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -51,12 +51,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -43,12 +43,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -52,12 +52,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -47,12 +47,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -48,12 +48,6 @@ prepare() {
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \

View File

@ -73,15 +73,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -66,15 +66,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -79,15 +79,6 @@ prepare() {
olddefconfig
}
# this is so we can do: 'abuild menuconfig' to reconfigure kernel
menuconfig() {
cd "$srcdir"/build
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {
cd "$srcdir"/build
unset LDFLAGS

View File

@ -31,9 +31,8 @@ _pmbootstrap_targets()
find $PMBOOTSTRAP_DIR/aports/ -mindepth 2 -maxdepth 2 -type d \
-printf '%f\n' | sed "s|$PMBOOTSTRAP_DIR/aports/||g"
;;
kconfig_check|menuconfig)
ls -1 $PMBOOTSTRAP_DIR/aports/*/ | grep linux- \
| sed 's/linux-//g'
kconfig)
echo edit check
;;
flasher)
echo boot flash_kernel flash_rootfs sideload list_flavors \

View File

@ -114,12 +114,6 @@ def generate_apkbuild(args, pkgname, deviceinfo):
yes "" | make ARCH="$_carch" HOSTCC="$HOSTCC" oldconfig
}
menuconfig() {
cd "$builddir"
make ARCH="$_carch" menuconfig
cp .config "$startdir"/$_config
}
build() {""" + build + """
}

View File

@ -24,6 +24,7 @@ import pmb.build.autodetect
import pmb.build.checksum
import pmb.chroot
import pmb.chroot.apk
import pmb.chroot.other
import pmb.helpers.run
import pmb.parse
@ -58,7 +59,7 @@ def menuconfig(args, pkgname):
# Pkgname: allow omitting "linux-" prefix
if pkgname.startswith("linux-"):
pkgname_ = pkgname.split("linux-")[1]
logging.info("PROTIP: You can simply do 'pmbootstrap menuconfig " +
logging.info("PROTIP: You can simply do 'pmbootstrap kconfig edit " +
pkgname_ + "'")
else:
pkgname = "linux-" + pkgname
@ -67,12 +68,29 @@ def menuconfig(args, pkgname):
aport = pmb.build.find_aport(args, pkgname)
apkbuild = pmb.parse.apkbuild(args, aport + "/APKBUILD")
arch = get_arch(args, apkbuild)
kopt = "menuconfig"
# Set up build tools and makedepends
pmb.build.init(args)
depends = apkbuild["makedepends"] + ["ncurses-dev"]
depends = apkbuild["makedepends"]
kopt = "menuconfig"
copy_xauth = False
if args.xconfig:
depends += ["qt-dev", "font-noto"]
kopt = "xconfig"
copy_xauth = True
elif args.gconfig:
depends += ["gtk+2.0-dev", "glib-dev", "libglade-dev", "font-noto"]
kopt = "gconfig"
copy_xauth = True
else:
depends += ["ncurses-dev"]
pmb.chroot.apk.install(args, depends)
# Copy host's .xauthority into native
if copy_xauth:
pmb.chroot.other.copy_xauthority(args)
# Patch and extract sources
pmb.build.copy_to_buildpath(args, pkgname)
logging.info("(native) extract kernel source")
@ -81,17 +99,23 @@ def menuconfig(args, pkgname):
pmb.chroot.user(args, ["abuild", "prepare"], "native",
"/home/pmos/build", log=False, env={"CARCH": arch})
# Run abuild menuconfig
logging.info("(native) run menuconfig")
pmb.chroot.user(args, ["abuild", "-d", "menuconfig"], "native",
"/home/pmos/build", log=False, env={"CARCH": arch})
# Run make menuconfig
srcdir = "/home/pmos/build/src"
logging.info("(native) make " + kopt)
pmb.chroot.user(args, ["make", kopt], "native",
srcdir + "/build", log=False,
env={"ARCH": pmb.parse.arch.alpine_to_kernel(arch),
"DISPLAY": os.environ.get("DISPLAY"),
"XAUTHORITY": "/home/pmos/.Xauthority"})
# Update config + checksums
config = "config-" + apkbuild["_flavor"] + "." + arch
logging.info("Copy kernel config back to aport-folder")
source = args.work + "/chroot_native/home/pmos/build/" + config
# Find the updated config
source = args.work + "/chroot_native" + srcdir + "/build/.config"
if not os.path.exists(source):
raise RuntimeError("No kernel config generated: " + source)
# Update the aport (config and checksum)
logging.info("Copy kernel config back to aport-folder")
config = "config-" + apkbuild["_flavor"] + "." + arch
target = aport + "/" + config
pmb.helpers.run.user(args, ["cp", source, target])
pmb.build.checksum(args, pkgname)

View File

@ -99,7 +99,7 @@ def init(args, suffix="native"):
# Building chroots: create "pmos" user, add symlinks to /home/pmos
if not suffix.startswith("rootfs_"):
pmb.chroot.root(args, ["adduser", "-D", "pmos", "-u",
pmb.config.chroot_uid_user], suffix, auto_init=False)
pmb.config.chroot_uid_user], suffix, auto_init=False)
# Create the links (with subfolders if necessary)
for target, link_name in pmb.config.chroot_home_symlinks.items():

View File

@ -18,6 +18,7 @@ along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import glob
import logging
import pmb.chroot.apk
import pmb.install
@ -63,3 +64,33 @@ def tempfolder(args, path, suffix="native"):
pmb.chroot.root(args, ["rm", "-r", path])
pmb.chroot.user(args, ["mkdir", "-p", path])
return path
def copy_xauthority(args):
"""
Copy the host system's Xauthority file to the pmos user inside the chroot,
so we can start X11 applications from there.
"""
# Check $DISPLAY
logging.info("(native) copy host Xauthority")
if not os.environ.get("DISPLAY"):
raise RuntimeError("Your $DISPLAY variable is not set. If you have an"
" X11 server running as your current user, try"
" 'export DISPLAY=:0' and run your last"
" pmbootstrap command again.")
# Check $XAUTHORITY
original = os.environ.get("XAUTHORITY")
if not original:
original = os.path.join(os.environ['HOME'], '.Xauthority')
if not os.path.exists(original):
raise RuntimeError("Could not find your Xauthority file, try to export"
" your $XAUTHORITY correctly. Looked here: " +
original)
# Copy to chroot and chown
copy = args.work + "/chroot_native/home/pmos/.Xauthority"
if os.path.exists(copy):
pmb.helpers.run.root(args, ["rm", copy])
pmb.helpers.run.root(args, ["cp", original, copy])
pmb.chroot.root(args, ["chown", "pmos:pmos", "/home/pmos/.Xauthority"])

View File

@ -188,6 +188,9 @@ def export(args):
def menuconfig(args):
logging.warning("WARNING: 'pmbootstrap menuconfig' is deprecated and will"
" soon be removed. Please use 'pmbootstrap kconfig edit'"
" instead.")
pmb.build.menuconfig(args, args.package)
@ -233,23 +236,30 @@ def newapkbuild(args):
pmb.build.newapkbuild(args, args.folder, pass_through, args.force)
def kconfig_check(args):
# Default to all kernel packages
packages = args.packages
if not packages:
for aport in glob.glob(args.aports + "/*/linux-*"):
packages.append(os.path.basename(aport).split("linux-")[1])
def kconfig(args):
if args.action_kconfig == "check":
# Default to all kernel packages
packages = []
if args.package == "" or args.package is None:
for aport in glob.glob(args.aports + "/*/linux-*"):
packages.append(os.path.basename(aport).split("linux-")[1])
else:
packages = [args.package]
# Iterate over all kernels
error = False
packages.sort()
for package in packages:
if not pmb.parse.kconfig.check(args, package, details=True):
error = True
# Iterate over all kernels
error = False
packages.sort()
for package in packages:
if not pmb.parse.kconfig.check(args, package, details=True):
error = True
# At least one failure
if error:
raise RuntimeError("kconfig_check failed!")
# At least one failure
if error:
raise RuntimeError("kconfig check failed!")
else:
logging.info("kconfig check succeded!")
elif args.action_kconfig == "edit":
pmb.build.menuconfig(args, args.package)
def apkbuild_parse(args):

View File

@ -152,7 +152,7 @@ def auto(args, dry=False):
# Only increase once!
if origin in ret:
logging.verbose("{}: origin '{}' found again".format(pkgname,
origin))
origin))
continue
aport_path = pmb.build.other.find_aport(args, origin, False)
if not aport_path:

View File

@ -172,7 +172,7 @@ def configure_apk(args):
# Disable pmbootstrap repository
pmb.helpers.run.root(args, ["sed", "-i", "/\/mnt\/pmbootstrap-packages/d",
rootfs + "/etc/apk/repositories"])
rootfs + "/etc/apk/repositories"])
pmb.helpers.run.user(args, ["cat", rootfs + "/etc/apk/repositories"])
@ -274,7 +274,7 @@ def setup_hostname(args):
# Update /etc/hosts
suffix = "rootfs_" + args.device
pmb.chroot.root(args, ["sh", "-c", "echo " + shlex.quote(hostname) +
" > /etc/hostname"], suffix)
" > /etc/hostname"], suffix)
regex = ("s/^127\.0\.0\.1.*/127.0.0.1\t" + re.escape(hostname) +
" localhost.localdomain localhost/")
pmb.chroot.root(args, ["sed", "-i", "-e", regex, "/etc/hosts"], suffix)
@ -389,7 +389,7 @@ def install(args):
# List all packages to be installed (including the ones specified by --add)
# and upgrade the installed packages/apkindexes
logging.info('*** (2/{0}) CREATE DEVICE ROOTFS ("{1}") ***'.format(steps,
args.device))
args.device))
install_packages = (pmb.config.install_device_packages +
["device-" + args.device] +
get_kernel_package(args, args.device) +

View File

@ -39,7 +39,7 @@ def previous_install(args):
pmb.helpers.mount.bind_blockdevice(args, blockdevice_outside,
args.work + "/chroot_native" + blockdevice_inside)
label = pmb.chroot.root(args, ["blkid", "-s", "LABEL", "-o", "value",
blockdevice_inside], return_stdout=True)
blockdevice_inside], return_stdout=True)
pmb.helpers.run.root(args, ["umount", args.work + "/chroot_native" + blockdevice_inside])
return "pmOS_boot" in label

View File

@ -185,6 +185,35 @@ def arguments_newapkbuild(subparser):
" download link to the source archive")
def arguments_kconfig(subparser):
# Allowed architectures
arch_native = pmb.parse.arch.alpine_native()
arch_choices = set(pmb.config.build_device_architectures + [arch_native])
# Kconfig subparser
ret = subparser.add_parser("kconfig", help="change or edit kernel configs")
sub = ret.add_subparsers(dest="action_kconfig")
sub.required = True
# "pmbootstrap kconfig check"
check = sub.add_parser("check", help="check kernel aport config")
check.add_argument("--arch", choices=arch_choices, dest="arch")
check.add_argument("package", default="", nargs='?')
# "pmbootstrap kconfig edit" (legacy: "pmbootstrap menuconfig")
legacy_menuconfig = subparser.add_parser("menuconfig")
edit = sub.add_parser("edit", help="edit kernel aport config")
for parser in [edit, legacy_menuconfig]:
parser.add_argument("--arch", choices=arch_choices, dest="arch")
parser.add_argument("-x", dest="xconfig", action="store_true",
help="use xconfig rather than ncurses for kernel"
" configuration")
parser.add_argument("-g", dest="gconfig", action="store_true",
help="use gconfig rather than ncurses for kernel"
" configuration")
parser.add_argument("package")
def arguments():
parser = argparse.ArgumentParser(prog="pmbootstrap")
arch_native = pmb.parse.arch.alpine_native()
@ -243,6 +272,7 @@ def arguments():
sub.add_parser("work_migrate", help="run this before using pmbootstrap"
" non-interactively to migrate the"
" work folder version on demand")
arguments_kconfig(sub)
arguments_export(sub)
arguments_flasher(sub)
arguments_initfs(sub)
@ -351,12 +381,6 @@ def arguments():
help="do not overwrite the existing kernel",
action="store_false", dest="recovery_flash_kernel")
# Action: menuconfig
menuconfig = sub.add_parser("menuconfig", help="run menuconfig on"
" a kernel aport")
menuconfig.add_argument("--arch", choices=arch_choices)
menuconfig.add_argument("package")
# Action: checksum / aportgen / build
checksum = sub.add_parser("checksum", help="update aport checksums")
aportgen = sub.add_parser("aportgen", help="generate a postmarketOS"

View File

@ -43,7 +43,7 @@ def check(args, pkgname, details=False):
# Pkgname: allow omitting "linux-" prefix
if pkgname.startswith("linux-"):
flavor = pkgname.split("linux-")[1]
logging.info("PROTIP: You can simply do 'pmbootstrap kconfig_check " +
logging.info("PROTIP: You can simply do 'pmbootstrap kconfig check " +
flavor + "'")
else:
flavor = pkgname
@ -90,7 +90,7 @@ def check(args, pkgname, details=False):
else:
logging.warning("WARNING: " + path + " isn't configured"
" properly for postmarketOS, run"
" 'pmbootstrap kconfig_check' for"
" 'pmbootstrap kconfig check' for"
" details!")
break
return ret

View File

@ -39,7 +39,7 @@ def test_chroot_interactive_shell_user():
pmb_src = os.path.realpath(os.path.join(os.path.dirname(__file__) + "/.."))
os.chdir(pmb_src)
ret = subprocess.check_output(["./pmbootstrap.py", "-q", "chroot",
"--user"], timeout=300, input="id -un",
"--user"], timeout=300, input="id -un",
universal_newlines=True,
stderr=subprocess.STDOUT)
assert ret == "pmos\n"