diff mbox

RFC: cp codes

Message ID 56C21464.1050606@redhat.com
State Superseded
Headers show

Commit Message

Thomas Huth Feb. 15, 2016, 6:09 p.m. UTC
On 10.02.2016 13:19, Thomas Huth wrote:
> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>> Hi,
>>>>>
>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>> codes with backspace:
>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>
>>>>> We start a VM and record log, this is fine. But then when we look at
>>>>> the log through WebUI, because of backspace, Mozilla thinks this is a
>>>>> binary file.
>>>>>
>>>>> At devconf I discussed this with Thomas, and he proposed to use nvram
>>>>> variable here. But it seems QEMU's --prom-env seems to be OpenBIOS
>>>>> specific.
>>>>>
>>>>> Any comments for bring --prom-env support to SLOF? Or are there other
>>>>> options I can use,
>>>>> to change libbootmsg behaviour?
> ...
>>>> So I'd suggest to introduce a new environment variable into
>>>> slof/fs/envvar_defaults.fs and then check the contents of the variable
>>>> during the "cp" Forth function, so that it only prints the backslashes
>>>> if the envvar has the right value.
>>>
>>> Yep. Did it. But it seems a problem is envvar initialized a way after
>>> we start printing cp codes.
> 
> Oh, I see, envvar.fs is included very late in OF.fs. You could try to
> move it to an earlier spot, but I guess that will break the boot due to
> various dependencies between the Forth files, e.g. SLOF likely has to
> parse the flattened device tree from QEMU first to know how to access
> the NVRAM ... :-/
> 
> The only other possibility to pass information to SLOF is currently the
> flattened device tree from QEMU - but that likely also does not work
> here since fdt.fs is also included quite late in OF.fs.

Just a completely different idea, but would the following patch also fix
your issue?

Replacing 5 '\b's with one '\r' should IMHO be ok here since the
checkpoints should always be printed at the beginning of a line...

 Thomas

Comments

Dinar Valeev Feb. 15, 2016, 6:57 p.m. UTC | #1
On 15 Feb 2016 19:09, "Thomas Huth" <thuth@redhat.com> wrote:
>
> On 10.02.2016 13:19, Thomas Huth wrote:
> > On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
> >> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
> >>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
> >>>> On 08.02.2016 15:10, Dinar Valeev wrote:
> >>>>> Hi,
> >>>>>
> >>>>> I have long standing issue with SLOF. During start SLOF prints cp
> >>>>> codes with backspace:
> >>>>>
https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
> >>>>>
> >>>>> We start a VM and record log, this is fine. But then when we look at
> >>>>> the log through WebUI, because of backspace, Mozilla thinks this is
a
> >>>>> binary file.
> >>>>>
> >>>>> At devconf I discussed this with Thomas, and he proposed to use
nvram
> >>>>> variable here. But it seems QEMU's --prom-env seems to be OpenBIOS
> >>>>> specific.
> >>>>>
> >>>>> Any comments for bring --prom-env support to SLOF? Or are there
other
> >>>>> options I can use,
> >>>>> to change libbootmsg behaviour?
> > ...
> >>>> So I'd suggest to introduce a new environment variable into
> >>>> slof/fs/envvar_defaults.fs and then check the contents of the
variable
> >>>> during the "cp" Forth function, so that it only prints the
backslashes
> >>>> if the envvar has the right value.
> >>>
> >>> Yep. Did it. But it seems a problem is envvar initialized a way after
> >>> we start printing cp codes.
> >
> > Oh, I see, envvar.fs is included very late in OF.fs. You could try to
> > move it to an earlier spot, but I guess that will break the boot due to
> > various dependencies between the Forth files, e.g. SLOF likely has to
> > parse the flattened device tree from QEMU first to know how to access
> > the NVRAM ... :-/
> >
> > The only other possibility to pass information to SLOF is currently the
> > flattened device tree from QEMU - but that likely also does not work
> > here since fdt.fs is also included quite late in OF.fs.
>
> Just a completely different idea, but would the following patch also fix
> your issue?
Hi, thanks I'll give it a try. But only in a week. I'm in the middle of
nowhere with very limited internet access.

My test case would be:
osc co openSUSE: Factory:PowerPC/some-dummy-package

osc build --vm-type kvm

The open saved log with Firefox.

About plugins, I'm already using something called open with. But my
intention to fix it for all users who might access logs from OBS.
>
> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
> index 2e4c135..14ce4bf 100644
> --- a/lib/libbootmsg/bootmsg_lvl.S
> +++ b/lib/libbootmsg/bootmsg_lvl.S
> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>         bl      io_putchar      // print character
>         mr      r3, r9
>         bl      io_printhex16   // print checkpoint ID
> -       .rept   5
> -       li      r3,'\b'
> -       bl      io_putchar      // print backspaces
> -       .endr
> +       li      r3,'\r'
> +       bl      io_putchar      // go back
>         mtlr    r11
>         blr
>
> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
> checkpoints should always be printed at the beginning of a line...
>
>  Thomas
>
>
Dinar Valeev Feb. 23, 2016, 3:15 p.m. UTC | #2
On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com> wrote:
> On 10.02.2016 13:19, Thomas Huth wrote:
>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>>> codes with backspace:
>>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>>
>>>>>> We start a VM and record log, this is fine. But then when we look at
>>>>>> the log through WebUI, because of backspace, Mozilla thinks this is a
>>>>>> binary file.
>>>>>>
>>>>>> At devconf I discussed this with Thomas, and he proposed to use nvram
>>>>>> variable here. But it seems QEMU's --prom-env seems to be OpenBIOS
>>>>>> specific.
>>>>>>
>>>>>> Any comments for bring --prom-env support to SLOF? Or are there other
>>>>>> options I can use,
>>>>>> to change libbootmsg behaviour?
>> ...
>>>>> So I'd suggest to introduce a new environment variable into
>>>>> slof/fs/envvar_defaults.fs and then check the contents of the variable
>>>>> during the "cp" Forth function, so that it only prints the backslashes
>>>>> if the envvar has the right value.
>>>>
>>>> Yep. Did it. But it seems a problem is envvar initialized a way after
>>>> we start printing cp codes.
>>
>> Oh, I see, envvar.fs is included very late in OF.fs. You could try to
>> move it to an earlier spot, but I guess that will break the boot due to
>> various dependencies between the Forth files, e.g. SLOF likely has to
>> parse the flattened device tree from QEMU first to know how to access
>> the NVRAM ... :-/
>>
>> The only other possibility to pass information to SLOF is currently the
>> flattened device tree from QEMU - but that likely also does not work
>> here since fdt.fs is also included quite late in OF.fs.
>
> Just a completely different idea, but would the following patch also fix
> your issue?
>
> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
> index 2e4c135..14ce4bf 100644
> --- a/lib/libbootmsg/bootmsg_lvl.S
> +++ b/lib/libbootmsg/bootmsg_lvl.S
> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>         bl      io_putchar      // print character
>         mr      r3, r9
>         bl      io_printhex16   // print checkpoint ID
> -       .rept   5
> -       li      r3,'\b'
> -       bl      io_putchar      // print backspaces
> -       .endr
> +       li      r3,'\r'
> +       bl      io_putchar      // go back
>         mtlr    r11
>         blr
>
> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
> checkpoints should always be printed at the beginning of a line...
I gave it a try.. It works flawlessly...

Could you commit it?

Dinar,
>
>  Thomas
>
>
Thomas Huth Feb. 24, 2016, 7:45 a.m. UTC | #3
On 23.02.2016 16:15, Dinar Valeev wrote:
> On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com> wrote:
>> On 10.02.2016 13:19, Thomas Huth wrote:
>>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>>>> codes with backspace:
>>>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>>>
>>>>>>> We start a VM and record log, this is fine. But then when we look at
>>>>>>> the log through WebUI, because of backspace, Mozilla thinks this is a
>>>>>>> binary file.
...
>> Just a completely different idea, but would the following patch also fix
>> your issue?
>>
>> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
>> index 2e4c135..14ce4bf 100644
>> --- a/lib/libbootmsg/bootmsg_lvl.S
>> +++ b/lib/libbootmsg/bootmsg_lvl.S
>> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>>         bl      io_putchar      // print character
>>         mr      r3, r9
>>         bl      io_printhex16   // print checkpoint ID
>> -       .rept   5
>> -       li      r3,'\b'
>> -       bl      io_putchar      // print backspaces
>> -       .endr
>> +       li      r3,'\r'
>> +       bl      io_putchar      // go back
>>         mtlr    r11
>>         blr
>>
>> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
>> checkpoints should always be printed at the beginning of a line...
> I gave it a try.. It works flawlessly...
> 
> Could you commit it?

That's a question for Alexey, I guess ... Alexey, what do you think, is
that change ok?

 Thomas
Alexey Kardashevskiy Feb. 24, 2016, 8:34 a.m. UTC | #4
On 02/24/2016 06:45 PM, Thomas Huth wrote:
> On 23.02.2016 16:15, Dinar Valeev wrote:
>> On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com> wrote:
>>> On 10.02.2016 13:19, Thomas Huth wrote:
>>>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>>>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>>>>> codes with backspace:
>>>>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>>>>
>>>>>>>> We start a VM and record log, this is fine. But then when we look at
>>>>>>>> the log through WebUI, because of backspace, Mozilla thinks this is a
>>>>>>>> binary file.
> ...
>>> Just a completely different idea, but would the following patch also fix
>>> your issue?
>>>
>>> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
>>> index 2e4c135..14ce4bf 100644
>>> --- a/lib/libbootmsg/bootmsg_lvl.S
>>> +++ b/lib/libbootmsg/bootmsg_lvl.S
>>> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>>>          bl      io_putchar      // print character
>>>          mr      r3, r9
>>>          bl      io_printhex16   // print checkpoint ID
>>> -       .rept   5
>>> -       li      r3,'\b'
>>> -       bl      io_putchar      // print backspaces
>>> -       .endr
>>> +       li      r3,'\r'
>>> +       bl      io_putchar      // go back
>>>          mtlr    r11
>>>          blr
>>>
>>> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
>>> checkpoints should always be printed at the beginning of a line...
>> I gave it a try.. It works flawlessly...
>>
>> Could you commit it?
>
> That's a question for Alexey, I guess ... Alexey, what do you think, is
> that change ok?

May be, I am waiting for the proper patch which I would apply and test and 
see the difference :)
Dinar Valeev Feb. 24, 2016, 8:44 a.m. UTC | #5
On Wed, Feb 24, 2016 at 9:34 AM, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
> On 02/24/2016 06:45 PM, Thomas Huth wrote:
>>
>> On 23.02.2016 16:15, Dinar Valeev wrote:
>>>
>>> On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>
>>>> On 10.02.2016 13:19, Thomas Huth wrote:
>>>>>
>>>>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>>>>>>
>>>>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>>>>>>
>>>>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>>>>>
>>>>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>>>>>> codes with backspace:
>>>>>>>>>
>>>>>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>>>>>
>>>>>>>>> We start a VM and record log, this is fine. But then when we look
>>>>>>>>> at
>>>>>>>>> the log through WebUI, because of backspace, Mozilla thinks this is
>>>>>>>>> a
>>>>>>>>> binary file.
>>
>> ...
>>>>
>>>> Just a completely different idea, but would the following patch also fix
>>>> your issue?
>>>>
>>>> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
>>>> index 2e4c135..14ce4bf 100644
>>>> --- a/lib/libbootmsg/bootmsg_lvl.S
>>>> +++ b/lib/libbootmsg/bootmsg_lvl.S
>>>> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>>>>          bl      io_putchar      // print character
>>>>          mr      r3, r9
>>>>          bl      io_printhex16   // print checkpoint ID
>>>> -       .rept   5
>>>> -       li      r3,'\b'
>>>> -       bl      io_putchar      // print backspaces
>>>> -       .endr
>>>> +       li      r3,'\r'
>>>> +       bl      io_putchar      // go back
>>>>          mtlr    r11
>>>>          blr
>>>>
>>>> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
>>>> checkpoints should always be printed at the beginning of a line...
>>>
>>> I gave it a try.. It works flawlessly...
>>>
>>> Could you commit it?
>>
>>
>> That's a question for Alexey, I guess ... Alexey, what do you think, is
>> that change ok?
I mean should I send a patch or you could do it?
>
>
> May be, I am waiting for the proper patch which I would apply and test and
> see the difference :)
>
>
> --
> Alexey
Thomas Huth Feb. 24, 2016, 9:10 a.m. UTC | #6
On 24.02.2016 09:44, Dinar Valeev wrote:
> On Wed, Feb 24, 2016 at 9:34 AM, Alexey Kardashevskiy <aik@ozlabs.ru> wrote:
>> On 02/24/2016 06:45 PM, Thomas Huth wrote:
>>> On 23.02.2016 16:15, Dinar Valeev wrote:
>>>> On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>> On 10.02.2016 13:19, Thomas Huth wrote:
>>>>>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
>>>>>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
>>>>>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com> wrote:
>>>>>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
>>>>>>>>>>
>>>>>>>>>> I have long standing issue with SLOF. During start SLOF prints cp
>>>>>>>>>> codes with backspace:
>>>>>>>>>>
>>>>>>>>>> https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
>>>>>>>>>>
>>>>>>>>>> We start a VM and record log, this is fine. But then when we look
>>>>>>>>>> at
>>>>>>>>>> the log through WebUI, because of backspace, Mozilla thinks this is
>>>>>>>>>> a
>>>>>>>>>> binary file.
>>>
>>> ...
>>>>>
>>>>> Just a completely different idea, but would the following patch also fix
>>>>> your issue?
>>>>>
>>>>> diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
>>>>> index 2e4c135..14ce4bf 100644
>>>>> --- a/lib/libbootmsg/bootmsg_lvl.S
>>>>> +++ b/lib/libbootmsg/bootmsg_lvl.S
>>>>> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
>>>>>          bl      io_putchar      // print character
>>>>>          mr      r3, r9
>>>>>          bl      io_printhex16   // print checkpoint ID
>>>>> -       .rept   5
>>>>> -       li      r3,'\b'
>>>>> -       bl      io_putchar      // print backspaces
>>>>> -       .endr
>>>>> +       li      r3,'\r'
>>>>> +       bl      io_putchar      // go back
>>>>>          mtlr    r11
>>>>>          blr
>>>>>
>>>>> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
>>>>> checkpoints should always be printed at the beginning of a line...
>>>>
>>>> I gave it a try.. It works flawlessly...
>>>>
>>>> Could you commit it?
>>>
>>>
>>> That's a question for Alexey, I guess ... Alexey, what do you think, is
>>> that change ok?
> I mean should I send a patch or you could do it?

I just prepared and sent a patch.

 Thomas
Dinar Valeev Feb. 24, 2016, 9:35 a.m. UTC | #7
On 24 Feb 2016 10:10, "Thomas Huth" <thuth@redhat.com> wrote:
>
> On 24.02.2016 09:44, Dinar Valeev wrote:
> > On Wed, Feb 24, 2016 at 9:34 AM, Alexey Kardashevskiy <aik@ozlabs.ru>
wrote:
> >> On 02/24/2016 06:45 PM, Thomas Huth wrote:
> >>> On 23.02.2016 16:15, Dinar Valeev wrote:
> >>>> On Mon, Feb 15, 2016 at 7:09 PM, Thomas Huth <thuth@redhat.com>
wrote:
> >>>>> On 10.02.2016 13:19, Thomas Huth wrote:
> >>>>>> On 10.02.2016 01:33, Alexey Kardashevskiy wrote:
> >>>>>>> On 02/09/2016 11:54 PM, Dinar Valeev wrote:
> >>>>>>>> On Mon, Feb 8, 2016 at 6:50 PM, Thomas Huth <thuth@redhat.com>
wrote:
> >>>>>>>>> On 08.02.2016 15:10, Dinar Valeev wrote:
> >>>>>>>>>>
> >>>>>>>>>> I have long standing issue with SLOF. During start SLOF prints
cp
> >>>>>>>>>> codes with backspace:
> >>>>>>>>>>
> >>>>>>>>>>
https://github.com/aik/SLOF/blob/master/lib/libbootmsg/bootmsg_lvl.S#L61-L64
> >>>>>>>>>>
> >>>>>>>>>> We start a VM and record log, this is fine. But then when we
look
> >>>>>>>>>> at
> >>>>>>>>>> the log through WebUI, because of backspace, Mozilla thinks
this is
> >>>>>>>>>> a
> >>>>>>>>>> binary file.
> >>>
> >>> ...
> >>>>>
> >>>>> Just a completely different idea, but would the following patch
also fix
> >>>>> your issue?
> >>>>>
> >>>>> diff --git a/lib/libbootmsg/bootmsg_lvl.S
b/lib/libbootmsg/bootmsg_lvl.S
> >>>>> index 2e4c135..14ce4bf 100644
> >>>>> --- a/lib/libbootmsg/bootmsg_lvl.S
> >>>>> +++ b/lib/libbootmsg/bootmsg_lvl.S
> >>>>> @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp)
> >>>>>          bl      io_putchar      // print character
> >>>>>          mr      r3, r9
> >>>>>          bl      io_printhex16   // print checkpoint ID
> >>>>> -       .rept   5
> >>>>> -       li      r3,'\b'
> >>>>> -       bl      io_putchar      // print backspaces
> >>>>> -       .endr
> >>>>> +       li      r3,'\r'
> >>>>> +       bl      io_putchar      // go back
> >>>>>          mtlr    r11
> >>>>>          blr
> >>>>>
> >>>>> Replacing 5 '\b's with one '\r' should IMHO be ok here since the
> >>>>> checkpoints should always be printed at the beginning of a line...
> >>>>
> >>>> I gave it a try.. It works flawlessly...
> >>>>
> >>>> Could you commit it?
> >>>
> >>>
> >>> That's a question for Alexey, I guess ... Alexey, what do you think,
is
> >>> that change ok?
> > I mean should I send a patch or you could do it?
>
> I just prepared and sent a patch.
Thanks
>
>  Thomas
>
diff mbox

Patch

diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S
index 2e4c135..14ce4bf 100644
--- a/lib/libbootmsg/bootmsg_lvl.S
+++ b/lib/libbootmsg/bootmsg_lvl.S
@@ -58,10 +58,8 @@  ENTRY(bootmsg_cp)
 	bl      io_putchar      // print character
 	mr	r3, r9
 	bl      io_printhex16   // print checkpoint ID
-	.rept   5
-	li      r3,'\b'
-	bl      io_putchar      // print backspaces
-	.endr
+	li      r3,'\r'
+	bl      io_putchar      // go back
 	mtlr	r11
 	blr