Commit Graph

44 Commits

Author SHA1 Message Date
Jami Kettunen 90ae7f3a79
pmb.aportgen.linux: Depend on findutils
Without this on newer kernels the following is emitted during kernel
build (though it still appears to build a package fine):

  find: unrecognized: -printf
  BusyBox v1.36.0 (2023-03-03 16:36:18 UTC) multi-call binary.
  ...

See also: https://gitlab.com/postmarketOS/pmaports/-/issues/910

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C167855488981.11771.14125941910883500913-0@git.sr.ht%3E
2023-03-12 17:20:55 +01:00
Oliver Smith 9975d373b0
Bump copyright to 2023 2023-01-22 19:18:06 +01:00
Jami Kettunen 5b3cd7a7a6
pmb.aportgen.linux: Install DTBs on header v2 (MR 2194)
A single DTB is required for "mkbootimg --dtb ..."
2022-07-18 14:49:38 -07:00
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
BO41 944f539dd6
args.logfd: remove (MR 2114)
Replace "args.logfd" with "pmb.helpers.logging.logfd" in order to avoid
passing "args" to all functions that only use it to write to logfd. This
is the first step to get rid of this args-passed-to-all-functions
pattern in pmbootstrap.
2021-10-10 16:59:17 +02:00
BO41 77d39ecdf1
lint: enforce max line length (MR 2097) 2021-09-10 03:18:27 +02:00
Henrik Grimler 51bfdc9784
pmb.aportgen: prefix $_outdir to dtbTool-sprd -p arg (MR 2107)
The -p arg is suppose to point to the folder where the dtc program
resides (if it is not found in PATH). If we use an _outdir, which the
template currently does, then the arg needs to be -p
$_outdir/scripts/dtc/, and not -p scripts/dtc/, as scripts/dtc/ only
contains the dtc source code.
2021-09-05 15:56:52 +02:00
Henrik Grimler c524926295
pmb.aportgen: rm -p scripts/dtc arg from dtbTool cmd (MR 2107)
The python variant of dtbTool, that we currently use, does not use
this arg as it does not run dtc in a shell.  I suppose the argument
was added only for compatibility with other dtbtools.
2021-09-05 15:54:43 +02:00
Caio Fontes fb98ad5329
enforce E501 partially in pmb/aportgen (MR 2058) 2021-06-06 19:21:31 +02:00
nybbled 5f485b8ad3
pmb.aportgen: put dependencies on separate lines (MR 2024)
Generate APKBUILDs with dependencies sorted and placed one per line.
The dependency lists changed are
 - depends in pmb/aportgen/device.py
 - makedepends in pmb/aportgen/linux.py

Sort dependency lists in test/test_aportgen_device_wizard.py
assertions.
2021-02-10 00:08:22 +01:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
HenriDellal 2d496d983e
pmb/aportgen/linux.py: Fix bad substitution error (MR 1999) 2020-12-02 21:32:43 +03:00
HenriDellal 6793612a7e
pmb/aportgen/linux.py: add different QCDT implementations (MR 1992)
Adds QCDT templates for Spreadtrum and Exynos SoCs
When "pmbootstrap init" is executed, after the boot image analysis,
if the device is QCDT, then the user is asked about the SoC vendor.
Example:
[HH:MM:SS] SoC vendor (spreadtrum/exynos/other) [other]: exynos
After that, the corresponding template is picked.
2020-11-23 11:48:19 +01:00
Oliver Smith 77a5dd1910
pmb.aportgen.linux: add gcc10 extern YYLOC patch (MR 1987)
Most downstream kernels need this patch to build with GCC-10, so add it
by default in the linux aport generator.
2020-11-10 12:06:36 +01:00
Dolphin von Chips 62f7a2af30
pmb.aportgen.linux: fix generated apkbuild when using qcdt (MR 1935) 2020-05-10 18:13:04 +02:00
Minecrell 0465f17e92
pmb.aportgen: Stop generating Maintainer: lines for device ports (MR 1932)
Most device ports that are added to pmaports (particularly the testing
category) are not actually "maintained". Many of them are never updated
after the initial contribution. There is little reason to list a
"Maintainer:" if the device package is actually not actively maintained
by that person.

Let's stop generating the Maintainer: line by default.
Instead, contributors should add the lines themselves if they are willing
to (actively) maintain the device package for a longer period of time.
Once they no longer want to maintain the package, the Maintainer:
line should be removed again.
2020-05-10 18:02:07 +02:00
Minecrell c33edea907
pmb.aportgen: Stop generating Contributor: lines for device ports (MR 1932)
The Git history is a much better representation of contributors
to a particular device port.
2020-05-10 18:02:02 +02:00
Minecrell 9050010044
pmb.aportgen: strip trailing white space before splitting lines (MR 1924)
Many of the multi-line strings already contain a new line at the
end of the file. When using .split("\n") this will result in an empty
line at the end of the file that is again followed by a new line.

In other words: we have two new lines at the end, which looks weird.
.rstrip() the whitespace at the end of the string to avoid this.
2020-04-25 13:39:09 +03:00
Minecrell 2e9279ac21
pmb.aportgen: pkgname="..." -> pkgname=... (remove quotes) (MR 1924)
apkbuild-lint complains:
TP:[AL3]:APKBUILD:4:pkgname must not be quoted
2020-04-25 13:39:05 +03:00
Minecrell 2ca09cd21c
pmb.aportgen: convert to f-strings (MR 1924)
Finally it's readable again!
2020-04-25 13:38:58 +03:00
Oliver Smith 77a6ad03cb
pmb.build.autodetect: support pmb:cross-native (MR 1920)
Have explicit selection of the "native" cross compilation method with a
new "pmb:cross-native" option. Deprecate the implicit pkgname pattern
matching.

Related: #1910
2020-04-19 13:33:14 +02:00
Luca Weiss 20e6dd0085 pmb.aportgen.linux: fix generated apkbuild 2020-04-06 10:39:45 +00:00
Dolphin von Chips 364fb333f6
pmb.aportgen.linux: use _outdir for supporting out-of-tree kernel builds (!1893)
Require new pmaports version, which has the related devicepkg-dev
changes.
2020-04-05 12:54:09 +02:00
Minecrell f565d6e153
pmb.aportgen.linux: cleanup makedepends (!1880)
Newer kernels require "bison" and "flex", so to easy porting we should
add them to generated APKBUILDs by default. While we are it, clean up
the default set of dependencies a bit:

  - installkernel is only needed when using "make zinstall", which
    we are not using in downstream_package (it requires special kernel
    configuration, so it's not really suitable for downstream...)

  - most kernels seem to compile fine without gmp-dev and elfutils-dev,
    so they should only be added when needed

  - the kernel has its own headers, why do we need linux-headers?
    (probably copied from Alpine, but anyway...)

  - add openssl-dev since it is needed for building/signing kernel modules

Useful reference: https://www.kernel.org/doc/html/latest/process/changes.html
Although it mentions much more than what is really needed...
2020-03-01 10:27:15 +01:00
Minecrell b0a664dc0e
pmb.aportgen.linux: build qcdt in package() (!1880)
Building the QCDT image in build() complicates use of envkernel.sh
- in that case, make is done independently of the APKBUILD, and only
the package() function is run to assemble the kernel package.

Building it entirely in package() allows using envkernel.sh without
having to set up some "post make script" (see
https://wiki.postmarketos.org/wiki/Compiling_kernels_with_envkernel.sh#Post_make_scripts).

package() might actually fit better in general, since QCDT is only
a special "package" format for (multiple) DTB files at the end :)
2020-03-01 10:27:15 +01:00
Minecrell 21b4e04c77
pmb.aportgen.linux: remove HOSTCC for latest GCC (!1880)
Setting HOSTCC is not necessary when using latest GCC
(since it defaults to "gcc"). Setting it only causes annoying
linter warnings. Let's remove it!
2020-03-01 10:27:15 +01:00
Luca Weiss ec6d40dfcc
pmb.aportgen.linux: use downstreakernel_package helper (!1880) 2020-03-01 10:27:00 +01:00
Oliver Smith f21c216a26
Cosmetic: use SPDX license header (!1877)
While at it, also remove unnecessary "#!/usr/bin/env python3" in files
that only get imported, and adjust other empty/comment lines in the
beginnings of the files for consistency.

This makes files easier to read, and makes the pmbootstrap codebase more
consistent with the build.postmarketos.org codebase.
2020-02-24 03:11:10 +03:00
Minecrell 630310ebfb
pmb.aportgen.linux: Fix linting issues in generated APKBUILDs (!1869)
Avoid generating an APKBUILD with the following linting issues:
  - unnecesary usage of braces: ${_flavor}
  - unnecesary usage of braces: ${arch}
  - unnecesary usage of braces: ${_commit}
  - unnecesary usage of braces: ${_repository}
2020-02-02 06:49:12 +03:00
Daniele Debernardi 3f2a064993
pmb.aportgen: add Contributor/Maintainer to APKBUILD templates (!1852) 2020-01-07 01:46:38 +01:00
Oliver Smith 948e3f931f
Change copyright to 2020 2020-01-06 02:43:00 +01:00
Grant Miller 200cc80a9d aportgen: Add gnu89 patch to all new kernel packages (!1744) 2019-01-20 22:34:09 -06:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00
Oliver Smith f54f96069e
aportgen linux: make compatible with GCC8
* create symlinks to the GCC8 patches (introduced in pmaports!35)
* link to the new vendorkernel reference wiki page
* use SPDX license in the license= field
* add comment above the compiler section of the APKBUILD
* remove empty line at the end of the APKBUILD
2018-10-05 09:07:57 +02:00
Daniele Debernardi 5d383bc6ef devicepkg-dev kernel prepare function 2018-07-02 00:12:49 +00:00
Oliver Smith a4728124f0
pmbootstrap kconfig edit: support $builddir and $srcdir/build (#1573)
The linux APKBUILDs write the kernel config either to `$builddir`
(default from the template) or `$srcdir/build` (legacy, and I reverted
to that in #1556, which was not the proper fix for this regression).

With this commit, `pmbootstrap kconfig edit` is able to edit both
versions, and prints a note when the APKBUILD is still using the old
style.
2018-06-18 22:21:18 +00:00
Oliver Smith ff3c710582
aportgen linux: always override KBUILD_OUTPUT (#1556)
Some kernels have a different `KBUILD_OUTPUT` path (e.g. #1551). When
the output path is different from `$srcdir/build`, then
`pmbootstrap kconfig edit` will not work (same with the previous
`pmbootstrap menuconfig` implementation).

This commit forces the output path to be `$srcdir/build` in the template
for new kernel aports, so we won't have that issue with future ports.
2018-06-14 20:18:26 +00:00
steamport 30df0725ca 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.
2018-06-09 06:52:24 +00:00
Oliver Smith 1678d089c9
aportgen linux: Also remove -Werror in Kbuild files (#1139)
We discovered that one kernel had it in a Kbuild file in #1124.
2018-01-24 20:07:47 +00:00
Mayeul Cantan 00aa65f2d0 pmbootstrap: add qcdt generation to the linux aportgen APKBUILDs (#1125)
* pmbootstrap: __config_.py - update the deviceinfo_attributes table

Add missing attributes:
 * "screen_width"
 * "screen_height"
 * "dev_touchscreen"
 * "dev_touchscreen_calibration"
 * "dev_keyboard"
 * "bootimg_qcdt"

Reorder the list to correspond to pmb/aportgen/device.py

Add a comment in the aforementioned file to avoid forgetting to update
this list.

Signed-off-by: Mayeul Cantan <mayeul.cantan@gmail.com>

* pmbootstrap: add qcdt generation to the linux aportgen APKBUILDs

This checks the next box in #688
When the device has bootimg_qcdt set to true, the following is done to
the linux APKBUILD:

 * Add dtbtool to makedepends
 * Call dtbTool during build() to generate dt.img
 * Add the generated dt.img in the package's boot/dt.img

Signed-off-by: Mayeul Cantan <mayeul.cantan@gmail.com>
2018-01-17 17:53:58 +00:00
Piotr Halama 2c5cd5d8bb Revert "init: Add manufacturer to pkgdesc when creating new device (#913)" (#1083)
This reverts commit 99d7b58ee5.

People usually add manufacturer name in the phone full name which
results in having manufacturer written double in pkdesc (e.g. `Samsung
Samsung Galaxy Mini 2`)
2018-01-05 02:44:44 +00:00
Oliver Smith 7750c1dd40
Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
Pablo Castellano 99d7b58ee5 init: Add manufacturer to pkgdesc when creating new device (#913) 2017-11-18 11:02:19 +00:00
Oliver Smith 6627599cf0
pmbootstrap init: Wizard for new port device- and linux-packages (#821)
* pmbootstrap init: Generate new port device- and linux-package
* adds `pmbootstrap aportgen device-*` and
  `pmbootstrap aportgen linux-*`
* ask for confirmation when selecting a non-existing device
* generate the packages directly from init
* refactor aportgen code
* fixed some easy things in the linux- APKBUILD (more to come in
  follow-up PRs!)

Testing:
* Test all questions to the user from pmb.config.init and pmb.aportgen.device
  (except for the timezone question, because we would need to monkeypatch the
  os.path.exists() function, which messes up pytest, so we'd need to refactor
  the timezone function to be more testsuite friendly first)
* Run the device wizard in a testcase a few times and check the output, that
  pmbootstrap.aportgen.device and pmbootstrap.aportgen.linux create by parsing
  the resulting APKBUILDs and deviceinfo and checking its contents.
* Build the generated device package once in the same testcase

Thanks a lot to @drebrez for all the help with this one:
<https://github.com/postmarketOS/pmbootstrap/pull/821>

See also the updated porting guide:
<https://wiki.postmarketos.org/wiki/Porting_to_a_new_device>
2017-10-30 19:56:38 +00:00