Merge pull request #121450 from samueldr/feature/cross-uefi-iso
iso-image: Fixes for cross-compilation
This commit is contained in:
commit
37f14fa4d9
|
@ -233,7 +233,10 @@ let
|
|||
# Notes about grub:
|
||||
# * Yes, the grubMenuCfg has to be repeated in all submenus. Otherwise you
|
||||
# will get white-on-black console-like text on sub-menus. *sigh*
|
||||
efiDir = pkgs.runCommand "efi-directory" {} ''
|
||||
efiDir = pkgs.runCommand "efi-directory" {
|
||||
nativeBuildInputs = [ pkgs.buildPackages.grub2_efi ];
|
||||
strictDeps = true;
|
||||
} ''
|
||||
mkdir -p $out/EFI/boot/
|
||||
|
||||
# ALWAYS required modules.
|
||||
|
@ -263,7 +266,7 @@ let
|
|||
|
||||
# Make our own efi program, we can't rely on "grub-install" since it seems to
|
||||
# probe for devices, even with --skip-fs-probe.
|
||||
${grubPkgs.grub2_efi}/bin/grub-mkimage -o $out/EFI/boot/boot${targetArch}.efi -p /EFI/boot -O ${grubPkgs.grub2_efi.grubTarget} \
|
||||
grub-mkimage --directory=${grubPkgs.grub2_efi}/lib/grub/${grubPkgs.grub2_efi.grubTarget} -o $out/EFI/boot/boot${targetArch}.efi -p /EFI/boot -O ${grubPkgs.grub2_efi.grubTarget} \
|
||||
$MODULES
|
||||
cp ${grubPkgs.grub2_efi}/share/grub/unicode.pf2 $out/EFI/boot/
|
||||
|
||||
|
@ -388,7 +391,10 @@ let
|
|||
${refind}
|
||||
'';
|
||||
|
||||
efiImg = pkgs.runCommand "efi-image_eltorito" { buildInputs = [ pkgs.mtools pkgs.libfaketime ]; }
|
||||
efiImg = pkgs.runCommand "efi-image_eltorito" {
|
||||
nativeBuildInputs = [ pkgs.buildPackages.mtools pkgs.buildPackages.libfaketime pkgs.buildPackages.dosfstools ];
|
||||
strictDeps = true;
|
||||
}
|
||||
# Be careful about determinism: du --apparent-size,
|
||||
# dates (cp -p, touch, mcopy -m, faketime for label), IDs (mkfs.vfat -i)
|
||||
''
|
||||
|
@ -408,10 +414,10 @@ let
|
|||
echo "Usage size: $usage_size"
|
||||
echo "Image size: $image_size"
|
||||
truncate --size=$image_size "$out"
|
||||
${pkgs.libfaketime}/bin/faketime "2000-01-01 00:00:00" ${pkgs.dosfstools}/sbin/mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
||||
faketime "2000-01-01 00:00:00" mkfs.vfat -i 12345678 -n EFIBOOT "$out"
|
||||
mcopy -psvm -i "$out" ./EFI ./boot ::
|
||||
# Verify the FAT partition.
|
||||
${pkgs.dosfstools}/sbin/fsck.vfat -vn "$out"
|
||||
fsck.vfat -vn "$out"
|
||||
''; # */
|
||||
|
||||
# Name used by UEFI for architectures.
|
||||
|
@ -420,6 +426,8 @@ let
|
|||
"ia32"
|
||||
else if pkgs.stdenv.isx86_64 then
|
||||
"x64"
|
||||
else if pkgs.stdenv.isAarch32 then
|
||||
"arm"
|
||||
else if pkgs.stdenv.isAarch64 then
|
||||
"aa64"
|
||||
else
|
||||
|
|
|
@ -23,6 +23,7 @@ let
|
|||
efiSystemsBuild = {
|
||||
i686-linux.target = "i386";
|
||||
x86_64-linux.target = "x86_64";
|
||||
armv7l-linux.target = "arm";
|
||||
aarch64-linux.target = "aarch64";
|
||||
};
|
||||
|
||||
|
@ -31,6 +32,7 @@ let
|
|||
efiSystemsInstall = {
|
||||
i686-linux.target = "i386";
|
||||
x86_64-linux.target = "x86_64";
|
||||
armv7l-linux.target = "arm";
|
||||
aarch64-linux.target = "arm64";
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue