Commit Graph

274 Commits

Author SHA1 Message Date
cclauss a502b50475 Reduce complexity in pmbootstrap.py (#160)
Thanks, @cclauss!

* Dictionary lookup of event loop actions

This was kind of an experiment that adds lots of blank lines to this script -- feel free to reject it.

The observation that triggered this was that in main() all actions can execute using just one parameter, args.  This means that it is possible to use args.action to do a dict lookup to get the corresponding function.  This approach adds tons of blank lines to the script in exchange for a rapid seek to the action implementation and a substantial reduction of the McCabe complexity of main().

$ __flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics__
```
./pmbootstrap.py:43:1: C901 'main' is too complex (23)
./pmb/aportgen/core.py:38:1: C901 'rewrite' is too complex (17)
[ ... ]
```

* Remove action_dict and use locals() instead
2017-07-17 15:38:45 +00:00
Martijn Braam 56b9c2206e Fixed checksums for device-nokia-rx51 after merge 2017-07-16 17:09:12 +02:00
Martijn Braam 7d920a626d Merge pull request #159 from craftyguy/rx51_kernel4.12
[RX51] Update to mainline kernel
2017-07-16 17:02:43 +02:00
Martijn Braam e50dafb380 Merge pull request #155 from craftyguy/master
[RX51] Account for uInitrd filename change in u-boot script
2017-07-16 16:59:29 +02:00
Martijn Braam 40a6267b74 Merge branch 'master' into rx51_kernel4.12 2017-07-16 16:58:21 +02:00
Martijn Braam ada271f1c7 Merge pull request #158 from craftyguy/rx51_fix_wifi
[RX51] Add linux-firmware package
2017-07-16 16:56:58 +02:00
Clayton Craft 594dcf6f9c [RX51] Update to mainline kernel
A couple of issues are resolved by moving to the mainline kernel (from Pali's
kernel):

1) 'reboot' command now works as intended
2) boot is *much* faster
3) charging LED seems to be working now
2017-07-15 21:12:16 -07:00
Clayton Craft 2578954e4e Account for uInitrd filename change in u-boot script (rx-51)
The uInitrd filename is appended with 'flavor' so, for example, with the
rx-51 the generated file is named 'uInitrd-nokia-rx51'. This corrects
the rx51's u-boot script to account for this change in filename.
2017-07-15 16:24:37 -07:00
Clayton Craft 3b4650c8f5 [RX51] Add linux-firmware package
This removes the call to `firmware_install` in the APKGBUILD for
linux-nokia-rx51, and adds the `linux-firmware` package as a dependency
for device-nokia-rx51.

There are two immediate benefits for this:
1) wifi now works

2) the FM radio device was causing the boot to take ~2 minutes longer
than it should, now that the firmware is present there's no delay in
initializing this device
2017-07-15 14:30:54 -07:00
Clayton Craft 0fb18b2bdf RX51 - Add touchscreen calibration udev rule 2017-07-15 12:40:17 -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
drebrez 8c38ac8dca Update heimdall script to flash both (kernel+initramfs) at once 2017-07-14 22:35:59 +02:00
Oliver Smith 69bb66cbd4
Challenge APK files: less output by default 2017-07-14 19:32:57 +02:00
Oliver Smith b0dbff4c76
postmarketos-mkinitfs: Bump pkgver to 0.1.5 2017-07-14 18:10:56 +02:00
Oliver Smith 34e8e762f4
Merge branch 'configfs-usb' of https://github.com/Decatf/pmbootstrap 2017-07-14 18:09:26 +02:00
Oliver Smith fdbbc657cd
Update gcc-* to 6.4.0 2017-07-14 07:09:52 +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
ryang 346cc41ce6 Add ConfigFS based usb network configuration
This extends the initramfs init script to setup USB networking on kernels
using USB_CONFIGFS.
2017-07-13 11:17:48 -04:00
Oliver Smith 4616484cb7
Add new dependency test package: hello-world-wrapper 2017-07-12 22:19:01 +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 0bd1d54049
Fix race condition in test_challenge_build (APKINDEX timestamp) 2017-07-10 21:28:15 +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 b4c9f93f0d
[mako] Use red screen workaround 2017-07-09 11:53:21 +02:00
Oliver Smith f0486326f1
This fixes the following error:
mkbootimg: error: argument --base: invalid parse_int value: ''

So now postmarketos-mkinitfs can really generate boot.img files.
2017-07-09 11:19:29 +02:00
Oliver Smith 37640e724a
Close #137: Remove "deviceinfo_modules" / minor deviceinfo changes
Minor changes:
* device-lg-hammerhead: remove left-over comment
* device-samsung-i9100: remove fastboot section
2017-07-08 08:46:27 +02:00
Oliver Smith 2670c3a031
Update busybox-static-* to 1.27.0-r1 2017-07-08 07:48:35 +02:00
Oliver Smith 405a0d7ab8
Fix #139: Update musl-armhf to 1.1.16-r15 2017-07-08 07:44:33 +02:00
drebrez 2fe8eb0fdf [i9070] Use kernel modules / Wifi support (!)
* Add kernel module compilation
* Add wifi firmware from vendor files (to `/lib/firmware/postmarketos`) and fix modules install path
* Add patch to change hardcoded dhd firmware/nvram paths
* Add wifi module (dhd) to the list of kernel modules that should be loaded at boot time

Details:
https://github.com/postmarketOS/pmbootstrap/pull/138

Thanks you very much, drebrez \o/
2017-07-08 05:30:00 +00:00
Oliver Smith 05e79c1d5c
Fix #107: Meaningful error for grsecurity/chroot_deny_chmod 2017-07-06 21:16:00 +02:00
Oliver Smith 10fd0f312d
Display short troubleshooting URL on exception 2017-07-06 19:09:45 +02:00
Oliver Smith b675f65f7d
deviceinfo: Add link to reference and reword comments 2017-07-06 18:58:14 +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 9470a6ce46
Close #92: pmOS-specific /etc/motd, /etc/issue 2017-07-05 20:52:37 +02: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 a7beb4a1f7
Generate aports for busybox-static-armhf and -aarch64
...and add generating both aports to the testsuite.
2017-07-05 18:24:47 +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
Oliver Smith 1fd8b29253 Merge pull request #132 from MartijnBraam/fix-typo
Fixed typo in new boot.img flasher
2017-07-05 14:16:39 +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 48ffe79051
Fix #128: Remove obsolete 'deviceinfo_flash_offset_base' 2017-07-04 23:25:31 +02:00