Re: cannot start detached sessions (with -m -d) back to back

2021-12-29 Thread Valery Ushakov
On Wed, Dec 29, 2021 at 13:40:31 -0500, Adam Russell wrote:

> What I am finding is that works to some extent, but then that second session
> seems to quickly end.
> 
> Here I start a session, list all sessions, quit all sessions, sleep for 10
> seconds, start a new session, list all sessions, sleep one second, and then
> list all sessions again.
> 
> As you can see the second sessions, created after the ten second sleep, does
> get created, but is gone a second later.

Building screeen with debugging shows that succesful session start has
for the first read from the window:

 + hit ev fd 5 type 1!
going to read from window fd 5
 -> 5 bytes

but failed attempt has

 + hit ev fd 5 type 1!
going to read from window fd 5
Window 0: EOF - killing window

where fd 5 is obtained from the cloning pty device /dev/ptmx (ptm(4))

The comment in ptcread says:

/*
 * We want to block until the slave
 * is open, and there's something to read;
 * but if we lost the slave or we're NBIO,
 * then return the appropriate error instead.
 */
...
if (!ISSET(tp->t_state, TS_CARR_ON)) {
error = 0;   /* EOF */
goto out;
}

Need to ask someone familiar with the pty internals.

-uwe


Re: UEFI dual-boot with Windows

2021-12-29 Thread Todd Gruhn
My system wa built a year ago. I boot NetBSD from one HD.
I boot Windoze from another HD.
It also allows me to boot either of 2 CD/DVDs.

The 2 CDs come in handy when upgrading NetBSD.

I can choose which device to boot when UEFI comes up.

On Wed, Dec 29, 2021 at 6:19 PM Chavdar Ivanov  wrote:
>
> I boot my netbsd-current system in uefi mode from the second disk by 
> selecting its .efi file; I lost my default rEFInd setup when I downgraded the 
> first disk from W11 to W10 and haven’t tried to recover it yet, it also can 
> be started by selecting its .efi file. I have never copied the system kernel 
> on the efi partition; there are three systems on the second disk with their 
> own efi partitions. This is on an HP envy 17 laptop, 5 years old.
>
> On Wed, 29 Dec 2021 at 17:19, Tobias Nygren  wrote:
>>
>> On Wed, 29 Dec 2021 17:05:08 + (UTC)
>> Benny Siegert  wrote:
>>
>> > Hi!
>> >
>> > I re-installed Windows 10 on my machine, and it insisted on UEFI boot,
>> > which killed my previous dual-booting setup with GRUB and legacy boot.
>> >
>> > NetBSD is on the second NVMe drive, while the first one is all Windows.
>> >
>> > After installing Windows, I manually installed rEFInd into the EFI
>> > partition. For NetBSD, I copied bootx64.efi to /EFI/NetBSD (so as not to
>> > overwrite the existing /EFI/Boot/bootx64.efi, which I assume is from
>> > Windows). I also copied a GENERIC NetBSD-9.2 kernel to  /netbsd.gz on the
>> > EFI partition.
>> >
>> > After selecting NetBSD in rEFInd (which it auto-detects), I see the
>> > NetBSD/x86 EFI boot (x64) banner. It proceeds to load a kernel from
>> > "NAME=EFI system partition:netbsd.gz (howto 0x2)".
>> >
>> > Unfortunately, after the initial loader line with the sizes, the boot
>> > seems to hang with no further output.
>> >
>> > Any ideas, hints or tips?
>>
>> I have a similar problem when I have a 4k sector NVMe drive installed.
>> I suspect in my case it is a Dell firmware bug but not sure.
>> It hangs for me when tearing down UEFI stuff before jumping to kernel.
>>
>> To rule out issues with the EFI system partition itself you could
>> install a /EFI/NetBSD/boot.cfg to instruct bootx64.efi to load the
>> kernel from hd1a:netbsd or whatever your FFS partition is named.
>>
>> -Tobias
>
> --
> 


Re: cannot start detached sessions (with -m -d) back to back

2021-12-29 Thread Adam Russell



I have tried to reproduce what I believe are your findings, that some 
delay before starting the second session is enough to fix things.


What I am finding is that works to some extent, but then that second 
session seems to quickly end.


Here I start a session, list all sessions, quit all sessions, sleep for 
10 seconds, start a new session, list all sessions, sleep one second, 
and then list all sessions again.


As you can see the second sessions, created after the ten second sleep, 
does get created, but is gone a second later.


-bash-5.1$ /usr/pkg/bin/screen -S some-session -p 0 -m -d; screen -ls; 
screen -X quit; sleep 10; /usr/pkg/bin/screen -S some-session -p 0 -m 
-d; screen -ls; sleep 1; screen -ls

There is a screen on:
2406.some-session   (Detached)
1 Socket in /tmp/screens/S-adamcrussell.
There is a screen on:
1197.some-session   (Detached)
1 Socket in /tmp/screens/S-adamcrussell.
No Sockets found in /tmp/screens/S-adamcrussell.



Re: UEFI dual-boot with Windows

2021-12-29 Thread Chavdar Ivanov
I boot my netbsd-current system in uefi mode from the second disk by
selecting its .efi file; I lost my default rEFInd setup when I downgraded
the first disk from W11 to W10 and haven’t tried to recover it yet, it also
can be started by selecting its .efi file. I have never copied the system
kernel on the efi partition; there are three systems on the second disk
with their own efi partitions. This is on an HP envy 17 laptop, 5 years
old.

On Wed, 29 Dec 2021 at 17:19, Tobias Nygren  wrote:

> On Wed, 29 Dec 2021 17:05:08 + (UTC)
> Benny Siegert  wrote:
>
> > Hi!
> >
> > I re-installed Windows 10 on my machine, and it insisted on UEFI boot,
> > which killed my previous dual-booting setup with GRUB and legacy boot.
> >
> > NetBSD is on the second NVMe drive, while the first one is all Windows.
> >
> > After installing Windows, I manually installed rEFInd into the EFI
> > partition. For NetBSD, I copied bootx64.efi to /EFI/NetBSD (so as not to
> > overwrite the existing /EFI/Boot/bootx64.efi, which I assume is from
> > Windows). I also copied a GENERIC NetBSD-9.2 kernel to  /netbsd.gz on
> the
> > EFI partition.
> >
> > After selecting NetBSD in rEFInd (which it auto-detects), I see the
> > NetBSD/x86 EFI boot (x64) banner. It proceeds to load a kernel from
> > "NAME=EFI system partition:netbsd.gz (howto 0x2)".
> >
> > Unfortunately, after the initial loader line with the sizes, the boot
> > seems to hang with no further output.
> >
> > Any ideas, hints or tips?
>
> I have a similar problem when I have a 4k sector NVMe drive installed.
> I suspect in my case it is a Dell firmware bug but not sure.
> It hangs for me when tearing down UEFI stuff before jumping to kernel.
>
> To rule out issues with the EFI system partition itself you could
> install a /EFI/NetBSD/boot.cfg to instruct bootx64.efi to load the
> kernel from hd1a:netbsd or whatever your FFS partition is named.
>
> -Tobias
>
-- 



Re: UEFI dual-boot with Windows

2021-12-29 Thread Tobias Nygren
On Wed, 29 Dec 2021 17:05:08 + (UTC)
Benny Siegert  wrote:

> Hi!
> 
> I re-installed Windows 10 on my machine, and it insisted on UEFI boot, 
> which killed my previous dual-booting setup with GRUB and legacy boot.
> 
> NetBSD is on the second NVMe drive, while the first one is all Windows.
> 
> After installing Windows, I manually installed rEFInd into the EFI 
> partition. For NetBSD, I copied bootx64.efi to /EFI/NetBSD (so as not to 
> overwrite the existing /EFI/Boot/bootx64.efi, which I assume is from 
> Windows). I also copied a GENERIC NetBSD-9.2 kernel to  /netbsd.gz on the 
> EFI partition.
> 
> After selecting NetBSD in rEFInd (which it auto-detects), I see the 
> NetBSD/x86 EFI boot (x64) banner. It proceeds to load a kernel from 
> "NAME=EFI system partition:netbsd.gz (howto 0x2)".
> 
> Unfortunately, after the initial loader line with the sizes, the boot 
> seems to hang with no further output.
> 
> Any ideas, hints or tips?

I have a similar problem when I have a 4k sector NVMe drive installed.
I suspect in my case it is a Dell firmware bug but not sure.
It hangs for me when tearing down UEFI stuff before jumping to kernel.

To rule out issues with the EFI system partition itself you could
install a /EFI/NetBSD/boot.cfg to instruct bootx64.efi to load the
kernel from hd1a:netbsd or whatever your FFS partition is named.

-Tobias


UEFI dual-boot with Windows

2021-12-29 Thread Benny Siegert

Hi!

I re-installed Windows 10 on my machine, and it insisted on UEFI boot, 
which killed my previous dual-booting setup with GRUB and legacy boot.


NetBSD is on the second NVMe drive, while the first one is all Windows.

After installing Windows, I manually installed rEFInd into the EFI 
partition. For NetBSD, I copied bootx64.efi to /EFI/NetBSD (so as not to 
overwrite the existing /EFI/Boot/bootx64.efi, which I assume is from 
Windows). I also copied a GENERIC NetBSD-9.2 kernel to  /netbsd.gz on the 
EFI partition.


After selecting NetBSD in rEFInd (which it auto-detects), I see the 
NetBSD/x86 EFI boot (x64) banner. It proceeds to load a kernel from 
"NAME=EFI system partition:netbsd.gz (howto 0x2)".


Unfortunately, after the initial loader line with the sizes, the boot 
seems to hang with no further output.


Any ideas, hints or tips?

--
Benny


Re: cannot start detached sessions (with -m -d) back to back

2021-12-29 Thread Valery Ushakov
On Wed, Dec 29, 2021 at 00:01:38 -0500, Adam Russell wrote:

> This is what I see
> 
> -bash-5.1$ /usr/pkg/bin/screen -S some-session -p 0 -m -d
> -bash-5.1$ screen -X quit
> -bash-5.1$ /usr/pkg/bin/screen -S some-session -p 0 -m -d
> -bash-5.1$ screen -X quit
>  No screen session found.

I was going to say I can't reproduce it, but then I could.

I couldn't reproduce the problem as is, but I have screenrc that
starts a bunch of windows, so I tested with -c /dev/null and then I do
see the problem.  The second invocation doesn't start the new screen,
just as you show.  But if you wait a little bit (about 5 seconds it
would seem) after the first session is quat, then the new session is
created ok again.

[pardon my bash^Wcsh'isms, but i think it's appropriate here as it
indicates the command is repeated as-is from history and spares the
reader doing the verfication]


$ screen -S test -c /dev/null -d -m -p 0; screen -ls; screen -S test -X quit
There is a screen on:
6098.pts-0.nbvio(Detached)
1 Socket in /tmp/screens/S-uwe.
No screen session found.
$ !!
screen -S test -c /dev/null -d -m -p 0; screen -ls; screen -S test -X quit
There are screens on:
6098.pts-0.nbvio(Detached)
2902.test   (Detached)
2 Sockets in /tmp/screens/S-uwe.
$ !!
screen -S test -c /dev/null -d -m -p 0; screen -ls; screen -S test -X quit
There is a screen on:
6098.pts-0.nbvio(Detached)
1 Socket in /tmp/screens/S-uwe.
No screen session found.
$ !!
screen -S test -c /dev/null -d -m -p 0; screen -ls; screen -S test -X quit
There are screens on:
6098.pts-0.nbvio(Detached)
14114.test  (Detached)
2 Sockets in /tmp/screens/S-uwe.

This is with natural typing pace.


-uwe