Commit Graph

174 Commits

Author SHA1 Message Date
Martijn Braam 3be2fce72f Merge pull request #267 from postmarketOS/fix/242-validate-input
Fix #242: Validate input in pmb.helpers.cli
2017-07-27 20:08:26 +02:00
Oliver Smith 6a034f1409 Various improvements for 'pmbootstrap export' (Fix #232) (#250)
* Various improvements for 'pmbootstrap export' (Fix #232)
* Do not try to generate the system image, but print a notice that
  it was not generated yet
* Display export path
* New default path: /tmp/postmarketOS-export (instead of current
  working dir)
* Create the export folder, if it does not exist yet
* Prettier output in the export message
* Adjust export message in install for consistency
2017-07-27 17:40:38 +00:00
Oliver Smith a9a6302233
Minor spelling fixes 2017-07-27 19:33:23 +02:00
Oliver Smith 7e4024be97 Fix #260, fix #87: Don't cross-compile when not necessary (#265) 2017-07-26 19:01:44 +00:00
Oliver Smith 2cabe1d51a Low hanging fruit basket (Close #220, Close #239) (#253)
* postmarketos-splash: change arch from "all" to "noarch"
* lg-mako: use .tar.gz instead of .zip (because that's the reference
  APKBUILD)
* #220: Allow specifying multiple packages for checksum, build,
  aportgen
* #239: Add chroot shortcuts (--rootfs and --buildroot)
* Show chroot and command before entering chroot
2017-07-26 18:59:11 +00:00
Oliver Smith a49187c6e4
Fix #242: Validate input in pmb.helpers.cli
* Validate all inputs from `pmbootstrap init`
* Add a new `confirm()` function, that validates input of yes/no
  questions properly
* All questions loop until they have a valid answer now
2017-07-26 19:05:06 +02:00
Martijn Braam 21228a14d1 Unified linux-postmarketos kernel for qemu and n900 (#228)
The creates the linux-postmarketos package which for now supports the n900 (and probably the other maemo devices) and qemu with the vexpress-a9 machine simulation.

I've put the generated dtbs in /usr/share/dtb for now and set the dtb field in the deviceinfo for the n900 and my new qemu device.

* Introduced linux-postmarketos-omap
* Unified kernel progress
* Created kernel bootable with qemu
* Updated n900 deviceinfo for generic kernel
* Changed qemu device to vexpress
* Updated APK comments and added linux-postmarketos-dev package
* Append dtb in mkinitfs
* Fixed bootscript on n900 for the generic kernel
* Don't detect double flavors with -dtb appending
* Added graphics drivers for vexpress (qemu)
* Added more drivers for qemu

This adds virtio network support in qemu for the vexpress-a9 machine.
The keyboard and mouse don't work yet.
You can boot into weston if --no-fde is specified
2017-07-25 20:08:35 +00:00
Oliver Smith e94ed7b03d Close #212: Split heimdall in heimdall-isorec and heimdall-bootimg (#254) 2017-07-25 18:56:10 +00:00
clayton craft 924546135c De-couple weston from postmarketos-base (#233)
Thanks, craftyguy!

- UI is selectable with `pmbootstrap init`. Currently only 'weston' and 'none' are options. It'll automatically pick up any new `postmarketos-ui-*` packages added at later dates.
- splits off weston packages install from postmarketos-base and puts
them into postmarketos-ui-weston. Also note that NO weston packages are
installed by "pmbootstrap install" by default unless the user selects a ui in the `init`
- configuration of weston is now in postmarketos-ui-weston.
- the demos have been spun off to `postmarketos-demos`, and `postmarketos-ui-weston` lists this package as a dependency.
2017-07-24 20:55:55 +00:00
clayton craft fcf593531c Do not store aports directory in config file (#247)
This addresses #246 by not storing the aports directory in the config
file. The default location is still available (from config/__init__.py),
and can be overridden.
2017-07-24 18:47:11 +00:00
cmdr2 b687ca70d5 Update runtime error message thrown for grsec/hardened kernels (#236)
* Update runtime error message thrown for grsec/hardened kernels, saying that they are not supported right now, #107

* Remove unnecessary check for grsec enable/disable status - the build will not work in either case
2017-07-23 12:29:13 +00:00
cmdr2 2afe205243 Ignore directories while searching for loop devices (#235)
Thanks, cmdr2! Here's the text from his PR:

Fixes an issue on alpine-vanilla, where `/dev/loop` is a directory (containing `/dev/loop/0`, `/dev/loop/1` ..etc), and causes `./pmbootstrap install` to fail.

Ignoring the `/dev/loop` directory works because `/dev/` also contains files named `/dev/loop0`, `/dev/loop1` ..etc, which the new code will still pick up.

The `install` command passes after this fix on my alpine-vanilla.
2017-07-23 12:24:56 +00:00
Martijn Braam 14f164b8a2 Merge pull request #218 from postmarketOS/fix/162-install-no-args.add
Install: Small improvements (Fix #162, Close #215)
2017-07-23 12:08:56 +02:00
Oliver Smith 13166f0f79
Fix #230: pmbootstrap flasher flash_system is broken
Regression from the cmdline argument feature.
2017-07-23 00:17:01 +02:00
drebrez 0e5808bed1 Close #198: Add possibility to override the kernel commandline during boot (#217)
Usage example:
pmbootstrap flasher boot --cmdline "PMOS_NO_OUTPUT_REDIRECT"

Thanks, drebrez!
2017-07-22 21:16:51 +00:00
Oliver Smith 66cda810c1
Improve the FDE hint, you need to type in the password twice. 2017-07-22 12:49:43 +02:00
Oliver Smith 4786516a22
Fix #219 for real!
100% tested. Assuming that you don't need to test an obvious change,
because it only changes one line is dangerous. I will learn from this,
sorry for the inconvenience.

`gcc-armhf` compiles fine again with that change, and it is able to
cross-compile packages as it used to.
2017-07-22 12:36:00 +02:00
Oliver Smith c730326d3c Close #195: Ignore parameters in dependencies (#225)
* Ignore `>`, `<`, `=` and `!` operators, when they are specified in
  the dependencies. This was the desired behavior before, but it was
  not implemented correctly (so it wouldn't ignore them everywhere).
  Of course the real fix would be to honor these operators like apk
  does. But this isn't feasible right now, and it should work for
  most, if not all, our use-cases. I have documented this in the wiki
  under build internals and if we happen to need correct operator
  handling, we should do it then.

Minor other changes:
* `pmbootstrap parse_apkindex`: support optional package parameter to
  only show the parsed content for one package.
* Support building most python APKBUILDs by replacing ${pkgname#py-}
  properly
2017-07-22 09:54:49 +00:00
Oliver Smith 177f6ea592
Fix PEP8 syntax
Spaces around a plus sign.
2017-07-22 11:07:05 +02:00
Oliver Smith 9e5683f151
Fix #219: pmbootstrap could not find g++-armhf/g++-aarch64 2017-07-22 09:49:24 +02:00
Oliver Smith 223f584e26
pmbootstrap shutdown: Make cryptsetup closing slightly more robust
I've had a strange case where `cryptsetup status` did not work
inside the chroot anymore, and only zapping it would resolve it.
But I couldn't zap, because the status check was preventing shutdown
(on which zap depends) from working. This commit works around that.
2017-07-21 23:44:28 +02:00
Oliver Smith 77d7ed1679
Close #215: Write explicity what passwords are for in install 2017-07-21 21:14:16 +02:00
Oliver Smith 5651c28b41
Fix #162: flash_system: meaningful error for missing image 2017-07-21 20:26:56 +02:00
Oliver Smith 56b34212f6 Various distccd related improvements, mostly respect --verbose (#216)
I've done some refactoring while debugging #209.
* Unused file `pmb/build/crosscompiler.py` removed (that was a
  left over from `_pmb_build_in_native_chroot` hack
* Do verbose logging in distccd, when `pmbootstrap --verbose` is
  being invoked
* Restart distccd, when the commandline has changed (e.g. when the
  currently running version was not verbose, and the new one is
  verbose.) Prior to this change, it only got restarted, when the
  architecture changed (so it did not allow changing the job count
  on the fly for example).
* Insert missing whitespace in arguments help.
2017-07-21 16:25:52 +00:00
Oliver Smith cf0dc2a989
Fix #209: Cross-compiling fails with C++ code 2017-07-21 17:21:32 +02:00
Oliver Smith 9677d89f84 Fix #145: add deviceinfo_flash_offset_base again (#175)
* Fix #145: add deviceinfo_flash_offset_base again

* Add default OFFSET_BASE value in flasher if deviceinfo_flash_offset_base variable is not set
...and set correct default base value in create_bootimg function
2017-07-19 20:44:12 +00:00
Oliver Smith ca5b8e3367
Fix #200: Parse depends_dev in APKBUILDs 2017-07-19 21:24:03 +02:00
Pablo Castellano 6be7d656ee Two trivial changes (typo + info message) (#179)
Thanks, Pablo Castellano!

* Fixed typo

* Guide user about what are the next steps after flashing kernel and password

* Increased postmarketos-mkinitfs' pkgver and rewording

Changes requested:
https://github.com/postmarketOS/pmbootstrap/pull/179
2017-07-19 18:05:34 +00:00
Oliver Smith 1aae094b50 Close #174: Put frontend functions in extra file (#185) 2017-07-18 19:01:11 +00:00
Clayton Craft 3ca54dc87b [RX51] Export u-boot kernel image with flasher
This properly exports the uImage kernel, which is used by u-boot, when
running 'flasher export'. Note the change to the uImage name to follow
the pattern "uImage-$flavor", which in the case of the RX 51 is
"uImage-nokia-rx51".
2017-07-17 12:14:05 -07:00
Oliver Smith ec57bd7df1 Merge pull request #144 from postmarketOS/heimdall-partitions-in-deviceinfo
Close #22: deviceinfo: add heimdall partitions / make flasher variables optional
2017-07-14 20:48:38 +00:00
Oliver Smith 69bb66cbd4
Challenge APK files: less output by default 2017-07-14 19:32:57 +02:00
Oliver Smith 50d23e2fd5
Fix #194: ismount() fails on symlinks 2017-07-14 07:05:45 +02:00
Oliver Smith 63aa1eae1b
AutoPEP8 1.3.2 slightly changed automatic formatting 2017-07-14 07:00:07 +02:00
Oliver Smith f37367c57c
Properly support specifying a local folder as --mirror-pmOS
This is required for developing and testing the binary repository
scripts (see #64). Changes:
* When specified, the local folder gets mounted inside the chroots
  as /mnt/postmarketos-mirror
* The apkindex_files() function outputs the correct path to the local
  repository (it does *not* hash the URL in that case, which would
  be wrong)
* /etc/apk/repositories: when the pmOS mirror is a local folder,
  the path "/mnt/postmarketos-mirror" gets added to that file instead
  of the outside path (so apk finds it properly inside the chroot)
2017-07-12 21:55:47 +02:00
Oliver Smith 8e3e296cbd
Depends parsing: Properly handle empty depends / buildinfo: strict depends 2017-07-12 21:01:40 +02:00
Oliver Smith 4f4588405f
Properly update /etc/apk/repositories when the mirrors change
This is important for the binary repository scripts, so it's feasible
to test the binary package build and challenge process locally without
setting up a new chroot whenever changing the repo URLs.

Also it behaves a bit more intuitively, because it really uses the
repo URL specified on the commandline, even when the chroot is already
set up.
2017-07-11 19:19:39 +02:00
Oliver Smith 34622368d9
Fix #107: Grsec check: read file in /proc as root 2017-07-11 18:50:40 +02:00
Oliver Smith d0ffe4879d
Challenge APKINDEX.tar.gz: allow .diff.md files in the repository 2017-07-11 18:39:28 +02:00
Oliver Smith c3a4446166
Challenge APKINDEX.tar.gz: add logging 2017-07-11 18:26:22 +02:00
Oliver Smith efab009a1f
deviceinfo: add heimdall partitions / make flasher variables optional 2017-07-10 20:27:06 +02:00
Oliver Smith 51bdc24315 Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.

I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.

To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.

In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.

In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".

This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.

Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).

The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
Oliver Smith 05e79c1d5c
Fix #107: Meaningful error for grsecurity/chroot_deny_chmod 2017-07-06 21:16:00 +02:00
Oliver Smith 6b08d31652 Merge pull request #136 from postmarketOS/build-all-kernels-natively
[i9070][i9100] Build kernels natively
2017-07-06 16:03:48 +00:00
Oliver Smith 5cd07c44fb
Display device count in 'pmbootstrap init' 2017-07-05 18:49:52 +02:00
Oliver Smith dede11657d
Get rid of the _pmb_build_in_native_chroot hack 2017-07-05 18:40:00 +02:00
Oliver Smith 4fd1420f09
Add 'pmbootstrap aportgen busybox-static-armhf' (and other archs) 2017-07-05 18:20:13 +02:00
Oliver Smith 9d9dc9e541 Merge pull request #134 from postmarketOS/fix-missing-flavor-variable
Added flavor to the flash_system command for consistency
2017-07-05 14:19:31 +00:00
Martijn Braam 4cdf51f94e Changed flasher.run()s flavor to an optional argument 2017-07-05 14:01:54 +02:00
Martijn Braam d16c90b39c Added flavor to the flash_system command for consistency, This fixes issue #133 2017-07-05 13:39:50 +02:00
Martijn Braam 2518627579 Fixed typo in new boot.img flasher 2017-07-05 00:48:19 +02:00
Oliver Smith 866333ef6c
Close #77: Implement 'pmbootstrap flasher export' 2017-07-04 23:03:51 +02:00
Oliver Smith 615880e161
pmbootstrap flasher: use boot.img file with fastboot 2017-07-04 22:47:03 +02:00
Pablo Castellano ba744abae0 Show path to boot.img and description of commands after pmbootstrap install
This change got lost in this PR merge:
https://github.com/postmarketOS/pmbootstrap/pull/125
2017-07-03 23:49:05 +02:00
Oliver Smith 4573863561
Rename args.no_fde to args.full_disk_encryption 2017-06-28 17:22:48 +02:00
Oliver Smith 86cb9f5ec8
Merge branch 'optional_full_disk_encryption' of https://github.com/PabloCastellano/pmbootstrap into optional-fde 2017-06-28 17:16:56 +02:00
Oliver Smith 28a0e10e56
pmb.chroot.apk.installed(): use apk's internal database
...instead of running apk every time to get the list of installed
packages and their versions. The internal package database from
apk has the same format, as the extracted APKINDEX file (except
that it has more key-value pairs, which we ignore/do not need
right now). So the APKINDEX code has been extended to parse both
tar-packed APKINDEX files and regular text files in the APKINDEX
format.

This is required for #108, for a better detection of outdated
packages (because the internal package database  saves the
package's timestamp, too). A nice benefit is, that this is faster
than calling apk every time and it doesn't fill up the log as much.

I've also used this improved function for determining the apk
version (for the outdated version check), and I've deleted
pmb.parse.other.package_split(), as it is not needed anymore.
2017-06-27 17:56:15 +02:00
Oliver Smith 19b93c2d04
Prepare for aarch64 host support, fix typo in arch mapping
Relates to #106.
2017-06-27 00:28:11 +02:00
Oliver Smith fcc5501a44
Slightly improve error handling
* Fix: Do not swallow traces when crashing before log init (e.g.
  during argument parsing)
* Show a link to the troubleshooting page, when an error happens
* (Formatting done by autopep8 in pmb/config/init.py)
2017-06-27 00:23:21 +02:00
Pablo Castellano 7e79d20a0b aportgen: Added end of file newline 2017-06-25 21:40:49 +02: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 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 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 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 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
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
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 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 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 90c3a67329
Fix syntax issues / unused import reported by static code analysis 2017-06-14 20:12:47 +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 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 6999e6ea47
Fix #40: allow sdcard install, when the sdcard is mounted as /dev/sd* 2017-06-10 00:29:48 +02:00
Oliver Smith afa42ce0a3
pmbootstrap initfs: Make wording in --help more consistent 2017-06-09 19:49:01 +02:00
Oliver Smith 18339d0a14
Close #69: add 'pmbootstrap initfs' and improve initfs workflow
* allows to build/extract/list initramfs, add/del hook
* rebuild the initfs whenever running install or trying to flash/boot it
* flasher flash/boot: automatically set up a minimal rootfs with kernel and initfs,
  if it does not exist yet
2017-06-09 19:22:25 +02:00
Oliver Smith 32ad868cdc
apk.installed(): Retuns all packages and versions now
pmb.chroot.apk.installed() used to return only the explicitly installed
packages. This is not good enough for the initfs check functions (and
especially for the "lazy reproducible builds", from which branch this
commit was cherry picked).

This commit introduces more noise for the logfile - if this becomes
a problem, raise your voice in the issues tracker and we'll do something
about it.

(This commit also changes minor code styling in other files, I did
not run autopep8 last time, because flake8 didn't complain...)
2017-06-09 18:01:39 +02:00
Oliver Smith e55347315d
pmbootstrap index: Automatically set up abuild 2017-06-08 18:19:17 +02:00
Oliver Smith 50195a6af2
pmbootstrap log: Add a -n/--lines parameter (like tail has)
...also increase the default line count to 30, so it's easier to
spot an error if you didn't have the log open when it happened.

This parameter also works for 'pmbootstrap log_distccd', for consistency.
2017-06-08 18:15:38 +02:00
Oliver Smith 9515782f8d
Fix 67: New '--add' parameter for 'pmbootstrap install' to add custom packages.
Example usage:

./pmbootstrap install --add='vim,gcc'
2017-06-08 18:10:00 +02:00
Oliver Smith 5016c196ba
Fix two typos in the config 2017-06-08 18:02:00 +02:00
Oliver Smith f1ab344f09
Fix #68: properly update the device chroot in the install step
* build all dependencies, that have a newer version
* upgrade all packages inside the chroot
2017-06-08 17:54:53 +02:00
Oliver Smith 31b276eeb9
WIP #64: make gcc-armhf lazy-reproducible, properly compare symlinks 2017-06-06 22:21:59 +02:00
Oliver Smith 36527e548e
Fix #61: Check whether device nodes exist, after they have been created.
As reported in #53, it appears that older versions of eCryptfs don't
really create the device nodes, although `mknod` does not fail on
the commandline. That's fixed now with this extra check.
2017-06-06 16:36:57 +02:00