Commit Graph

37 Commits

Author SHA1 Message Date
Oliver Smith 3987d2f764
CI: download shellcheck (MR 2142)
Similar fix as in pmaports MR 2673.
2021-11-11 22:50:28 +01:00
BO41 77d39ecdf1
lint: enforce max line length (MR 2097) 2021-09-10 03:18:27 +02:00
Caio Fontes 1704851468
test/static_code_analysis.sh: update E501 check (MR 2058)
Change from checking some files for E501 to excluding some files from
checking.
2021-06-06 19:21:31 +02:00
Caio Fontes 5144195091
fix long lines (E501) in pmb/build (MR 2050) 2021-04-26 23:56:42 -03:00
Anri Dellal 88ec1d1106
pmb.chroot: fix E501, switch to f-strings (MR 2040) 2021-03-30 15:13:26 +02:00
Shubham Naik 87c7859b40
Enforce E501: Limit the line length to 79 for files in pmb/install (MR 2031)
Made changes to limit the line length in following files for #1986,
 - pmb/install/_install.py
 - pmb/install/blockdevice.py
 - pmb/install/losetup.py
 - pmb/install/partition.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-03-30 14:51:53 +02:00
Shubham Naik 684cb3e1fb
Enforce E501: Limit the line length to 79 for files in pmb/parse - part 2 (MR 2020)
Made changes to limit the line length in following files,
 - pmb/parse/bootimg.py
 - pmb/parse/depends.py
 - pmb/parse/kconfig.py
 - test/test_parse_depends.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-02-04 22:54:00 +01:00
Shubham Naik d1fadba5b4
Enforce E501: Limit the line length to 79 for files in pmb/parse - part 1 (MR 2019)
Made changes to limit the line length in following files,
 - pmb/parse/_apkbuild.py
 - pmb/parse/apkindex.py
 - pmb/parse/binfmt_info.py
 - pmb/parse/deviceinfo.py
 - test/test_parse_apkbuild.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-02-04 22:32:35 +01:00
Oliver Smith 51c01f384f
pmb/install/format.py: fix too long line (MR 2008) 2021-01-27 15:01:57 +01:00
Dylan Van Assche 8455c82eee
install.ui: move get_recommends to new file (MR 2010) 2021-01-24 16:18:33 +01:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Martijn Braam 1921fc5f27
Add sideload command
The sideload command runs the supplied names through the pmbootstrap
buildsystem to make sure they're up-to-date, then uses scp from the host
to copy the built apks to /tmp on the phone and installs them through
ssh.

If the --install-key option is set then it will also copy over the apk
key that's used for signing the packages built by pmbootstrap in case
the postmarketOS install on the device isn't build by the same machine
as you're sideloading from.
2020-12-08 17:42:30 +01:00
Johannes Marbach bbf0a70e5b
Add progress bar when running apk commands (MR 1996)
This adds a progress bar when running apk commands both inside and
outside of the chroot.

Closes: #1700
2020-12-07 12:41:28 +01:00
Oliver Smith 5ff0bbe4b2
test/static: enforce E501 length check iteratively (MR 1993)
Enforce the E501 length check of max 79 characters for all files where
this test passes already. We can add more to the list as we adjust them
and eventuelly require the check for all files.
2020-11-23 11:31:57 +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
Daniele Debernardi 0244ffbf53
static_code_analysis.sh: find all shell files (!1853) 2020-01-22 00:20:07 +01:00
Daniele Debernardi b60730499c
static_code_analysis.sh: use shellcheck/flake8 from chroot (!1853) 2020-01-22 00:17:23 +01:00
Oliver Smith 3ce00de710 Move aports into own repository (pmaports) 2018-09-05 05:57:38 +00:00
Oliver Smith 74e103d1f2 static code analysis: make it pass flake8 3.5.0
This commit adds two new ignores to the flake8 call:
* W504 line break after binary operator
* W605 invalid escape sequence 'x'

Without these, newer flake8 versions, such as the one shipped by Arch
Linux, don't run through on the code base (which leads to not running
it at all locally, only in CI).

Additional changes:
* Don't give the exception instance of subprocess.CalledProcessError a
  name, so it does not trigger F841
* Dont' advise to run "autopep8" anymore, because that will likely
  touch unrelated code.

For reference, here is the list of error codes:
https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
2018-07-11 18:58:29 +00:00
clayton craft 023fbf53dc gitlab ci: restructure 'tests' stage 2018-07-08 23:06:00 +00:00
Clayton Craft 256914c1a0
Implement support for gitlab CI
This implements support for the gitlab CI system. Wiki, static analysis,
and build tests are implemented.
2018-06-29 23:16:41 -07:00
Oliver Smith a77a0dcc32
Add envkernel.sh: instant mainlining environment (#1424)
Changes:
* `helpers/envkernel.sh`:
  * installs everything needed for kernel compilation in the native
    chroot
  * mounts the kernel source to `/mnt/linux` inside the chroot
  * creates `/mnt/linux/.output` and chowns it to the `pmos` user, that
    folder will be used for the kernel build output
  * sets up aliases for `make`, `pmbootstrap`, `pmbroot`, `kernelroot`
* new action `pmbootstrap work_migrate`: does the interactive work
  folder migration if necessary, otherwise it doesn't output anything
  * when calling this first, we can safely use all other commands
    non-interactively without showing the output

Benefits:
* Fast setup (especially for people who are new to kernel
  compilation
  * No need to figure out distribution specific package names
    (cross compilers!)
  * No need to do a test build just to verify that the right
    packages are installed
* Less error prone
  * The right dependencies are always installed
  * `ARCH` and `CROSS_COMPILE` variables always get set automatically
    and based on `deviceinfo_arch`
  * If the build environment is broken for some reason, just zap and
    start over
* Easy to reproduce problems

Notes:
* `make menuconfig` works as well
* Sourcing was tested with `zsh`, `bash` and `fish`, it should be easy to
  extend for other shells
2018-04-19 21:27:38 +00:00
BK d79e13d226 Add helpers/envsetup.sh (#1390)
Usage:
$ source helpers/envsetup.sh
It sets up the aliases `pmbootstrap` and `pmbroot`.
The latter changes the directory to the pmbootstrap folder.
2018-04-08 12:58:10 +00:00
Oliver Smith 34d46b2fe3
static_code_analysis.sh: Find CHANGEMEs in APKBUILDs (#1161) 2018-01-24 21:31:07 +00:00
drebrez c0c197f57b Feature debug-shell (#1028)
* Changed usb-shell behavior, it wait for some user action before continue booting
* Rename usb-shell to debug-shell and changed port to 23
* Add `20-debug-shell.sh` script to static code analysis
* Enable eth0 interface in initramfs (qemu)
* Add additional script to run a shell in order to be able to kill it from a telnet session
2017-12-23 19:22:28 +00:00
drebrez 254150567e Add `devicepkg-dev` which generate the touchscreen udev rule based on the deviceinfo (#995)
* Use devicepkg-dev by default in new device wizard
* Add link to reference wiki page
2017-12-14 21:17:18 +00:00
Attila Szöllősi 405b702e32 Workaround for mdss-fb (#927) 2017-11-21 23:17:59 +00:00
Attila Szöllősi d9e7a3d7de Run recovery installer in chroot (#901)
The recovery installer now has as few dependencies on the
Android recovery system as possible.
2017-11-16 22:20:57 +00:00
Oliver Smith eaaff660ea Flake8 checking: disable E722: do not use bare except (#812)
Travis suddenly fails, because flake8 has a new detection rule:
Using except to catch all exceptions triggers E722.

However, we only use it once and we really want to catch all exceptions,
as it wraps the whole program and shows a nice error message, with
the full trace in the log.
2017-10-23 20:54:07 +00:00
Oliver Smith ed94ab7449 Run fast testcases in Travis CI, remove obsolete testcase (#760)
* Removed obsolete apkindex_files cache testcase (the corresponding
function has been removed in #345 already).
* Fix test_challenge_apk: It failed on Travis, because we're accessing
/etc/abuild.conf, which only exists after initializing the build environment.
It's a random dummy file anyway, so I've replaced it with another file.
* Fix test_folder_size: accept a tolerance in the result
2017-10-23 19:44:08 +00:00
Attila Szöllősi 477f4c9497 Add kernel updater script (#625) 2017-10-14 23:17:49 +00:00
Oliver Smith 2e3ade3c9d Package postmarketos-ui-hildon (#649) 2017-10-06 18:34:51 +00:00
Attila Szöllősi fbe968f1ab Recovery installer zip (#404)
Supports flashing with TWRP and other Android recovery OS through adb sideload,
as well as exporting a generated recovery zip file.
See also:
https://github.com/postmarketOS/pmbootstrap/wiki/deviceinfo_flash_methods#recovery-mode-adb
2017-08-24 21:07:36 +00:00
Oliver Smith 00b71dd881 Close #147: postmarketos-base: added udev rule / firmwareload.sh (#427)
See also:
https://github.com/postmarketOS/pmbootstrap/pull/374
2017-08-20 12:49:55 +00:00
drebrez 147863d98a Automatically compute the minimum size for the partition and resize it during the boot process (#127)
* Automatically compute the minimum size for the partitions
* Automatically resize the pmOS_root partition during the boot process
* Resize root partition only if there is unallocated space at the end of the device.
* Added more echos to make debugging easier while looking at the pmOS_init.log.
* Updated static_code_analysis.sh script to run shellcheck with `-x` option.
2017-08-03 16:01:00 +00: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 75641f5fc7
Set up static code analysis, fix style issues reported by flake8 2017-05-28 02:44:53 +02:00