pmbootstrap, with Synit changes
Go to file
Oliver Smith d261034349 Package kernel-scripts separately (#1234)
We have two methods of cross-compiling:
* native: everything runs with the host architecture, QEMU is not
  involved. This is the fastest, but requires the build system to be
  working with it. We use this for all linux-* packages currently.
* distcc: everything runs through QEMU emulating the target arch,
  *except* for the compiler. This is the most compatible approach
  working with all packages.

When compiling `linux-*` packages natively, kernel scripts needed
during the build process get generated. Some of these are C files that
get compiled as executables. In native mode, these get compied to the
native architecture, in distcc mode to the target architecture.

The problem is, that we need these scripts compiled for the target
architecture in the kernel's dev package in order to compile kernel
modules outside of the kernel's package (e.g. wireguard).

It is not possible to just rewrite this logic to generate target-arch
binaries when running in native mode, because these binaries require
musl-dev, linux-headers and some other packages to be installed for the
target architecture inside the native chroot.

We solve this by introducing a new `kernel-scripts` package. which
contains just the binary scripts. In case the dev package was
cross-compiled, it depends on `kernel-scripts` and symlinks these
binaries. The `kernel-scripts` package always gets compiled in distcc
mode since it does not have a `linux-` prefix.

Fixes #1230.
2018-02-16 22:00:37 +01:00
aports Package kernel-scripts separately (#1234) 2018-02-16 22:00:37 +01:00
keys Close #871: Enable binary repository (#887) 2017-11-19 15:04:08 +00:00
pmb mkbootimg: replace Python version with osm0sis' C version (#1193) 2018-02-11 11:41:41 +00:00
test check_checksums.py: Non-zero exit on build error 2018-02-14 00:12:46 +01:00
.gitignore gitignore: Add pytest cache 2018-02-06 23:10:25 +01:00
.travis.yml Testsuite: Run UIs in Qemu and check running processes and more (#982) 2018-02-02 00:16:29 +00:00
CONTRIBUTING.md CONTRIBUTING.md: Mention that we squash PRs (#651) 2017-09-29 21:23:46 +00:00
LICENSE Initial commit 2017-05-26 19:25:48 +00:00
MANIFEST.in Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00
README.md README.md: fix typo s/coretutils/coreutils/ (#1044) 2017-12-27 19:05:59 +00:00
pmbootstrap.py Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
setup.cfg Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00
setup.py Close #327: Add initial setup.py (#443) 2017-09-02 19:30:40 +00:00

README.md

pmbootstrap

Introduction | Security Warning | Supported Devices | travis badge | Coverage status

Sophisticated chroot/build/flash tool to develop and install postmarketOS.

For in-depth information please refer to the postmarketOS wiki.

Requirements

Usage

Assuming you have a supported device, you can build and flash a postmarketOS image by running through the following steps. For new devices check the porting guide.

First, clone the git repository and initialize your pmbootstrap environment:

$ git clone https://github.com/postmarketOS/pmbootstrap
$ cd pmbootstrap
$ ./pmbootstrap.py init

While running any pmbootstrap command, it's always useful to have a log open in a separate window where further details can be seen:

$ ./pmbootstrap.py log

It's now time to run a full build which will create the boot and system images:

$ ./pmbootstrap.py install

Once your device is connected and is ready to be flashed (e.g. via fastboot), you can run a flash of the kernel (boot) and system partitions:

$ ./pmbootstrap.py flasher flash_kernel
$ ./pmbootstrap.py flasher flash_system

After a reboot, the device will prompt for the full-disk encryption password, which you typed in the install step (unless you have disabled full-disk encryption with --no-fde). Once the partition has been unlocked it is possible to connect via SSH:

$ dhclient -v enp0s20f0u1
$ ssh user@172.16.42.1

Development

Testing

Install pytest (via your package manager or pip) and run it inside the pmbootstrap folder.

License

GPLv3