Commit Graph

26 Commits

Author SHA1 Message Date
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
bo41 caf7973e24
args.arch_native: remove (MR 2130)
Replace "args.arch_native" with the direct function call in order to
avoid passing "args" to all functions. This is a step to get rid of this
args-passed-to-all-functions pattern in pmbootstrap.
2021-10-24 14:34:30 +02:00
Oliver Smith f2966e62ae
pmb.parse.arch.alpine_native: remove unused ret (MR 2130) 2021-10-24 14:34:30 +02:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Oliver Smith f9c74277ca
cpu_emulation_required: not for armv7 -> armhf (MR 1952)
Make it possible to build armhf packages on armv7 devices, e.g. to help
with stuck build-edge-armhf packages that won't build with qemu.
2020-07-14 22:42:55 +02:00
Oliver Smith ddb5d9ae2c
pmbootstrap install --ondev: new option (MR 1946)
Add initial support for the on-device installer in pmbootstrap. Let
pmbootstrap create a regular split image, then prepare a new installer
rootfs and copy the previously generated rootfs image into the installer
rootfs. Put the installer rootfs into a new image, with reserved space.

There is more to do from here, such as disabling the generation of the
user account when using --ondev. But this requires support in
postmarketos-ondev first, so let's build that iteratively.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
Related: https://gitlab.com/postmarketOS/postmarketos-ondev/-/issues
2020-06-19 09:36:51 +02:00
Minecrell f536fd9cb9
pmb.qemu: use current device instead of requiring --arch (!1886)
When using pmbootstrap, you usually select the device you want to work
on using 'pmbootstrap init', generate the rootfs and can then run more
commands in the context of the device.

The same needs to be done before using QEMU (to generate the rootfs).
But for some reason 'pmbootstrap qemu' requires setting the --arch
parameter when running QEMU for a foreign architecture, even when the
device is still selected in pmbootstrap.

Even more confusing is that setting "--arch arm" always selects
device-qemu-vexpress, but this is not immediately clear from the name.

Let's make this a lot more intuitive by making sure there is a QEMU
device selected when running 'pmbootstrap qemu'. We can then use the
device information to infer the architecture automatically.
2020-03-14 08:05:32 +01:00
Minecrell 320b2faa4c
pmb.qemu: remove QEMU mesa driver setup question (!1886)
mesa-dri-swrast and mesa-dri-virtio are both provided by mesa-dri-gallium
now, so this option does not have much use anymore. With both selections,
exactly the same packages are installed.
2020-03-14 08:05:32 +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
Oliver Smith 948e3f931f
Change copyright to 2020 2020-01-06 02:43:00 +01:00
Luca Weiss f853c0da20
Update alpine_to_hostspec mappings (!1812)
The important part about this patch is the change for armhf, which
adjusts the hostspec to the one used by Alpine.

Fixes a part of postmarketOS/pmaports#363
2019-09-18 20:34:41 +02:00
Oliver Smith bda78e42ee
pmb/parse/arch.py: add armv6l -> armhf to mapping (!1756)
Makes it possible to run pmbootstrap on the Raspberry Pi Zero W for
example.
2019-02-13 10:06:47 +01:00
Oliver Smith f16bdaf0ca
Update copyright to 2019
Happy new year \o/
2019-01-02 09:31:20 +01:00
Grant Miller dfaca1e06f Enable armv7 (!1730)
I need to do some more work on pmaports in order for this to actually
be useful.
2018-12-17 08:06:10 +01:00
Oliver Smith 68e1feef17 pmb: qemu-user-static from aport, not from Debian
Overview:
In order to execute foreign arch binaries on the host system, we are
using the Linux kernel's binfmt_misc feature in combination with
static builds of QEMU. Before this patch, the statically compiled
QEMU binaries were taken from Debian (mostly because I did not realize
that Alpine ships them as well). Now we can use the ones from the aport.

Benefits:
This allows us to easily update and patch the QEMU executables, we
don't need to be in sync with Debian's versions anymore.

Alpine's package is more modular, so we can save some download,
install, zap time, as well as disk space: setting up an armhf chroot
with pmbootstrap took ~102 MB before, now it's ~18 MB.

Detailed changes:
* Remove `cross/qemu-user-static-repack` aport
* Add `data/qemu-user-binfmt.txt` with the binfmt_misc flags for ELF
  binaries of various arches (extracted from Debian's packaging)
* When parsing that file, don't write verbose messages to
  `pmbootstrap log` anymore, only to the verbose log (can be enabled
  with `pmbootstrap -v`)
* Rename `pmb.parse.arch.alpine_to_debian()` to ...`alpine_to_qemu()`
* Rename `arch_debian` to `arch_qemu`
2018-08-10 15:11:21 +00:00
Daniele Debernardi 845d946389 Enable running pmbootstrap on x86 architecture (#1155) 2018-01-24 00:56:11 +00:00
Oliver Smith 3c8a93fa7b
Improved pmbootstrap init (#1095)
This PR makes the workflow faster and pmbootstrap will
produce less traffic. Details:
* Check if it's possible to create and read from a device
  node directly when initializing a chroot (closes #472)
* Copy the Qemu binary into the forign-arch chroots
  before initializing them, so the post-install script
  directly work during the chroot setup and we don't need
  to call apk fix afterwards
* Use pmb.helpers.repo.update(), which only updates the
  APKINDEX files if they are older than 4 hours, instead
  of using apk's repo update function which always
  downloads the APKINDEX files
* Chroot initialization
  * Getting the initial APKINDEX to download apk-tools-static
  * Updating the APKINDEX at the start of pmbootstrap install
* Fixed a bug in from_chroot_suffix: the buildroot_x86_64 has
  architecture x86_64, not x86.
2018-01-23 00:54:48 +00:00
Oliver Smith 12340fe5f6
Fix qemu-vexpress and qemu-aarch64 (#1029)
* Don't ask for the mesa driver when the Qemu arch is not the
  native arch and always use swrast in that case
* qemu-vexpress: use LTS kernel
* qemu-aarch64: use drm-backend for weston
2018-01-08 15:18:37 +00:00
Oliver Smith 7750c1dd40
Happy new year! (update copyright to 2018) 2018-01-04 04:53:35 +01:00
clayton craft d45c7d2d84 Add armv7l (armhf) as supported native arch. (#682) 2017-10-02 22:49:40 +00:00
Pablo Castellano 49b35ad32d Close #226: Launch postmarketOS in a qemu virtual machine (#350)
Thanks to Pablo Castellano and Martijn Braam!
In postmarketOS we are now able to generate system images with the
correct configuration so that they can boot already using qemu

This commit brings the `pmbootstrap qemu` action.
This command is very handy because you don't have to set all the
qemu parameters, pmbootstrap does it for you.

* device-qemu-vexpress: Added kernel command line according to wiki
* qemu: Added workaround for image writing permissions
* qemu: Added support to launch postmarketOS in a QEMU virtual machine

- Support for emulating these architectures in QEMU: arm, aarch64, x86_84
- Generate QEMU command correctly depending no guest architecture (arm/x86)
- Run QEMU in the same architecture as the host by default
- Refactoring in pmb.parse.arch and pmb.qemu.run
- Raise exception if DTB file or system image are not present
- Display more useful information when something fails (e.g. image not found)
- Run qemu version depending on arch (host or argument), not device configured

* device-qemu-amd64: set deviceinfo_kernel_cmdline to "PMOS_NO_OUTPUT_REDIRECT"
* qemu: added --memory argument to specific guest RAM
* device-qemu-amd64: adjusted deviceinfo_kernel_cmdline (console=tty1)
* Added /etc/network/interfaces for qemu-amd64
* qemu: Added KVM support if /dev/kvm if present
* Specify separate machines for architecture
* qemu: Check if QEMU is installed instead of crashing
* Added graphics driver to qemu-aarch64

- Use arm (as used in qemu) instead of armhf (used in Alpine)
- qemu argument is -dtb
- Follow same style to build the command + arguments

* qemu: Added SSH port redirection: ./pmbootstrap.py qemu -p 2222
2017-08-09 20:26:40 +00:00
Pablo Castellano 2cbf56a4c4 Usability improvements, fix #278 (#279)
* Quote architecture in logging message for easier reading
* Added shortcut arguments for --rootfs, --buildroot and --suffix
* Simply remove beforehand link to nowhere if exists (fix #278)
Fixed crash when symlink already existed but pointed to a non-existing location
2017-07-29 15:16:43 +00: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 19b93c2d04
Prepare for aarch64 host support, fix typo in arch mapping
Relates to #106.
2017-06-27 00:28:11 +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 ae950fb9f7
Hello, there! 2017-05-26 22:08:45 +02:00