Commit Graph

1533 Commits

Author SHA1 Message Date
Luca Weiss b3a9080398
helpers/envkernel.fish: add gcc4 support (!1842) 2019-12-14 00:18:21 +01:00
Bart Ribbers 1fbf7356c6
Use default amount of inodes for block device (!1841)
This fixes #1845 without breaking #1717 (closed). The amount of inodes
only needs to be explicitly set when we don't know the size of the
filesystem before hand, for example when using fastboot or Heimdall. In
all other cases it's actually better to let it figure out automatically
how many inodes is set.

On my 16GB sdcard the amount of available inodes got increased by 10
times (from ~100K to ~1M).
2019-12-13 23:23:35 +01:00
Danct12 956d746feb
pmb.config.install_user_groups: add netdev (!1839)
Add default user to netdev group. Together with MR [1] in pmaports.git,
this fixes the permissions to use nmtui and nm-applet from the user.

[1] https://gitlab.com/postmarketOS/pmaports/merge_requests/777
Signed-off-by: Danct12 <danct12@disroot.org>
2019-12-05 22:45:28 +01:00
Antoine Fontaine 144a58b558
helpers/envkernel.sh: add gcc4 support (!1836) 2019-11-30 15:29:02 +01:00
Oliver Smith 5438085e62
pmb/parse/_apkbuild: fix parsing commented lines (!1837)
Properly ignore comments at the end of lines, instead of assuming that
all lines below belong to the attribute:
	subpackages="$pkgname-dev" # $pkgname-lang

Fixes build.postmarketos.org#61, where pmbootstrap would assume that a
random package provides "make", just because the word "make" is written
somewhere below subpackages=" in the APKBUILD and it is parsed
incorrectly.

While at it, also support the ' character for quotations and detect if
a quotation for a value was started, but there is no end quotation sign
in the rest of the file.

I've added tests, and manually checked that this did not introduce any
parsing bugs for all the APKBUILDs in pmaports.git, by running
'pmbootstrap apkbuild_parse' with the old and new code, and diffing the
result.
2019-11-30 12:44:06 +01:00
Oliver Smith 3587812539
replace_aports_packages_with_path: better error (!1837)
Because of an APKINDEX subpkg parsing bug, pmbootstrap currently assumes
that "ktp-common-internals" provides "make". It fails with a cryptic
error when trying to build a package without an existing postmarketOS
binary packages mirror (like done in the build.postmarketos.org
testsuite):

  File "/home/user/code/pmbootstrap/pmb/chroot/apk.py", line 174, in replace_aports_packages_with_path
    package + "-" + data_repo["version"] + ".apk")
TypeError: 'NoneType' object is not subscriptable

Replace this error with a more meaningful message, that points to the
issue analyzing this bug.

Related: https://gitlab.com/postmarketOS/build.postmarketos.org/issues/61
2019-11-30 12:43:10 +01:00
Oliver Smith 84abedd536
pmb.config.build_packages: add git (!1832)
Always install git when building packages, so abuild won't behave
slightly different if it is (not) installed. As nice side-effect, we
will always get the pmaports.git commit saved in the resulting .apk file
from now on (in .PKGINFO).
2019-11-24 20:39:36 +01:00
Oliver Smith c6fd40a07d
Prepare 1.11.0 release 2019-11-22 00:09:36 +01:00
Alexey Min 64aa7443e5
pmb.deviceinfo: fix sanity check when "device-" is present in codename (!1834)
Fixes #1842
2019-11-22 00:01:38 +01:00
Oliver Smith 8806a464b2
pmb/data/keys/pmos-5a03a13a.rsa.pub: remove (!1835)
Delete the old binary package repository key from pmbootstrap.
2019-11-21 23:52:25 +01:00
Oliver Smith e1286c38a5
config: switch to new binary package repository (!1835)
This change has been in the works for about a year now. We have a new
binary repository, that is completely automated and always online.
Powered by builds.sr.ht and our very own build.postmarketos.org code.
The days of yours truly manually triggering to build and upload the
binary package repository at home are finally over! Also this will pave
the way to have multiple branches, and to base on Alpine stable.

Related: https://postmarketos.org/blog/2019/01/16/600-days-of-postmarketOS/#new-srht-based-binary-repository
Related: https://postmarketos.org/blog/2019/06/23/two-years/#sourcehut-srht
Related: https://gitlab.com/postmarketOS/build.postmarketos.org
2019-11-21 23:52:25 +01:00
Daniele Debernardi 8326025c27
install: setup xorg keymap (!1833)
With the nokia N900 the user can choose between different keyboard
layouts and during the install the setup-keymap installs the choosen
layout.

This only changes the keyboard layout of the console, while installing
a UI using xorg, the layout was hardcoded to "us".

With a simple check for the existence of an xorg config containing
XkbLayout, this will run sed to replace the default with the layout
chosen by the user.

Tested with a clean install of the nokia N900 with the xfce4 UI.
2019-11-20 21:57:58 +01:00
Oliver Smith 228ca1f127
Prepare 1.10.0 release 2019-11-10 13:46:23 +01:00
lambdadroid 1893703a78
pmb: config: Require CONFIG_CGROUPS=y kconfig option (!1830)
elogind requires cgroup support in the kernel.
It does not start without it, resulting into errors like:

    elogind-daemon[1654]: Failed to mount tmpfs at /sys/fs/cgroup: No such file or directory
    elogind-daemon[1654]: Failed to mount cgroup at /sys/fs/cgroup/elogind: No such file or directory
    elogind-daemon[1654]: Failed to allocate manager object: No such file or directory

    dbus-daemon[1437]: [system] Activating service name='org.freedesktop.login1' requested by ':1.1' (uid=0 pid=1642 comm="/usr/bin/lightdm ") (using servicehelper)
    dbus-daemon[1437]: [system] Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)

Most of the supported desktop environments (e.g. Weston) do not
start without elogind, so we should require CONFIG_CGROUPS=y in
all kernels to avoid this problem.
2019-11-10 12:45:58 +01:00
Oliver Smith 16166874a5
pmb/build/_package.py: create .git symlink (!1831)
Make /home/pmos/build/.git point to the .git dir from pmaports.git, with
a symlink so abuild does not fail.

abuild expects the current working directory to be a subdirectory of a
cloned git repository (e.g. main/openrc from aports.git). If git is
installed, it will try to get the last git commit from that repository,
and place it in the resulting apk (.PKGINFO) as well as use the date
from that commit as SOURCE_DATE_EPOCH (for reproducible builds).

With that symlink, we actually make it use the last git commit from
pmaports.git for SOURCE_DATE_EPOCH and have that in the resulting apk's
.PKGINFO.

Fixes: #1841
2019-11-10 12:29:55 +01:00
Oliver Smith 46a65e1bb9
pmb.build._package.build_depends: update APKINDEX
When 'pmbootstrap build' is started with '--no-depends', we make sure
that binary packages of all dependencies exist before proceeding with a
build. Make sure that we have downloaded the APKINDEX for the given arch
first, otherwise this may complain that a binary package is missing
although it does exist.

This happened when using the "native" cross compile method, e.g. when
building kernels for different architectures. It would complain that
there is no binary package for "bash" (which is in Alpine obviously):
https://builds.sr.ht/~postmarketos/job/103882
2019-11-04 20:02:18 +01:00
Oliver Smith dcb89a62e0
pmb.config.init: fix python 3.5 compat
Don't use f-strings, as they result in invalid syntax errors for python
3.5. This was making the build.postmarketos.org CI tests fail.
2019-11-03 15:35:57 +01:00
Alexey Min cd2180d178
pmb.config.init: 2-step device selection (!1825)
When running pmbootstrap init, first select device vendor, then device
codename. Also fixed tests for new behavior and added some new ones for
new scenarios.
2019-10-30 22:51:33 +01:00
Oliver Smith a0a3a591da
keys: add build.postmarketos.org.rsa.pub (!1829)
The public key for the new binary repository. Once we can build all
packages with that (for all arches), we'll switch to it.

See also: https://gitlab.com/postmarketOS/build.postmarketos.org/
2019-10-30 21:45:33 +01:00
lambdadroid 67b080b158
Detect if DTB is placed in second area of Android boot image (!1828)
postmarketOS/pmaports!700 adds a new "deviceinfo_bootimg_dtb_second"
option that places the DTB in the "second" area of the Android boot
image.

Attempt to detect this automatically by checking the extracted
second binary for the FDT magic (0xd00dfeed).
2019-10-25 17:36:22 +02:00
Oliver Smith cf9d648ac9
pmaports.guess_main: new assumption for -dev pkgs (!1827)
Packages ending in -dev: just assume that the originating aport has the
same pkgname, except for the -dev at the end. Otherwise we may end up
with the wrong package.

For example, if something depends on plasma-framework-dev, and
plasma-framework is in Alpine, but plasma is in pmaports, then the
regular guess_main() algorithm below would pick plasma instead of
plasma-framework.

Fixes: build.postmarketos.org#52
2019-10-20 20:03:56 +02:00
Luca Weiss 8a5c8fcc3e
Fix detection of qcdt boot images (!1826)
mkbootimg from osm0sis changed the filename of the dtb section in [1]
which breaks the detection of qcdt in pmbootstrap.

Fix this by adjusting the filename pmbootstrap checks to match the
unpackbootimg behavior.

[1] https://github.com/osm0sis/mkbootimg/commit/d8222a4d
2019-10-18 21:35:44 +02:00
lambdadroid 8881b0489f
build: envkernel: install makedepends (!1824)
Currently, building with envkernel.sh entirely ignores the
makedepends listed in the kernel APKBUILD. Common dependencies
needed by most kernels are hardcoded in envkernel.sh.
However, some kernels may need extra dependencies either during
the build process or when the kernel is packaged.

Installing the makedepends when the build environment is initialized
is difficult because "source helpers/envkernel.sh" is not aware
of the exact kernel package that is going to be built later.

However, we can easily modify the packaging step
(i.e. pmbootstrap build --envkernel linux-...)
to install the required makedepends.

This fixes building "linux-postmarketos-qcom-msm8916" using envkernel,
since it requires "dtbTool" and "installkernel" to be installed when
the APKBUILD package() function is executed.
2019-10-13 21:27:43 +02:00
lambdadroid 9ed179594e
install: format: support FAT32 as boot fs (!1823) 2019-10-09 23:57:19 +02:00
Oliver Smith 2bc9652231
Prepare 1.9.0 release 2019-10-07 22:58:02 +02:00
lambdadroid 23ebb71b27
Install "android-tools" instead of "libsparse" for img2simg (!1821)
The sparse image tools (simg2img, img2simg, append2simg) are now
part of Alpine's android-tools where they are continously updated.
(See https://github.com/nmeum/android-tools/pull/8)

Therefore, "libsparse" now conflicts with "android-tools", which
causes the fastboot flasher to fail if "libsparse" is already
installed.

Install "android-tools" instead of "libsparse" before generating
a sparse image to avoid this problem.
2019-10-07 22:43:27 +02:00
Oliver Smith a6704fa09d
aportgen: print note after generating pmaport (!1817)
Make it more obvious that we are generating packages during
'pmbootstrap init', when using the new device wizard:

[22:32:32] *** pmaport generated: /home/user/.local/var/pmbootstrap/cache_git/pmaports/device/device-openphoenux-neo900
[22:32:32] *** pmaport generated: /home/user/.local/var/pmbootstrap/cache_git/pmaports/device/linux-openphoenux-neo900
2019-10-07 22:26:46 +02:00
Martijn Braam 68aa37637a
index: add DESCRIPTION file to APKINDEX.tar.gz (!1822)
This file is used by the package browser frontend build by the alpine
developers. It uses the contents of the DESCRIPTION file to validate the
cache in the database.
2019-10-06 14:45:32 +02:00
Oliver Smith 925c56febe
repo_missing: don't check arch recursively (!1820)
Remove the recursive check, as it caused an infinite loop. It took a
very long time to complete anyway, even when it worked. The reasoning
for having the recursive check in the first place was, that we would
have device packages with arch=noarch set in the APKBUILD, but which
could only be built for a certain architecture (the device
architecture). Nowadays using arch=noarch in device packages is
forbidden, and we enforce that rule [1]. So the recursive arch check
isn't necessary anymore.

[1] ac6c0a2997
2019-10-01 10:46:21 +02:00
Oliver Smith 80a7fe8aaf
Prepare 1.8.3 release 2019-09-30 00:38:04 +02:00
Oliver Smith 4dea27e67d
pmbootstrap flasher boot: fix fastboot arg (-c) (!1819)
Replace -c with --cmdline, to adjust to the same change in fastboot:
577e8b44b6
2019-09-29 23:56:51 +02:00
Oliver Smith 966d1a6d91
Prepare 1.8.2 release
The fastboot fix is kind of important, so let's make a new release.
2019-09-26 23:08:46 +02:00
Oliver Smith 5ad84a4c08
Cosmetic: pmb.parse.sanity_check: nicer comments (!1818)
Create one block of legacy errors, instead of having own blocks, each
with their own comment stating the obvious.
2019-09-26 22:55:17 +02:00
Oliver Smith a791bf4ecb
deviceinfo: flash_fastboot_vendor_id is legacy (!1818) 2019-09-26 22:55:13 +02:00
Oliver Smith 7b8dc01d9e
Revert "Add "flash_fastboot_vendor_id" deviceinfo variable for fastboot flash method (#857)" (!1818)
This reverts commit 6fb5b28e2f.

The -i option was removed from fastboot, so we can't use it anymore
unless we fork the package. There was only one device using it,
amazon-thor. I will add a note to the wiki page.

Fixes #1830.
2019-09-26 22:32:53 +02:00
Luca Weiss ff4965ddfc
Revert "envkernel.sh: fallback to old armhf hostspec (!1786)" (!1813)
The relevant packages have been rebuilt now so we can remove this
workaround.

This reverts commit 9cf3e741a1.
2019-09-18 22:16:39 +02:00
Oliver Smith 90c16aff78
Prepare 1.8.1 release 2019-09-18 22:03:01 +02:00
Oliver Smith 69aa7b73f2
timeout: change default from 300 to 900 seconds
Linking big libraries may take more than five minutes, so change the
default timeout to fifteen minutes to save users from frustration.
This is the same value that I'm using to build binary packages for the
repository.

Pushing directly to master without making a merge request, because this
is a trivial change.
2019-09-18 21:56:34 +02:00
Luca Weiss 0f7678f033
build: remove QEMU workaround for aarch64 (!1814)
QEMU is now at v4.0.0 and the issue was fixed upstream. Fixes #546.
2019-09-18 21:39:31 +02:00
Oliver Smith 5a97c60256
aportgen: fix fork_alpine related error (!1815)
Make sure, that "args.fork_alpine" is always present. Otherwise,
pmbootstrap will fail if the aportgen code is called by anything but
"pmbootstrap aportgen". For example, when the user is adding a new
device during "pmbootstrap init".

Fixes: 54e51759ad ("aportgen: add feature to fork upstream packages")
2019-09-18 20:59:14 +02:00
Luca Weiss f853c0da20
Update alpine_to_hostspec mappings (!1812)
The important part about this patch is the change for armhf, which
adjusts the hostspec to the one used by Alpine.

Fixes a part of postmarketOS/pmaports#363
2019-09-18 20:34:41 +02:00
Oliver Smith 1e00ce49b9
Prepare 1.8.0 release 2019-09-16 21:48:32 +02:00
Daniele Debernardi 54e51759ad
aportgen: add feature to fork upstream packages (!1811)
This MR add the --fork-alpine argument to the pmboostrap aportgen
command, which downloads the APKBUILD and related files and copies them
into the pmaports/temp folder.
2019-09-14 01:39:11 +02:00
Daniele Debernardi ff50a5e382
aportgen: fix extra newline (!1811) 2019-09-14 01:26:49 +02:00
Daniele Debernardi 3ce1ea277c
get_upstream_aport: change arg to pkgname (!1811) 2019-09-12 21:20:08 +02:00
lambdadroid c3a9452ccb
Skip sparse image generation when installing to SD card (!1809)
At the moment, attempting to install to SD card when
flash_sparse is set to "true" will always fail because
/home/pmos/rootfs does not exist in that case.

Sparse images are only useful to speed up Fastboot flashing.
Nothing will be able to read it from the SD card.
The problem can therefore be avoided by simply skipping the
generation of the sparse image when SD card installation is used.
2019-08-27 11:54:30 +02:00
Luca Weiss 896ec71dd9
pmb: remove u-boot from native_cross_compile list (!1808)
Remove u-boot from the native_cross_compile list as we now have
crossdirect. Compiling is not terribly slow anymore, and when not using
the "native" method, it is possible to depend on firmware packages like
arm-trusted-firmware-sun50i.

This reverts commit d7d7ccb672.
2019-08-24 00:25:12 +02:00
Luca Weiss 30384b9083
kconfig check: support passing a file directly (!1802)
This allows for example for me to call the kconfig check function on the
.config file in my Linux tree: $ pmbootstrap kconfig check --file
.config and it reports me which kconfig options I need to enable.
2019-08-24 00:10:02 +02:00
Steffen Pankratz 9dc326ecb8
CI: add 'merge request' settings check (!1805)
check_mr_settings.py taken from pmaports repository.

Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
2019-08-06 10:22:13 +02:00
Steffen Pankratz 3b240e46f7
fix deprecation warnings in regular expressions (!1804)
From https://docs.python.org/3/library/re.html
"Backslashes are not handled in any special way
in a string literal prefixed with 'r'."

Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
2019-07-28 12:26:15 +02:00