1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-11-28 12:56:54 +03:00

bootimg: Makes the build more resilient across devices...

This is because sometimes the final kernel image isn't named as
expected...

Also adds an important note about our mkbootimg.
This commit is contained in:
Samuel Dionne-Riel 2019-01-28 19:52:33 -05:00
parent 361de42767
commit 3ddb53c6fd
2 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,13 @@
let
version = "2017.12.13";
in
# https://github.com/osm0sis/mkbootimg/blob/2017.12.13/bootimg.h
# This builds the MSM-specific bootimgs...
# This is... not entirely bad, but not good either.
# We will probably need to make it available as msm-mkbootimg...
# MAIN difference is this:
# * https://github.com/osm0sis/mkbootimg/blob/015be7ed1001f60c9d621970cab71577d396f452/bootimg.h#L46
# This is in place of the `uint32_t header_version` field.
stdenv.mkDerivation {
inherit version;
name = "mkbootimg";

View File

@ -11,7 +11,9 @@ let
device_info = device_config.info;
with_qcdt = device_info ? bootimg_qcdt && device_info.bootimg_qcdt;
linux = device_info.kernel;
kernel = ''${linux}/vmlinuz${if with_qcdt then "-dtb" else ""}'';
kernel = ''${linux}/${linux.image}'';
# TODO : make configurable
dt = "${linux}/boot/dt.img";
# TODO : Allow appending / prepending
@ -33,6 +35,10 @@ pkgs.stdenv.mkDerivation {
];
installPhase = ''
echo Using kernel: ${kernel}
(
PS4=" $ "
set -x
mkbootimg \
--kernel ${kernel} \
${
@ -50,5 +56,6 @@ pkgs.stdenv.mkDerivation {
--tags_offset ${device_info.flash_offset_tags } \
--pagesize ${device_info.flash_pagesize } \
-o $out
)
'';
}