On Mon, Feb 8, 2016 at 2:06 PM, Mark Rutland mark.rutland@arm.com wrote:
On Mon, Feb 08, 2016 at 03:35:36PM +0000, Grant Likely wrote:
Hi all,
Hi Grant,
I've spent some time over the past couple of days getting update-grub working on the hikey. It works for me, but I need some review. The solution consists of three parts:
- a new config file in /etc/default/kernel that can contain
KERNEL_DEVICETREE="<board-name>" 2) a new script in /etc/kernel/postinst.d/devicetree that copies the requested device tree file into /boot when KERNEL_DEVICETREE is set 3) a modifcation to /etc/grub.d/10_linux that will add the devicetree command when KERNEL_DEVICETREE is set.
I've also be partially successful using the grub-install tool. It will install the grubaa64.efi application correctly in (ESP)/EFI/debian/grubaa64.efi, but barfs when trying to update the EFI variables which is unsurprising. However, the system boots fine when I copy the installed grubaa64.efi into (ESP)/EFI/BOOT/grubaa64.efi
I believe this is because the HiKey EDK2 port has hard-coded assumptions about particular file paths (e.g. /EFI/BOOT/grubaa64.efi) beyond that specified for removable media (e.g. /EFI/boot/bootaa64.efi).
That seems like a bug (and is certainly not in the spirit of EFI).
With these changes I can install a kernel package, and grub gets updated correctly with the new kernel information.
I'm rather worried by this, and very much not keen on having distro-packaged GRUB have to know anything about what should be a system-provided DTB.
While this does seem to make it easier for users in the short term, it disincentivizes doing the right thing, and pushes a lot of pain back to the upstream kernel and distros (in having to maintain those DTBs, packages and updates thereof, etc). I don't think that's generally a good thing.
DTBs shouldn't get broken arbitrarily, so there's no strict need to run the latest and greatest DTB. What prevents the HiKey firmware from providing a minimal but correct DTB for now? That can be updated as time goes on (e.g. with capsule updates).
That should work fine for end users. Developers will be messing with custom bleeding-edge DTBs regardless of distro packaging.
I think this causes more long term pain than the short term pain it solves, and I think that it hides the pain from those who should be feeling it.
I think this is quite useful for development (since there is quite a bit of upstreaming going now, finally), but I also agree that it might be better to just fix/improve our firmware.
If we get the firmware right (by providing the DTB), it will be easier for everyone using hikey with any distro.
Cheers,