Commit Graph

2372 Commits

Author SHA1 Message Date
Oliver Smith c3011c953a Merge pull request #112 from craftyguy/fix_init_relpath
Support relative path for initializing config
2017-06-25 19:00:42 +00:00
Clayton Craft da9af8ee87 Support relative path for initializing config
Previously, if you passed something like ~/build to the init function
for work directory, it would create a directory, .\~/ in the current
working directory instead of resolving ~/ to the user's home directory.
This allow allows using ../ to specify a path.
2017-06-25 18:53:47 +00:00
Oliver Smith 7380b60472
Update musl-* to 1.1.16-r14 2017-06-25 13:38:39 +02:00
Oliver Smith ed58ae3a79
Close #103: Document how to use chroot commands with parameters 2017-06-23 23:46:09 +02:00
Oliver Smith fb1e8ec73b
Update min apk version/add more apk version checks
* Minimum version: 2.7.2 (which fixes two CVEs)
* Check the minimum apk version before doing something with apk and
  before entering the chroot manually (previously, it has just checked
  the apk-tools-static version, which gets used to set up the chroot)
* Reword the message for an outdated APK version. Most likely it is
  just the outdated http cache, instead of a man-in-the-middle attack.

See also:
b849b481a0
2017-06-23 17:04:49 +02:00
Pablo Castellano 920d4c8198 Mount unencrypted root partition (close #86)
- Do not decrypt if not necessary
- Do not launch telnetd if partition is unencrypted
- Basic initramfs logging to /tmp/boot.log
2017-06-22 20:14:38 +02:00
Pablo Castellano 0346b7a77a Find root partition using labels
For some reason /dev/disk/by-label/pmOS_root symlink is not present and
blkid from busybox doesn't support the -L parameter. We could install
blkid from util-linux but I prefered to use shell commands instead
2017-06-22 19:58:28 +02:00
Pablo Castellano efab93e4d0 Use variable in format.py and add labels to partitions 2017-06-22 19:58:28 +02:00
Pablo Castellano d4719f41c9 Added --no-fde parameter 2017-06-22 19:58:28 +02:00
Oliver Smith f547ff5c6e Merge pull request #102 from PabloCastellano/update_musl
Update musl-* to 1.1.16-r13
2017-06-22 13:52:24 +00:00
Pablo Castellano 0f3b2ea427 Update musl-* to 1.1.16-r13 2017-06-22 00:44:02 +02:00
Oliver Smith 51af907534
Slightly adjust README.md
* Change "GNU/Linux" into "Linux distribution", because the Alpine Linux developers don't see their distro as GNU/Linux
* Use "hello-world" as example package, as it does not make much sense right now to compile heimdall for armhf
2017-06-21 20:01:28 +02:00
Oliver Smith ed4275dd9b
Add support for the binary repository, inactive by default (#64)
* New commandline parameter --mirror-pmOS, where the binary repository
  URL for postmarketOS can be specified (empty by default as of now,
  this will be filled with the real URL once the repo works)
* Do not build packages, when they are in the binary repository and
  the version of the package in the binary repository is up-to-date.
* Add a testcase for pmb.build.is_necessary().
2017-06-20 20:13:05 +02:00
Oliver Smith 187bae1d1b
Fix commandline help wording 2017-06-20 19:12:41 +02:00
Oliver Smith 3642a53f20
Fix race condition in testcase test_challenge_build 2017-06-20 19:10:13 +02:00
Oliver Smith 9e723e7125 Merge pull request #98 from postmarketOS/device-nokia-rx51-modules
Device nokia rx51 modules
2017-06-20 15:32:07 +00:00
Oliver Smith 6751b2e8cb
Close #94: Always rebuild apks when aports change
...even if the pkgver and pkgrel have *not* changed. This should
make development much more intuitive. The detection works by looking
at the last modified timestamps, just like `make` does it.
2017-06-19 20:33:56 +02:00
Oliver Smith 328bed4ba2
Add testcases for pmbootstrap challenge.
* pmb/challenge/apk.py had to be renamed to pmb/challenge/apk_file.py,
  so the "internal" functions of that file could be accessed, while
  still providing the short notation pmb.challenge.apk().
* zap asks for each buildroot_* chroot, if you want to remove it, not
  only for the one with the device arch
* add new pmb.chroot.tempfolder() function, that creates a temporary
  folder, that belongs to "user" and deletes it, if it already exists.
  this function gets used in a few challenge testcases.
2017-06-19 20:07:51 +02:00
Martijn Braam cc118db72f Fixed module loading for n900 2017-06-19 00:05:37 +02:00
Oliver Smith e4df6c5d22
Fix #96: Check if build is necessary is broken.
When an APKINDEX contained a package with multiple versions,
pmbootstrap did not use the last version to determine if the
package is out of date (regression from af8c9fcf5b).
2017-06-18 22:15:36 +02:00
Martijn Braam c6509c482f Enabled module installing for the n900 kernel 2017-06-18 21:17:00 +02:00
Oliver Smith 4f030db299
gcc-aarch64: remove dependency on bash
This was added by mistake while testing the gcc-aarch64 aport.
2017-06-18 02:00:41 +02:00
Oliver Smith 748bd43620
Implement challenge for APKINDEX.tar.gz (part of #64) 2017-06-18 01:45:41 +02:00
Oliver Smith ce147b0381
pmb.parse.apkindex.parse(): Use caching
Big speed improvement for buildinfo.json files, down from 30-60s to 1-5s.
2017-06-18 01:09:21 +02:00
Oliver Smith af8c9fcf5b
Rewrite pmb.parse.apkindex(): Can get the full index as dict now
Previously, it was only possible to get information about one
package inside the APKINDEX at a time.
This is needed for #64 to verify the APKINDEX.

Please note, that this implementation is actually slower, than
the previous one. But the code is more readable and it makes
caching possible (which will speed up the APKINDEX massively,
especially for the buildinfo.json file generation!)
2017-06-18 00:46:14 +02:00
Oliver Smith 112dc5e70c
Move challenge code to own folder (#64)
...and add a stub for 'pmbootstrap challenge APKINDEX.tar.gz'.
2017-06-17 17:42:28 +02:00
Oliver Smith 05c837c921
pmbootstrap challenge: Put buildinfo.json in changed files list.
...and some smaller fixes:
* make the diff output easier to read
* verify, that only .apk, .buildinfo.json and the APKINDEX have
  changed inside the local repository folder. Because the file
  names of these changes will be used to release files from
  staging to release.
2017-06-17 01:58:40 +02:00
Oliver Smith 47e2ec1345 Merge pull request #93 from PabloCastellano/weston_patch_red_screen
[weston] Added compositor-fbdev-Added-parameter-pixman-type patch
2017-06-16 20:59:08 +00:00
Pablo Castellano 16c873d834 [weston] Added compositor-fbdev-Added-parameter-pixman-type patch
It fixes the red screen bug by running weston --pixman-type=2

https://github.com/postmarketOS/pmbootstrap/issues/54
2017-06-16 22:44:48 +02:00
Oliver Smith a1298cb114
Challenge/buildinfo: slightly improve output
Use "arch" instead of "carch", print "OK!" when a file has been verified
(which is much easier to recognize than "File has the same content").
2017-06-15 22:40:19 +02:00
Oliver Smith c250d65a9f
pmbootstrap challenge: Allow the signature filename to be different.
Also verify, that each apk contains exactly one signature file (a
file, that starts with .SIGN.RSA.).
2017-06-15 22:28:39 +02:00
Oliver Smith 906bda0e18
pmb.build.is_necessary(): Add optional apkindex_path parameter
This is necessary for pmbuilder (the componenet, that creates packages
in the upcoming binary package repository)
2017-06-15 19:53:48 +02:00
Oliver Smith 83eaa93c49
Update musl-* to 1.1.16-r12 2017-06-15 03:07:51 +02:00
Oliver Smith 55e276053a
Meaningful error in aportgen musl*, when aports repo is outdated 2017-06-15 03:05:04 +02:00
Oliver Smith a9e28c9b8b
Fix #89: Meaningful error message for missing arch in APKBUILD
The following message will be printed out now, in case you attempt
to build a package for an architecture, that is not specified in
the "arch=..." line inside the APKBUILD:

ERROR: Architecture 'aarch64' is not supported for this package.
Please add it to the 'arch=' line inside the APKBUILD and try again:
/path/to/APKBUILD
2017-06-15 02:44:43 +02:00
Oliver Smith 1adeee70b6
Fix #90: noarch: create symlinks for all supported architectures
* The supported architectures are inside the config now
* Symlinks get created for that list of supported architectures now.
* During initialization, the architecture from the selected device
  gets checked against the list of supported architectures. When
  it is not included, a meaningful exception gets raised.
* the aportgen and (cross-compiler) build tests make use of the
  new variable now (they had armhf and aarch64 hardcoded previously).
2017-06-15 02:26:32 +02:00
Oliver Smith 9ab3270b2a
Fix #87: weston: Change arch to "all", so it builds on aarch64.
Pull request for the same change in the upstream APKBUILD from Alpine:
https://github.com/alpinelinux/aports/pull/1689
2017-06-15 01:38:28 +02:00
Oliver Smith c951b2a5af
Remove firefox dependency from postmarketos-demos.
firefox-esr is not apackaged on Alpine for aarch64 right now.
As firefox is just a demo in the current state, it will be left to
the user to add it to his installation with the --add flag, so this
will not break the install step anymore.
2017-06-15 00:33:22 +02:00
Oliver Smith 0f7bfdc955
Rename test/repo.py to test/test_repo.py 2017-06-14 20:22:55 +02:00
Oliver Smith 90c3a67329
Fix syntax issues / unused import reported by static code analysis 2017-06-14 20:12:47 +02:00
Oliver Smith 1e45c64698
postmarketos-demos: Depend on firefox-esr instead of firefox
The firefox package is currently broken in armhf Alpine,
and it looks like fixing will take a while (depends on packaging
rust for armhf on Alpine):

https://bugs.alpinelinux.org/issues/7409
https://github.com/alpinelinux/aports/pull/1578#discussion_r119988654
2017-06-14 19:52:40 +02:00
Oliver Smith c0f90ee65a
pmb/helpers/repo.py: Diff ofthe package repo works properly now.
Previously, it would always report all files as new files, although
some of them may not have changed. I've added testcases for the
repo functions.
2017-06-14 19:48:23 +02:00
Oliver Smith 7543ae540b
Official support for aarch64 (#84)
* Fix hardcoded `armhf` in pmb/aportgen/binutils.py
* Generate aports: `binutils-aarch64`, `musl-aarch64`, `gcc-aarch64`
* Distccd: Remember the cross-compiler architecture (currently armhf
  or aarch64), that the current distccd is running as, and restart
  distccd with the correct architecture, in case a different arch
  is needed than what it is currently running as. (Depending on the
  cross-compiler arch, the PATH variable gets adjusted before
  starting distccd)
* Testcases: add aport generation for aarch64, add cross-compiling
  to aarch64
* pmb/parse/arch.py: Add aarch64 to the mapping
2017-06-14 19:10:21 +02:00
Oliver Smith 1274b8c26b
pmbootstrap challenge: subpackages, list of changed files
* Two new functions for getting a list of files and their timestamps
  in the repo, and diffing that information to get a list of changed
  files: pmb.helpers.repo.files() and pmb.helpers.repo.diff().
  (I've put it in the helpers folder, because it is not specific to
  one chroot, but to all chroots at once.)
* pmbootstrap challenge (new command introduced a few commits back to
  verify, that the contents of an APK file are deterministic) uses
  these functions to a) support subpackages and b) optionally
  output a list of changed files (this gets used in the pmbuilder
  script, which lives outside of this repository).

This commit is progress for #64 again.
2017-06-13 21:31:19 +02:00
Oliver Smith 6cbac208ba
Fix #83: Properly handle left over files when closing the cryptsetup device 2017-06-13 01:34:20 +02:00
Oliver Smith c076fcf9c2
Fix #76: Rebuild initramfs, when installing a initramfs hook
Also shellcheck all *.trigger files from now on in the static code analysis.
2017-06-13 00:55:49 +02:00
Oliver Smith 7c0c813610
pmbootstrap challenge: Fix location of the "package_split()" function 2017-06-11 15:14:26 +02:00
Oliver Smith 5f747bedcd
pmb.build.is_necessary(): Remove unused 'suffix' parameter 2017-06-11 14:45:00 +02:00
Oliver Smith 3a3dd8063f
Merge branch 'lazy-reproducible-builds'
We have "lazy reproducible builds" now. What I mean by that is, that
the resulting "apk" archive is not fully reproducible, but all binaries
inside it are. This is necessary to kick-off the binary repo, which is
in turn required to get the testsuite going on Travis. Read #64 for more
information.

Usage:
```
pmbootstrap build hello-world --buildinfo
pmbootstrap challenge /tmp/path/to/hello-world-1-r2.apk
```

The "--buildinfo" parameter generates a "buildinfo.json", which contains
the versions of all dependencies. It is not very optimizied, so this
is a performance bottleneck and takes 10 seconds (which is quite much
considering that the hello-world package builds in less than a second).
This can be improved in the future, and then the buildinfo parameter
may become the default.
2017-06-11 14:19:57 +02:00
Oliver Smith 52a5a884ce Merge pull request #81 from MartijnBraam/device-nokia-rx51
Added hook to enable backlight on boot for n900
2017-06-10 18:28:22 +00:00