forked from Mirror/pmbootstrap
Make proprietary drivers optional (1/2): pmbootstrap changes (#1254)
Here are the changes necessary in pmbootstrap to make proprietary software installed onto the device (firmware and userspace drivers) optional (#756). To full close the issue, we need to apply this concept to all device packages we already have in a follow-up PR. Changes: * New config file options nonfree_firmware and nonfree_userland, which we ask for during "pmbootstrap init" if there are non-free components for the selected device. * We find that out by checking the APKBUILD's subpakages: The non-free packages are called $pkgname-nonfree-firmware and $pkgname-nonfree-userland. * During "pmbootstrap init" we also show the pkgdesc of these subpackages. Parsing that is implemented in pmb.parse._apkbuild.subpkgdesc(). It was not implemented as part of the regular APKBUILD parsing, as this would need a change in the output format, and it is a lot *less* code if done like in this commit. * pmb/parse/apkbuild.py was renamed to _apkbuild.py, and pmb/install/install.py to _install.py: needed to call the function in the usual way (e.g. pmb.parse.apkbuild()) but still being able to test the individual functions from these files in the test suite. We did the same thing for pmb/build/_package.py already. * Install: New function get_nonfree_packages() returns the non-free packages that will be installed, based on the user's choice in "pmbootstrap init" and on the subpackages the device has. * Added test cases and test data (APKBUILDs) for all new code, refactored test/test_questions.py to have multiple functions for testing the various questions / question types from "pmbootstrap init" instead of having it all in one big function. This allows to use another aport folder for testing the new non-free related questions in init.
This commit is contained in:
parent
2e30fa4281
commit
ad5a0d4294
18 changed files with 469 additions and 62 deletions
16
test/testdata/init_questions_device/aports/device/device-lg-mako/APKBUILD
vendored
Normal file
16
test/testdata/init_questions_device/aports/device/device-lg-mako/APKBUILD
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
# This is not a real aport, it's for the "pmbootstrap init" questions test
|
||||
|
||||
pkgname=device-lg-mako
|
||||
pkgver=2
|
||||
pkgrel=16
|
||||
pkgdesc="Google Nexus 4"
|
||||
url="https://github.com/postmarketOS"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="linux-lg-mako mkbootimg mesa-dri-swrast"
|
||||
makedepends=""
|
||||
install=""
|
||||
subpackages="$pkgname-weston"
|
||||
source=""
|
||||
options="!check"
|
||||
|
31
test/testdata/init_questions_device/aports/device/device-lg-mako/deviceinfo
vendored
Normal file
31
test/testdata/init_questions_device/aports/device/device-lg-mako/deviceinfo
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="Google Nexus 4"
|
||||
deviceinfo_manufacturer="LG"
|
||||
deviceinfo_date=""
|
||||
deviceinfo_nonfree="????"
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_external_disk="false"
|
||||
deviceinfo_external_disk_install="false"
|
||||
deviceinfo_flash_method="fastboot"
|
||||
deviceinfo_arch="armhf"
|
||||
|
||||
# Device related
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_screen_width="768"
|
||||
deviceinfo_screen_height="1280"
|
||||
deviceinfo_dev_touchscreen="/dev/input/event2"
|
||||
|
||||
# Fastboot related
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_flash_offset_kernel="0x80208000"
|
||||
deviceinfo_flash_offset_ramdisk="0x81800000"
|
||||
deviceinfo_flash_offset_second="0x81100000"
|
||||
deviceinfo_flash_offset_tags="0x80200100"
|
||||
deviceinfo_flash_pagesize="2048"
|
||||
|
||||
# Weston red screen workaround (see issue #54)
|
||||
deviceinfo_weston_pixman_type="2"
|
33
test/testdata/init_questions_device/aports/device/device-nonfree-firmware-and-userland/APKBUILD
vendored
Normal file
33
test/testdata/init_questions_device/aports/device/device-nonfree-firmware-and-userland/APKBUILD
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname="device-nonfree-firmware-and-userland"
|
||||
pkgdesc="Test device for nonfree questions"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="noarch"
|
||||
options="!check"
|
||||
depends="mesa-dri-swrast"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
subpackages="$pkgname-nonfree-firmware:nonfree_firmware $pkgname-nonfree-userland:nonfree_userland"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
nonfree_firmware() {
|
||||
pkgdesc="firmware description"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
nonfree_userland() {
|
||||
pkgdesc="userland description"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
sha512sums="71c640728d3ade4bea402523c1cdb30e0edac585948cfae987bac9f001a0eb572e5be9ea2babef4eb8f9f6437a3677ce3e7be398e00865a6d3f781a8d4b3bf5d deviceinfo"
|
28
test/testdata/init_questions_device/aports/device/device-nonfree-firmware/APKBUILD
vendored
Normal file
28
test/testdata/init_questions_device/aports/device/device-nonfree-firmware/APKBUILD
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname="device-nonfree-firmware"
|
||||
pkgdesc="Test device for nonfree questions"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="noarch"
|
||||
options="!check"
|
||||
depends="mesa-dri-swrast"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
nonfree_firmware() {
|
||||
pkgdesc="firmware description"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
sha512sums="71c640728d3ade4bea402523c1cdb30e0edac585948cfae987bac9f001a0eb572e5be9ea2babef4eb8f9f6437a3677ce3e7be398e00865a6d3f781a8d4b3bf5d deviceinfo"
|
20
test/testdata/init_questions_device/aports/device/device-nonfree-userland/APKBUILD
vendored
Normal file
20
test/testdata/init_questions_device/aports/device/device-nonfree-userland/APKBUILD
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
pkgname="device-nonfree-userland"
|
||||
pkgdesc="Test device for nonfree questions"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="noarch"
|
||||
options="!check"
|
||||
depends="mesa-dri-swrast"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
subpackages="$pkgname-nonfree-userland:nonfree_userland"
|
||||
|
||||
nonfree_userland() {
|
||||
pkgdesc="userland description"
|
||||
mkdir "$subpkgdir"
|
||||
}
|
||||
|
||||
sha512sums="71c640728d3ade4bea402523c1cdb30e0edac585948cfae987bac9f001a0eb572e5be9ea2babef4eb8f9f6437a3677ce3e7be398e00865a6d3f781a8d4b3bf5d deviceinfo"
|
Loading…
Add table
Add a link
Reference in a new issue