Bug#810663: Include Device Tree model in reportbug script

2016-01-21 Thread Roger Shimizu
On Mon, Jan 11, 2016 at 2:23 PM, Martin Michlmayr  wrote:
> Package: linux
> Version: 4.3.3-5
> Severity: wishlist
> Tags: patch
>
> It would be nice to include the Device Tree model in the reportbug
> output.  On DT based platforms, /proc/cpuinfo only includes quite
> generic information.
>
> Please note that the strange "echo ... $(cat ..)" construct is
> intentional.  'cat /proc/device-tree/model' leads to a strange
> character at the end because there's no newline and using echo
> gets rid of it.
>
> diff --git a/debian/templates/image.plain.bug/include-model 
> b/debian/templates/image.plain.bug/include-model
> index 60a7112..9c6aedd 100644
> --- a/debian/templates/image.plain.bug/include-model
> +++ b/debian/templates/image.plain.bug/include-model
> @@ -39,6 +39,11 @@ grep_model() {
>  false
>  ;;
>esac
> +
> +  # Device Tree model
> +  if [ -r /proc/device-tree/model ]; then
> +echo "Device Tree model:" $(cat /proc/device-tree/model)
> +  fi
>  }
>
>  add_model() {

Above patch seems only report the model from dts.
How about user uses a modified dts, other than the one ships with the kernel?

So I suggest to add a hash-code of the dts used currently.
Is there any method to find the file location of dts used currently?

Cheers,
Roger



Bug#810663: Include Device Tree model in reportbug script

2016-01-21 Thread Uwe Kleine-König
Hello Roger,

On Fri, Jan 22, 2016 at 12:11:12AM +0900, Roger Shimizu wrote:
> On Mon, Jan 11, 2016 at 2:23 PM, Martin Michlmayr  wrote:
> > Package: linux
> > Version: 4.3.3-5
> > Severity: wishlist
> > Tags: patch
> >
> > It would be nice to include the Device Tree model in the reportbug
> > output.  On DT based platforms, /proc/cpuinfo only includes quite
> > generic information.
> >
> > Please note that the strange "echo ... $(cat ..)" construct is
> > intentional.  'cat /proc/device-tree/model' leads to a strange
> > character at the end because there's no newline and using echo
> > gets rid of it.
> >
> > diff --git a/debian/templates/image.plain.bug/include-model 
> > b/debian/templates/image.plain.bug/include-model
> > index 60a7112..9c6aedd 100644
> > --- a/debian/templates/image.plain.bug/include-model
> > +++ b/debian/templates/image.plain.bug/include-model
> > @@ -39,6 +39,11 @@ grep_model() {
> >  false
> >  ;;
> >esac
> > +
> > +  # Device Tree model
> > +  if [ -r /proc/device-tree/model ]; then
> > +echo "Device Tree model:" $(cat /proc/device-tree/model)
> > +  fi
> >  }
> >
> >  add_model() {
> 
> Above patch seems only report the model from dts.
> How about user uses a modified dts, other than the one ships with the kernel?
> 
> So I suggest to add a hash-code of the dts used currently.
> Is there any method to find the file location of dts used currently?
The location is not available, because it's put in memory by the
bootloader before jumping into the kernel image. So the best thing you
can do is to extract it from /sys. I don't know off-hand how this works,
but I know who to ask if needed.

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |



Bug#810663: Include Device Tree model in reportbug script

2016-01-21 Thread Roger Shimizu
On Fri, Jan 22, 2016 at 1:44 AM, Uwe Kleine-König
 wrote:
> Hello Roger,
>
> On Fri, Jan 22, 2016 at 12:11:12AM +0900, Roger Shimizu wrote:
>> On Mon, Jan 11, 2016 at 2:23 PM, Martin Michlmayr  wrote:
>> > Package: linux
>> > Version: 4.3.3-5
>> > Severity: wishlist
>> > Tags: patch
>> >
>> > It would be nice to include the Device Tree model in the reportbug
>> > output.  On DT based platforms, /proc/cpuinfo only includes quite
>> > generic information.
>> >
>> > Please note that the strange "echo ... $(cat ..)" construct is
>> > intentional.  'cat /proc/device-tree/model' leads to a strange
>> > character at the end because there's no newline and using echo
>> > gets rid of it.
>> >
>> > diff --git a/debian/templates/image.plain.bug/include-model 
>> > b/debian/templates/image.plain.bug/include-model
>> > index 60a7112..9c6aedd 100644
>> > --- a/debian/templates/image.plain.bug/include-model
>> > +++ b/debian/templates/image.plain.bug/include-model
>> > @@ -39,6 +39,11 @@ grep_model() {
>> >  false
>> >  ;;
>> >esac
>> > +
>> > +  # Device Tree model
>> > +  if [ -r /proc/device-tree/model ]; then
>> > +echo "Device Tree model:" $(cat /proc/device-tree/model)
>> > +  fi
>> >  }
>> >
>> >  add_model() {
>>
>> Above patch seems only report the model from dts.
>> How about user uses a modified dts, other than the one ships with the kernel?
>>
>> So I suggest to add a hash-code of the dts used currently.
>> Is there any method to find the file location of dts used currently?
> The location is not available, because it's put in memory by the
> bootloader before jumping into the kernel image. So the best thing you
> can do is to extract it from /sys. I don't know off-hand how this works,
> but I know who to ask if needed.

According to: http://xillybus.com/tutorials/device-tree-zynq-1
the DTS can be extracted by:

scripts/dtc/dtc -I fs -O dts -o ~/effective.dts /proc/device-tree/

I haven't tried this, but if so and we need to add the dependency of
dtc command, then we can append the DTS to bugreport.

Cheers,
Roger



Bug#810663: Include Device Tree model in reportbug script

2016-01-21 Thread Roger Shimizu
On Fri, Jan 22, 2016 at 1:53 AM, Roger Shimizu  wrote:
> On Fri, Jan 22, 2016 at 1:44 AM, Uwe Kleine-König
>>> Above patch seems only report the model from dts.
>>> How about user uses a modified dts, other than the one ships with the 
>>> kernel?
>>>
>>> So I suggest to add a hash-code of the dts used currently.
>>> Is there any method to find the file location of dts used currently?
>> The location is not available, because it's put in memory by the
>> bootloader before jumping into the kernel image. So the best thing you
>> can do is to extract it from /sys. I don't know off-hand how this works,
>> but I know who to ask if needed.
>
> According to: http://xillybus.com/tutorials/device-tree-zynq-1
> the DTS can be extracted by:
>
> scripts/dtc/dtc -I fs -O dts -o ~/effective.dts /proc/device-tree/
>
> I haven't tried this, but if so and we need to add the dependency of
> dtc command, then we can append the DTS to bugreport.

Can help to try this earlier. So there's the result

# apt install device-tree-compiler
# dtc -I fs /proc/device-tree/

so you can get the full DTS

Cheers,
Roger



Bug#810663: Include Device Tree model in reportbug script

2016-01-11 Thread Uwe Kleine-König
Hello,

On Sun, Jan 10, 2016 at 09:23:40PM -0800, Martin Michlmayr wrote:
> Please note that the strange "echo ... $(cat ..)" construct is
> intentional.  'cat /proc/device-tree/model' leads to a strange
> character at the end because there's no newline and using echo
> gets rid of it.

Maybe put this info also (or instead) in a source comment?

> diff --git a/debian/templates/image.plain.bug/include-model 
> b/debian/templates/image.plain.bug/include-model
> index 60a7112..9c6aedd 100644
> --- a/debian/templates/image.plain.bug/include-model
> +++ b/debian/templates/image.plain.bug/include-model
> @@ -39,6 +39,11 @@ grep_model() {
>  false
>  ;;
>esac
> +
> +  # Device Tree model
> +  if [ -r /proc/device-tree/model ]; then
> +echo "Device Tree model:" $(cat /proc/device-tree/model)

In recent kernels[1] /proc/device-tree is a symlink to
/sys/firmware/devicetree/base. I expect that it stays there for quite a
while, but I wonder if it would be cleaner to use /sys/firmware...
directly. Hmm, probably not, because using proc also covers
2.6.36..3.15.

Best regards
Uwe

[1] since 75b57ecf9d1d ("of: Make device nodes kobjects so they show up
in sysfs") which appeared in 3.15. 

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |



Bug#810663: Include Device Tree model in reportbug script

2016-01-10 Thread Martin Michlmayr
Package: linux
Version: 4.3.3-5
Severity: wishlist
Tags: patch

It would be nice to include the Device Tree model in the reportbug
output.  On DT based platforms, /proc/cpuinfo only includes quite
generic information.

Please note that the strange "echo ... $(cat ..)" construct is
intentional.  'cat /proc/device-tree/model' leads to a strange
character at the end because there's no newline and using echo
gets rid of it.

diff --git a/debian/templates/image.plain.bug/include-model 
b/debian/templates/image.plain.bug/include-model
index 60a7112..9c6aedd 100644
--- a/debian/templates/image.plain.bug/include-model
+++ b/debian/templates/image.plain.bug/include-model
@@ -39,6 +39,11 @@ grep_model() {
 false
 ;;
   esac
+
+  # Device Tree model
+  if [ -r /proc/device-tree/model ]; then
+echo "Device Tree model:" $(cat /proc/device-tree/model)
+  fi
 }
 
 add_model() {

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