mkinitfs: Fail on missing depends / better usability in general
Created by: ollieparanoid
Changes
- Fail if mkbootimg/uboot-tools are not installed, but creating a boot.img file / u-boot legacy image was requested via deviceinfo (fixes #312 (closed))
- Fail if /boot/dt.img is missing, but we have a qcdt device
- Fail if the dtb file specified in deviceinfo does not exist
- Fail if mkbootimg etc. exit with error code
- Don't try to add the ext4 module into the initramfs. We always compile it into the kernel. Instead, kconfig_check makes sure it is enabled now. (fixes #1037 (closed))
- Add a note that modprobe warnings can be ignored mostly:
==> initramfs: creating /boot/initramfs-amazon-thor
Scanning kernel module dependencies...
NOTE: ** modprobe warnings below can be ignored ** if your device does not run the
mainline kernel yet (most devices!) or if the related kernel options are enabled
with 'y' instead of 'm' (module).
modprobe: WARNING: Module drm_kms_helper not found in directory /lib/modules/3.4.0-perf
modprobe: WARNING: Module drm not found in directory /lib/modules/3.4.0-perf
modprobe: WARNING: Module dm_crypt not found in directory /lib/modules/3.4.0-perf
Testing
I've tested pmbootstrap -y zap; pmbootstrap initfs
with the following combinations.
- nokia-rx51 (u-boot legacy, mainline kernel dtb) without changes -> runs through as expected
- nokia-rx51 missing uboot-tools:
==> initramfs: creating /boot/initramfs-postmarketos-stable
==> kernel: appending device-tree omap3-n900
ERROR: 'deviceinfo_generate_legacy_uboot_initfs' is set, but the package
'uboot-tools' was not
installed! Please add 'uboot-tools' to the depends= line of your device's
APKBUILD. See also: <https://postmarketos.org/deviceinfo>
- nokia-rx51 with missing dtb file:
==> initramfs: creating /boot/initramfs-postmarketos-stable
==> kernel: appending device-tree some-invalid-dtb-file
ERROR: File not found: /usr/share/dtb/some-invalid-dtb-file.dtb
- amazon-thor without changes (bootimg, qcdt device) -> runs through as expected
- amazon-thor without bootimg
ERROR: 'deviceinfo_generate_bootimg' is set, but the package 'mkbootimg' was not
installed! Please add 'mkbootimg' to the depends= line of your device's
APKBUILD. See also: <https://postmarketos.org/deviceinfo>
- amazon-thor without /boot/dt.img
==> initramfs: creating boot.img
ERROR: File not found: /boot/dt.img, but
'deviceinfo_bootimg_qcdt' is set. Please verify that your
device is a QCDT device by analyzing the boot.img file
(e.g. 'pmbootstrap bootimg_analyze path/to/twrp.img')
and based on that, set the deviceinfo variable to false or
adjust your linux APKBUILD to properly generate the dt.img
file. See also: <https://postmarketos.org/deviceinfo>