Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2017-01-04 Thread Geert Stappers
On Mon, Jan 02, 2017 at 03:17:32PM -0800, Martin Michlmayr wrote:
> Thanks, I applied this patch.

Cross-reference to related bugreport
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845818



Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2017-01-02 Thread Martin Michlmayr
Thanks, I applied this patch.

U-boot on the ARM64 system I tested (a Jetson TX1) accepts boot
scripts with both -A arm and -A arm64, but as you point out this may
not be the case on all systems.

-- 
Martin Michlmayr
http://www.cyrius.com/



Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2016-12-18 Thread Heinrich Schuchardt
On 12/17/2016 11:22 PM, Martin Michlmayr wrote:
> * Heinrich Schuchardt  [2016-11-26 16:54]:
>> I want to get the Hardkernel Odroid C2 supported by flash-kernel.
>>
>> It is a 64bit system.
>>
>> Unfortunately in file /usr/share/flash-kernel/functions the functions
>> mkimage_kernel() and mkimage_initrd() both call mkimage with argument
>>
>>  -A arm .
>>
>> This is incorrect. On 64bit arm systems you have to use
>>
>>  -A arm64 .
>>
>> Otherwise neither u-boot nor the kernel can read the images.
> 
> Your latest patch looks fine to me but I'm wondering why this is
> needed in the first place.
> 
> On modern devices, we no longer wrap the kernel and initrd into an
> u-boot image, but we boot it directly using bootz (arm) or booti
> (arm64).
> 
> I see there's also one "mkimage -A arm" call to generate the boot
> script.  Is that's what causing you the problem?
> 
Hello Martin,

for my Hardkernel Odroid C2 mailine U-Boot support is still incomplete.
It can only boot from tftp.

The legacy U-Boot provided by Hardkernel has a booti command but it
crashes with a mainline kernel.

The legacy kernel image does not start with 4D 5A (MZ) as normal images do.

So unfortunately currently I am stuck with bootm.

With my patch package flash-kernel is usable after updating the database
(cf. #845818).

Looking at the flash-kernel package you will find
/etc/flash-kernel/bootscript/bootscr.xgene-mustang uses bootm too.

Best regards

Heinrich Schuchardt



Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2016-12-17 Thread Martin Michlmayr
* Heinrich Schuchardt  [2016-11-26 16:54]:
> I want to get the Hardkernel Odroid C2 supported by flash-kernel.
> 
> It is a 64bit system.
> 
> Unfortunately in file /usr/share/flash-kernel/functions the functions
> mkimage_kernel() and mkimage_initrd() both call mkimage with argument
> 
>  -A arm .
> 
> This is incorrect. On 64bit arm systems you have to use
> 
>  -A arm64 .
> 
> Otherwise neither u-boot nor the kernel can read the images.

Your latest patch looks fine to me but I'm wondering why this is
needed in the first place.

On modern devices, we no longer wrap the kernel and initrd into an
u-boot image, but we boot it directly using bootz (arm) or booti
(arm64).

I see there's also one "mkimage -A arm" call to generate the boot
script.  Is that's what causing you the problem?

-- 
Martin Michlmayr
http://www.cyrius.com/



Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2016-11-27 Thread Heinrich Schuchardt
> 
> I think it's currently possible to use flash-kernel:armhf on an
> arm64 system to build an armhf image, and this would break that.
> Given that flash-kernel is an arch-dependent package, I think it
> should use the package architecture here instead of `uname -m`.
> 
> (But since flash-kernel doesn't contain any native code, I think
> it wwould be even better to make it arch-independent and to specify
> the machine architecture in each entry in db/all.db.)
> 
> Ben.
> 

Specifying the machine architecture in db/all.db will not solve the
problem.

The key field for all.db is the "Machine" property read from
/proc/device-tree/model. (It would be safer to read the property from
the new dtb to be installed because the model property may change over
time as has happened for the "Wandboard i.MX6 Quad Board rev B1".)

If a system is supported both by armhf and arm64 kernels we cannot
safely assume that the model property is different. Both armhf and
arm64 kernels might (or even should) be using the same device tree.

If we want to provide the package architecture we would have to pass
it to the kernel hooks.
linux-image-3.16.0-4-amd64.postinst has variable $arch.
Unfortunately it is missing in linux-image-4.7.0-1-amd64.postinst.
We could copy the architecture to an environment variable here, e.g.

$ENV{'DEB_ARCH'}="$arch";

Best regards

Heinrich Schuchardt



Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2016-11-26 Thread Ben Hutchings
On Sat, 2016-11-26 at 16:54 +, Heinrich Schuchardt wrote:
> Package: flash-kernel
> Version: 3.71
> Severity: normal
> 
> Dear Maintainer,
> 
> I want to get the Hardkernel Odroid C2 supported by flash-kernel.
> 
> It is a 64bit system.
> 
> Unfortunately in file /usr/share/flash-kernel/functions the functions
> mkimage_kernel() and mkimage_initrd() both call mkimage with argument
> 
>  -A arm .
> 
> This is incorrect. On 64bit arm systems you have to use
> 
>  -A arm64 .
> 
> Otherwise neither u-boot nor the kernel can read the images.
> 
> I suggest to use `uname -m` to determine the architectue.
> If it is aarch64 use mkimage -A arm64.

I think it's currently possible to use flash-kernel:armhf on an arm64
system to build an armhf image, and this would break that.  Given that
flash-kernel is an arch-dependent package, I think it should use the
package architecture here instead of `uname -m`.

(But since flash-kernel doesn't contain any native code, I think it
wwould be even better to make it arch-independent and to specify the
machine architecture in each entry in db/all.db.)

Ben.

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein



signature.asc
Description: This is a digitally signed message part


Bug#845779: flash-kernel: flashkernel uses mkimage -A arm on arm64

2016-11-26 Thread Heinrich Schuchardt
Package: flash-kernel
Version: 3.71
Severity: normal

Dear Maintainer,

I want to get the Hardkernel Odroid C2 supported by flash-kernel.

It is a 64bit system.

Unfortunately in file /usr/share/flash-kernel/functions the functions
mkimage_kernel() and mkimage_initrd() both call mkimage with argument

 -A arm .

This is incorrect. On 64bit arm systems you have to use

 -A arm64 .

Otherwise neither u-boot nor the kernel can read the images.

I suggest to use `uname -m` to determine the architectue.
If it is aarch64 use mkimage -A arm64.

Best regards

Heinrich Schuchardt

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: arm64 (aarch64)

Kernel: Linux 4.9.0-rc6-next-20161124 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages flash-kernel depends on:
ii  debconf [debconf-2.0]  1.5.59
ii  devio  1.2-1.2
ii  initramfs-tools0.125
ii  linux-base 4.5
ii  mtd-utils  1:1.5.2-1
ii  ucf3.0036

Versions of packages flash-kernel recommends:
ii  u-boot-tools  2016.11+dfsg1-1

flash-kernel suggests no packages.

-- debconf information:
  flash-kernel/linux_cmdline: quiet