<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5">
</HEAD>
<BODY>
Am Samstag, den 07.01.2017, 12:07 +0100 schrieb Jonas Smedegaard:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Quoting permondes - sagen (2017-01-07 10:39:28)
<FONT COLOR="#737373">> Am Samstag, den 07.01.2017, 12:17 +0530 schrieb Sunil Mohan Adapa:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> > On 01/07/2017 05:43 AM, Jonas Smedegaard wrote:</FONT>
<FONT COLOR="#737373">> > [...]</FONT>
<FONT COLOR="#737373">> > >> So it is still booting the 4.3 kernel, which is unknown to aptitude.</FONT>
<FONT COLOR="#737373">> > > </FONT>
<FONT COLOR="#737373">> > > Seems your hardware is ARM-based.  Commonly ARM-based hardware need the </FONT>
<FONT COLOR="#737373">> > > package flashkernel to copy installed kernel + initramfs to the </FONT>
<FONT COLOR="#737373">> > > different (hardware-specific) location where the bootloader looks for </FONT>
<FONT COLOR="#737373">> > > it.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > Indeed you need flash-kernel package.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > If you have boot.cmd instead of boot.scr and also don't have</FONT>
<FONT COLOR="#737373">> > flash-kernel package, you must upgrading and running a FreedomBox image</FONT>
<FONT COLOR="#737373">> > from many releases ago.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > To fix the situation,</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 1. Take backup of your SD card.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 2. Make sure /boot is ext2fs and not vfat.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 3. Install flash-kernel.  This will create the proper /boot/boot.scr</FONT>
<FONT COLOR="#737373">> > file with a line like "setenv fk_kvers '4.8.0-2-armmp-lpae'".</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 4. Optionally set /etc/flash-kernel/machine to "Olimex</FONT>
<FONT COLOR="#737373">> > A20-OLinuXino-LIME2" (depending on your board).  This should not be</FONT>
<FONT COLOR="#737373">> > required as flash-kernel will properly detect the machine when you are</FONT>
<FONT COLOR="#737373">> > running it from within the machine.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 4. Move /boot/boot.cmd to /boot/boot.cmd.bak.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > 5. Reboot and check that boot happens properly.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > If you already have flash-kernel package and /boot/boot.scr, then simply</FONT>
<FONT COLOR="#737373">> > moving /boot/boot.cmd should fix the situation.</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Thanks Jonas, Sunil. flash-kernel was indeed missing. However,</FONT>
<FONT COLOR="#737373">> installing, moving boot.cmd did not help, I am still in 4.3.0 (checked</FONT>
<FONT COLOR="#737373">> with uname -r), boot.cmd was not newly generated. I realize that the</FONT>
<FONT COLOR="#737373">> file boot.scr has some non-readable characters at the beginning, this</FONT>
<FONT COLOR="#737373">> was actually already the case before:</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> > ...:/boot$ cat boot.scr</FONT>
<FONT COLOR="#737373">> > 'V=�ѠV����#�Bi�setenv mmcdev 0</FONT>
<FONT COLOR="#737373">> > setenv mmcpart 1</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > setenv mmcroot /dev/mmcblk0p2 ro</FONT>
<FONT COLOR="#737373">> > setenv mmcrootfstype btrfs rootwait fixrtc</FONT>
<FONT COLOR="#737373">> > setenv mmcrootflags subvol=@</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > setenv console ttyS0,115200n8</FONT>
<FONT COLOR="#737373">> > </FONT>
<FONT COLOR="#737373">> > setenv kernel_file vmlinuz-4.3.0-1-armmp-lpae</FONT>
<FONT COLOR="#737373">> > setenv initrd_file initrd.img-4.3.0-1-armmp-lpae</FONT>
<FONT COLOR="#737373">> > setenv fdtfile sun7i-a20-olinuxino-lime.dtb</FONT>
<FONT COLOR="#737373">> > ...</FONT>
<FONT COLOR="#737373">> </FONT>
<FONT COLOR="#737373">> Should I move also boot.scr, then reinstall flash-kernel and restart?</FONT>

When flash-kernel is installed, it have added a hook to the kernel 
install routines, so instead of moving things around manually it should 
be enough (and safer, and easier to debug) that you afterwards run 
dpkg-reconfigure linux-image-4.8.0-2-armmp-lpae (adjust for the kernel 
you want to reinstall).

As for the stuff it beginning of the file: I believe it is opposite: the 
compiled file as a convenience embeds the cleartext content too at the 
end ;-)


 - Jonas
</PRE>
</BLOCKQUOTE>
<BR>
Hi Jonas,<BR>
<BR>
unfortunately, I am rather kind of the target user for the Freedombox, all these things are far beyond my knowledge of Linux - even though I celebrated my 10 years with Linux last summer.<BR>
So the reconfig went through successfully (I think), here is the output:<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
    ...:/boot$ sudo dpkg-reconfigure linux-image-4.8.0-2-armmp-lpae<BR>
    <BR>
    [sudo] Passwort für Dietmar: <BR>
    <BR>
    /etc/kernel/postinst.d/apt-auto-removal:<BR>
    <BR>
    N: Datei »50unattended-upgrades.ucf-dist« in Verzeichnis »/etc/apt/apt.conf.d/« wird ignoriert, da sie eine ungültige Dateinamen-Erweiterung hat.<BR>
    <BR>
    N: Datei »50unattended-upgrades.ucf-dist« in Verzeichnis »/etc/apt/apt.conf.d/« wird ignoriert, da sie eine ungültige Dateinamen-Erweiterung hat.<BR>
    <BR>
    N: Datei »50unattended-upgrades.ucf-dist« in Verzeichnis »/etc/apt/apt.conf.d/« wird ignoriert, da sie eine ungültige Dateinamen-Erweiterung hat.<BR>
    <BR>
    /etc/kernel/postinst.d/initramfs-tools:<BR>
    <BR>
    update-initramfs: Generating /boot/initrd.img-4.8.0-2-armmp-lpae<BR>
    <BR>
    DTB: sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Installing /usr/lib/linux-image-4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb into /boot/dtbs/4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Installing new sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing /usr/lib/linux-image-4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb into /boot/dtbs/4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Taking backup of sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing new sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    flash-kernel: deferring update (trigger activated)<BR>
    <BR>
    /etc/kernel/postinst.d/zz-flash-kernel:<BR>
    <BR>
    DTB: sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Installing /usr/lib/linux-image-4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb into /boot/dtbs/4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Taking backup of sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing new sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing /usr/lib/linux-image-4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb into /boot/dtbs/4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Taking backup of sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing new sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    flash-kernel: deferring update (trigger activated)<BR>
    <BR>
    Trigger für flash-kernel (3.73) werden verarbeitet ...<BR>
    <BR>
    DTB: sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Installing /usr/lib/linux-image-4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb into /boot/dtbs/4.8.0-2-armmp-lpae/sun7i-a20-olinuxino-lime.dtb<BR>
    <BR>
    Taking backup of sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    Installing new sun7i-a20-olinuxino-lime.dtb.<BR>
    <BR>
    flash-kernel: installing version 4.8.0-2-armmp-lpae<BR>
    <BR>
    Generating boot script u-boot image... done.<BR>
    <BR>
    Taking backup of boot.scr.<BR>
    <BR>
    Installing new boot.scr.<BR>
    <BR>
</BLOCKQUOTE>
<PRE>
boot.scr also looks okay:
</PRE>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
...:/boot$ cat boot.scr
'V�or�Xp�Z    _
                 C� boot script  W# boot script for Allwinner SunXi-based devices

# Mainline u-boot v2014.10 introduces a new default environment and
# a new common bootcmd handling for all platforms, which is not fully
# compatible with the old-style environment used by u-boot-sunxi.
# This script therefore needs to check in which environment it
# is running and set some variables accordingly.

# On u-boot-sunxi, this script assumes that ${device} and ${partition}
# are set.

# The new-style environment predefines ${boot_targets}, the old-style
# environment does not.
if test -n "${boot_targets}"
then
  echo "Mainline u-boot / new-style environment detected."
  # Mainline u-boot v2014.10 uses ${devtype}, ${devnum} and
  # ${bootpart} where u-boot-sunxi uses ${device} and ${partition}.
  # ${distro_bootpart} replaced ${bootpart} in u-boot v2016.01.
  if test -z "${device}"; then setenv device "${devtype}"; fi
  if test -z "${partition}${distro_bootpart}"; then setenv partition "${devnum}:${bootpart}"; fi
  if test -z "${partition}"; then setenv partition "${devnum}:${distro_bootpart}"; fi
else
  echo "U-boot-sunxi / old-style environment detected."
  # U-boot-sunxi does not predefine kernel_addr_r, fdt_addr_r and
  # ramdisk_addr_r, so they have to be manually set. Use the values
  # from mainline u-boot v2014.10, except for ramdisk_addr_r,
  # which is set to 0x44300000 to allow for initrds larger than
  # 13MB on u-boot-sunxi.
  setenv kernel_addr_r 0x42000000
  setenv fdt_addr_r 0x43000000
  setenv ramdisk_addr_r 0x44300000
fi

if test -n "${console}"; then
  setenv bootargs "${bootargs} console=${console}"
fi

setenv bootargs  ${bootargs} quiet


image_locations='/boot/ /'
if test -z "${fk_kvers}"; then
   setenv fk_kvers '4.8.0-2-armmp-lpae'
fi

if test -n "${fdtfile}"; then
   setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
else
   setenv fdtpath dtb-${fk_kvers}
fi

for pathprefix in ${image_locations}
do
  if test -e ${device} ${partition} ${pathprefix}vmlinuz-${fk_kvers}
  then
    load ${device} ${partition} ${kernel_addr_r} ${pathprefix}vmlinuz-${fk_kvers} \
    && load ${device} ${partition} ${fdt_addr_r} ${pathprefix}${fdtpath} \
    && load ${device} ${partition} ${ramdisk_addr_r} ${pathprefix}initrd.img-${fk_kvers} \
    && echo "Booting Debian ${fk_kvers} from ${device} ${partition}..." \
    && bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
  fi
done

</PRE>
</BLOCKQUOTE>
<PRE>
But the device does not boot!
I can unplug the micro-SD card to check some log files on my computer, do you have an idea where to start?

Thanks
        Dietmar
</PRE>
</BODY>
</HTML>