0246-scripts-mkknlimg-Append-a-trailer-for-all-input.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 4c9a54f3e2d0f73144e1837e2e7dde39447a40cb Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Mon, 18 Apr 2016 11:56:53 +0100
  4. Subject: [PATCH] scripts/mkknlimg: Append a trailer for all input
  5. Now that the firmware assumes an unsigned kernel is DT-capable, it is
  6. helpful to be able to mark a kernel as being non-DT-capable.
  7. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  8. ---
  9. scripts/mkknlimg | 11 +++++------
  10. 1 file changed, 5 insertions(+), 6 deletions(-)
  11. --- a/scripts/mkknlimg
  12. +++ b/scripts/mkknlimg
  13. @@ -98,7 +98,7 @@ my $append_trailer;
  14. my $trailer;
  15. my $kver = '?';
  16. -$append_trailer = $dtok;
  17. +$append_trailer = 1;
  18. if ($res)
  19. {
  20. @@ -108,7 +108,6 @@ if ($res)
  21. if ($flags & FLAG_PI)
  22. {
  23. - $append_trailer = 1;
  24. $dtok ||= ($flags & FLAG_DTOK) != 0;
  25. $is_270x ||= ($flags & FLAG_270X) != 0;
  26. $is_283x ||= ($flags & FLAG_283X) != 0;
  27. @@ -116,18 +115,18 @@ if ($res)
  28. }
  29. else
  30. {
  31. - print ("* This doesn't look like a Raspberry Pi kernel. In pass-through mode.\n");
  32. + print ("* This doesn't look like a Raspberry Pi kernel.\n");
  33. }
  34. }
  35. elsif (!$dtok)
  36. {
  37. - print ("* Is this a valid kernel? In pass-through mode.\n");
  38. + print ("* Is this a valid kernel?\n");
  39. }
  40. if ($append_trailer)
  41. {
  42. printf("DT: %s\n", $dtok ? "y" : "n");
  43. - printf("DDT: %s\n", $ddtk ? "y" : "n") if ($ddtk);
  44. + printf("DDT: %s\n", $ddtk ? "y" : "n");
  45. printf("270x: %s\n", $is_270x ? "y" : "n");
  46. printf("283x: %s\n", $is_283x ? "y" : "n");
  47. @@ -136,7 +135,7 @@ if ($append_trailer)
  48. push @atoms, [ $trailer_magic, pack('V', 0) ];
  49. push @atoms, [ 'KVer', $kver ];
  50. push @atoms, [ 'DTOK', pack('V', $dtok) ];
  51. - push @atoms, [ 'DDTK', pack('V', $ddtk) ] if ($ddtk);
  52. + push @atoms, [ 'DDTK', pack('V', $ddtk) ];
  53. push @atoms, [ '270X', pack('V', $is_270x) ];
  54. push @atoms, [ '283X', pack('V', $is_283x) ];
  55. push @atoms, [ '283x', pack('V', $is_283x && !$is_270x) ];