Bug#884003: FDT overlay support

2017-12-20 Thread Andre Heider

Hi Vagrant,

On 20/12/17 22:32, Vagrant Cascadian wrote:

On 2017-12-12, Andre Heider wrote:

I added the ability to concatenate multiple scripts/snippets for the
final boot script.
The new overlay handling snippet is supposed to be
used with this. But the feature itself also allows nice cleanups,
demonstrated on odroid-u3 and beaglebone (and there're quite some more
cleanups possible).


I very much like the idea of this; so many of the boot scripts
copy-and-paste a lot of code between them, which makes maintenence more
difficult as well as implementing features and changes across all the
boot scripts...


Yeah, the copypasta is the first thing I noticed after git cloning. I 
tried to make the overlay support universal. So the less duplication 
there is, the easier it'll get to reuse it.



Unfortunately, I haven't had a chance to do more than a very cursory
glance at your patches yet. Made some comments in-line on some of the
individual patches below.


Thanks for the first glance! There's no need to hurry, especially with 
xmas around the corner.



To test this, you need:
- u-boot with CONFIG_OF_LIBFDT_OVERLAY
- base dtb with symbols (-@)


Would the symbols (-@) be harmful to enable in Debian's kernels by
default?


That's the big question. I looked around and found 3 cases where 
distros/downstreams enable symbols, see [1], [2] and [3]. But those 3 
are in a different boat than debian: It's just per family of SoC.


I'm not sure if anything breaks if debian would enable it for its armhf 
multi platform build. I'm currently trying to find out with a solution 
appropriate for the upstream kernel [4], but I'm not sure if that pans out.



Is it feasible to use dtc to extract the .dts, rebuild it with -@, and
then use that .dtb instead... or does it need more information from the
original device tree(s)?


That's not going to work, without -@ the "__symbols__" node is missing. 
Without that an overlay can not reference e.g. the alias 'spi0'. You 
need the original dts to include these.



- your own overlays, again with symbols, in /boot/dtbs/overlays


Are there some very basic example overlays that would be feasible to just test 
that
this feature is working?

I don't have much experience with overlays, but have a beagleboneblack
and a CHIP that in theory support this, and some devices I can attach
that require overlays...

Will try to test myself sometime in the coming weeks.


Since I used a boneblack too, you can find my basic overlays attached. 
I'm not a device tree expert, so they might not be correct, but they're 
good enough to test this and see the results (especially since commit [5]).



From: Andre Heider 
Date: Tue, 12 Dec 2017 09:23:37 +0100
Subject: [PATCH 01/10] bootscr.uboot-generic: quote bootargs

Signed-off-by: Andre Heider 
---
  bootscript/all/bootscr.uboot-generic | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bootscript/all/bootscr.uboot-generic 
b/bootscript/all/bootscr.uboot-generic
index db4066a..bcf6e96 100644
--- a/bootscript/all/bootscr.uboot-generic
+++ b/bootscript/all/bootscr.uboot-generic
@@ -25,7 +25,7 @@ if test -n "${console}"; then
setenv bootargs "${bootargs} console=${console}"
  fi
  
-setenv bootargs @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} @@LINUX_KERNEL_CMDLINE@@

+setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} 
@@LINUX_KERNEL_CMDLINE@@"
  @@UBOOT_ENV_EXTRA@@
  
  if test -z "${fk_kvers}"; then


Why is this needed?


It's not, I did that just to be consistent (see 3 lines above). Patch 
can be dropped if you disagree.



From: Andre Heider 
Date: Tue, 12 Dec 2017 09:25:26 +0100
Subject: [PATCH 05/10] bootscr.uboot-generic: support multiple prefixes to
  load from

Allow custom boot scripts to set $fk_image_locations as a list of
directories to load boot files from.

If unset, $prefix will be the used - which is sufficient for all recent
u-boot versions.

This allows the clean up of various custom boot scripts. Code borrowed
form the sunxi script.

Signed-off-by: Andre Heider 
---
  bootscript/all/bootscr.uboot-generic | 38 +---
  1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/bootscript/all/bootscr.uboot-generic 
b/bootscript/all/bootscr.uboot-generic
index bcf6e96..509efe7 100644
--- a/bootscript/all/bootscr.uboot-generic
+++ b/bootscript/all/bootscr.uboot-generic
@@ -48,14 +48,30 @@ else
setenv partition ${distro_bootpart}
  fi
  
-load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${prefix}vmlinuz-${fk_kvers} \

-&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${prefix}${fdtpath} \
-&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} 
${prefix}initrd.img-${fk_kvers} \
-&& echo "Booting Debian ${fk_kvers} from ${devtype} ${devnum}:${partition}..." 
\
-&& bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
-
-load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${prefix}vmlinuz \
-&& load ${devtype} ${devnum}:${partitio

Bug#884003: FDT overlay support

2017-12-20 Thread Vagrant Cascadian
On 2017-12-12, Andre Heider wrote:
> Attached a patch series with an implementation.

Thanks for the patches!


> I added the ability to concatenate multiple scripts/snippets for the 
> final boot script.
> The new overlay handling snippet is supposed to be 
> used with this. But the feature itself also allows nice cleanups, 
> demonstrated on odroid-u3 and beaglebone (and there're quite some more 
> cleanups possible).

I very much like the idea of this; so many of the boot scripts
copy-and-paste a lot of code between them, which makes maintenence more
difficult as well as implementing features and changes across all the
boot scripts...

Unfortunately, I haven't had a chance to do more than a very cursory
glance at your patches yet. Made some comments in-line on some of the
individual patches below.


> To test this, you need:
> - u-boot with CONFIG_OF_LIBFDT_OVERLAY
> - base dtb with symbols (-@)

Would the symbols (-@) be harmful to enable in Debian's kernels by
default?

Is it feasible to use dtc to extract the .dts, rebuild it with -@, and
then use that .dtb instead... or does it need more information from the
original device tree(s)?


> - your own overlays, again with symbols, in /boot/dtbs/overlays

Are there some very basic example overlays that would be feasible to just test 
that
this feature is working?

I don't have much experience with overlays, but have a beagleboneblack
and a CHIP that in theory support this, and some devices I can attach
that require overlays...

Will try to test myself sometime in the coming weeks.


> With e.g. foo.dtb and bar.dtb in /boot/dtbs/overlays you can then set 
> either set $fk_overlays on the u-boot prompt or OVERLAYS in 
> /etc/defaults/flash-kernel to "foo bar".
>
> Testing on beaglebone looks promising so far ;)

This is great!


> From efaadbd96967674f2fb82eb530dd447a6b5c65ba Mon Sep 17 00:00:00 2001
> From: Andre Heider 
> Date: Tue, 12 Dec 2017 09:23:37 +0100
> Subject: [PATCH 01/10] bootscr.uboot-generic: quote bootargs
>
> Signed-off-by: Andre Heider 
> ---
>  bootscript/all/bootscr.uboot-generic | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bootscript/all/bootscr.uboot-generic 
> b/bootscript/all/bootscr.uboot-generic
> index db4066a..bcf6e96 100644
> --- a/bootscript/all/bootscr.uboot-generic
> +++ b/bootscript/all/bootscr.uboot-generic
> @@ -25,7 +25,7 @@ if test -n "${console}"; then
>setenv bootargs "${bootargs} console=${console}"
>  fi
>  
> -setenv bootargs @@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} 
> @@LINUX_KERNEL_CMDLINE@@
> +setenv bootargs "@@LINUX_KERNEL_CMDLINE_DEFAULTS@@ ${bootargs} 
> @@LINUX_KERNEL_CMDLINE@@"
>  @@UBOOT_ENV_EXTRA@@
>  
>  if test -z "${fk_kvers}"; then

Why is this needed?


> From 8dd287741e23ea06c6a8e480ab1f24689d36bf9b Mon Sep 17 00:00:00 2001
> From: Andre Heider 
> Date: Tue, 12 Dec 2017 08:18:12 +0100
> Subject: [PATCH 03/10] Add support for multiple scripts sources
>
> Allow multiple entries in 'U-Boot-Script-Name' and concatenate them
> as the final boot script.
>
> Signed-off-by: Andre Heider 
> ---
>  functions | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
...
> From 132dfdeb0e9a5a396ee543ee1386cb750929846f Mon Sep 17 00:00:00 2001
> From: Andre Heider 
> Date: Tue, 12 Dec 2017 09:12:28 +0100
> Subject: [PATCH 04/10] odroid-u3: clean up boot script
>
> bootscr.odroid first sets some compatibility variables and then contains
> a full copy of bootscr.uboot-generic.
>
> Get rid of the copy and use the multiple scripts feature instead. This
> results in the very same boot script.
>
> Signed-off-by: Andre Heider 
> ---
>  bootscript/armhf/bootscr.odroid | 63 
> -
>  db/all.db   |  2 +-
>  2 files changed, 1 insertion(+), 64 deletions(-)

Love these!


> From b29052bfe4deaf359635347e1e0fc559059067e9 Mon Sep 17 00:00:00 2001
> From: Andre Heider 
> Date: Tue, 12 Dec 2017 09:25:26 +0100
> Subject: [PATCH 05/10] bootscr.uboot-generic: support multiple prefixes to
>  load from
>
> Allow custom boot scripts to set $fk_image_locations as a list of
> directories to load boot files from.
>
> If unset, $prefix will be the used - which is sufficient for all recent
> u-boot versions.
>
> This allows the clean up of various custom boot scripts. Code borrowed
> form the sunxi script.
>
> Signed-off-by: Andre Heider 
> ---
>  bootscript/all/bootscr.uboot-generic | 38 
> +---
>  1 file changed, 27 insertions(+), 11 deletions(-)
>
> diff --git a/bootscript/all/bootscr.uboot-generic 
> b/bootscript/all/bootscr.uboot-generic
> index bcf6e96..509efe7 100644
> --- a/bootscript/all/bootscr.uboot-generic
> +++ b/bootscript/all/bootscr.uboot-generic
> @@ -48,14 +48,30 @@ else
>setenv partition ${distro_bootpart}
>  fi
>  
> -load ${devtype} ${devnum}:${partition} ${kernel_addr_r} 
> ${prefix}vmlinuz-${fk_kvers} \
> -&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${prefix}${fdtpath} \

I

2017-12-20 Thread afr...@yahoo.com


Sent from my iPhone



Using kernel boot parameter that is deprecated in grub2

2017-12-20 Thread john doe

Hi list,

This mailing list seems more appropriate for this type of questions than 
debian-user.


I'm booting and installing debian 9 using a serial console.

After entering the boot command:

"install console=ttyS0,115200n8"

the following appeared:

"Undefined video mode number: 314
Press  to see video modes available,  to continue, or wait 
30 sec"


This can be suppressed by  adding 'vga=off'.
However, vga=* is deprecated in grub2 and will make your newly 
installation unbootable.
I would prefer not to have to manually correct this issue using rescue 
mode or so on...


The error given by grub2 after installation is:

"Loading Linux 4.9.0-4-amd64 ...
text is deprecated. Use set gfxpayload=vga=off before linux command instead.
error: unrecognized number.
Loading initial ramdisk ...
error: you need to load the kernel first."

Does anyone has any idea on how to avoied that prompt while keeping 
grub2 happy?


In other words: how can I use kernel boot parameter if they are 
deprecated in grub2?


--
John Doe



Bug#884854: debian-installer: Use temporary IPv6 addresses (RFC3041)

2017-12-20 Thread Łukasz Stelmach
Package: debian-installer
Severity: minor

Dear Maintainer,

debian-installer does not set use_tempaddr[1] for network interfaces it
brings up. If the machine Debian is installed on is connected to an IPv6
capable network, the source address used to download packages contains
the machines MAC address.

[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/ip-sysctl.txt?h=v4.9#n1566

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8), 
LANGUAGE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Było mi bardzo miło.  --- Rurku. --- ...
>Łukasz<--- To dobrze, że mnie słuchasz.


pgpL49X88AArU.pgp
Description: PGP signature