Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

John Paul Adrian Glaubitz
On 4/6/19 6:46 PM, John Paul Adrian Glaubitz wrote:
> My suspicion is that the support multiple consoles in parallel [2] introduced
> this particular regression. I haven't done any debugging yet though as I'm
> not sure where to start, I haven't touched the rootskel package before and
> therefore would be interested in any pointers how to debug this.

The problem seems to be the fact that the sparc64 kernel uses different names
for /proc/console and the actual console name:

root@landau:~# cat /proc/consoles
ttyHV0               -W- (EC p  )    4:64
tty0                 -WU (E     )    4:1
root@landau:~# readlink /sys/dev/char/4:64
../../devices/root/f0299a70/f029b788/tty/ttyS0
root@landau:~#

And this is what used to make it work [1]:

            *) # >= 2.6.38
                console_major_minor="$(get-real-console-linux)"
                console_raw="$(readlink "/sys/dev/char/${console_major_minor}")"
                console="${console_raw##*/}"
                ;;

Adrian

> [1] https://salsa.debian.org/installer-team/rootskel/blob/cb7db898f58f14c04b9d60351811cbae71b49a07/src/sbin/reopen-console-linux#L21

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

John Paul Adrian Glaubitz
Hi Ben!

On 4/7/19 1:53 AM, Ben Hutchings wrote:
>> root@landau:~# cat /proc/consoles
>> ttyHV0               -W- (EC p  )    4:64
>> tty0                 -WU (E     )    4:1
>> root@landau:~# readlink /sys/dev/char/4:64
>> ../../devices/root/f0299a70/f029b788/tty/ttyS0
>
> The inconsistent name seems like a kernel bug...

Yes. I'm trying to convince Dave Miller to fix this.

Do you think we could carry a patch in src:linux for the time being?

>> root@landau:~#
>>
>> And this is what used to make it work [1]:
>>
>>    *) # >= 2.6.38
>> console_major_minor="$(get-real-console-linux)"
>> console_raw="$(readlink "/sys/dev/char/${console_major_minor}")"
>> console="${console_raw##*/}"
>> ;;
>
> So maybe rootskel should use that again, but applied to each console's
> char device number.
>
> (Though directly using the symlinks under /dev/char seems cleaner than
> poking in sysfs.)

I agree.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

Ben Hutchings-3
On Tue, 2019-04-16 at 11:47 +0200, John Paul Adrian Glaubitz wrote:

> Hi Ben!
>
> On 4/7/19 1:53 AM, Ben Hutchings wrote:
> > > root@landau:~# cat /proc/consoles
> > > ttyHV0               -W- (EC p  )    4:64
> > > tty0                 -WU (E     )    4:1
> > > root@landau:~# readlink /sys/dev/char/4:64
> > > ../../devices/root/f0299a70/f029b788/tty/ttyS0
> >
> > The inconsistent name seems like a kernel bug...
>
> Yes. I'm trying to convince Dave Miller to fix this.
>
> Do you think we could carry a patch in src:linux for the time being?
[...]

I would rather not do that until it's accepted, as if it that doesn't
happen we either have to switch back or carry it forever.

Ben.

--
Ben Hutchings
Make three consecutive correct guesses and you will be considered
an expert.



signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

John Paul Adrian Glaubitz
On 4/16/19 1:16 PM, Ben Hutchings wrote:
>> Do you think we could carry a patch in src:linux for the time being?
> [...]
>
> I would rather not do that until it's accepted, as if it that doesn't
> happen we either have to switch back or carry it forever.

Hmm, okay. Then I don't really have a way of building updated images
now for the time being.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

John Paul Adrian Glaubitz
In reply to this post by Ben Hutchings-3
Control: reassign -1 src:linux
Control: tags -1 patch

On 4/16/19 1:16 PM, Ben Hutchings wrote:
>> Do you think we could carry a patch in src:linux for the time being?
> [...]
>
> I would rather not do that until it's accepted, as if it that doesn't
> happen we either have to switch back or carry it forever.

My patch has been merged upstream now and is planned for -stable [1].

Attaching the patch.

Adrian

> [1] https://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git/commit/?id=07a6d63eb1b54b5fb38092780fe618dfe1d96e23

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

0001-sunhv-Fix-device-naming-inconsistency-between-sunhv_.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bug#926539: rootskel: steal-ctty no longer works on at least sparc64

John Paul Adrian Glaubitz
Hi!

On 6/14/19 7:55 AM, John Paul Adrian Glaubitz wrote:
> My patch has been merged upstream now and is planned for -stable [1].

It's now part of the 4.19 [1] and 5.1 [2] stable queues, so I guess we just
have to wait a little now.

@Ben: Can you make sure this bug gets closed with the next stable upload?

Thanks!
Adrian

> [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/commit/?id=cc95841f3511b943ad72133e67a105008839ead2
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/commit/?id=176eeebcbf771062473c8f751fa2adb4a8baebb6

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913