Re: How to boot in UEFI mode: practically no documentation

2018-05-29 Thread Chavdar Ivanov
Just to say that all this worked for me. I had some 100gb left free on a
GPT disk with a few other systems installed and finally decided to try EFI
boot, using the efi boot image from releng. I only had to create /dev
entries for dk16, dk17 and dk18, 16 were not enough. I also had to disable
nouveau, the geforce 950m apparently is still unsupported and I get 'no
console device'. I haven't been able to get X running on this laptop, but
the rest seems fine.

Chavdar

On Tue, 29 May 2018, 09:34 Martin Husemann,  wrote:

> On Tue, May 29, 2018 at 08:15:43AM +, Thomas Mueller wrote:
> > Where do I find documentation on how to boot NetBSD amd64 or possibly
> i386 in UEFI mode?
>
> I'm working on a wiki page (and will change the NetBSD 8.0 install docs
> to point to that).
>
> I can't answer how to boot into alternative operating systems (haven't
> tried
> that yet). But the basic installation goes like this:
>
>  - You want to boot from the uefi usb install image. This requires "secure
>boot" to be disabled. Some firmwares require you to set a firmware
>password before allowing to disable that
>
> Assuming you have a scratch disk (called wd0) you want to fully use for
> NetBSD you
> do something like:
>
>  gpt destroy wd0
>  gpt create wd0
>  gpt add -a 2m -l "EFI system" -t efi -s 128m wd0
>  gpt add -a 2m -l NetBSD -t ffs -s 118g wd0 # replace 118g as
> needed
>  gpt add -a 2m -l swap -t swap wd0  # this will use all remaining space
>  dkctl wd0 listwedges
>
> Now note which dk* is the EFI one and newfs it (also note the ffs one
> for later, see below):
>
>  newfs_msdos /dev/rdk3  # replace dk3 with proper device
>
> Then make it bootable:
>
>  mount -t msdos /dev/dk3 /mnt
>  mkdir -p /mnt/EFI/boot
>  cp /usr/mdec/*.efi /mnt/EFI/boot
>  umount /mnt
>
> I have sysinst changes that will allow the remaining part to be handled
> by sysinst in NetBSD 8.0 (hope to finsih that soon).
>
> But for now you will have to install manually. Check the dkctl output
> for which dk* is the ffs one and newfs/mount it:
>
>  newfs -O 2 dk4 # replace dk4 by approrpiate device, see above
>  mount -o async /dev/dk4 /mnt
>  cd /mnt
>
> Now extract (with tar xpzf) all sets you want, including the appropriate
> kernel. Also:
>
>  cp /usr/mdec/boot .# copy secondary bootloader (XXX is this needed
> for uefi)?
>  cd dev
>  sh MAKEDEV all
>  vi /etc/fstab
>
> A fstab could look like:
>
> NAME=NetBSD /   ffs rw  1 1
> NAME=swap   noneswapsw,dp   0 0
> kernfs  /kern   kernfs  rw
> ptyfs   /dev/pts ptyfs  rw
> procfs  /proc   procfs  rw
> tmpfs /var/shmtmpfs   rw,-m1777,-sram%25
>
> Finally set rc_configured=YES in /mnt/etc/rc.conf, plus add hostname=
> and whatever settings you need.
>
> Now reboot, remove install usb medium, and watch NetBSD boot from uefi.
>
> Martin
>


Re: PTHREAD_MUTEX_INITIALIZER on 6.1.5 issues

2018-05-29 Thread Valery Ushakov
Riccardo  wrote:


> I am testing build og GNUstep base (head) on NetBSD 6.1.5/sparc
> 
> Build fails with:
> 
>  Compiling file NSObject.m ...
> NSObject.m: In function '+[NSObject initialize]':
> NSObject.m:1049:34: error: expected expression before '{' token
> NSObject.m: At top level:
> 
> you can see the file here:
> https://github.com/gnustep/libs-base/blob/master/Source/NSObject.m

Please, always include the relevant code excerpt and the the specific
version of the file you refer to, so that the mail can be more or less
self-contained even without the external link and the external link
actually points to something you are discussing in the mail.

-uwe



Re: How to boot in UEFI mode: practically no documentation

2018-05-29 Thread Martin Husemann
On Tue, May 29, 2018 at 08:15:43AM +, Thomas Mueller wrote:
> Where do I find documentation on how to boot NetBSD amd64 or possibly i386 in 
> UEFI mode?

I'm working on a wiki page (and will change the NetBSD 8.0 install docs
to point to that).

I can't answer how to boot into alternative operating systems (haven't tried
that yet). But the basic installation goes like this:

 - You want to boot from the uefi usb install image. This requires "secure
   boot" to be disabled. Some firmwares require you to set a firmware
   password before allowing to disable that

Assuming you have a scratch disk (called wd0) you want to fully use for NetBSD 
you
do something like:

 gpt destroy wd0
 gpt create wd0
 gpt add -a 2m -l "EFI system" -t efi -s 128m wd0
 gpt add -a 2m -l NetBSD -t ffs -s 118g wd0 # replace 118g as needed
 gpt add -a 2m -l swap -t swap wd0  # this will use all remaining space
 dkctl wd0 listwedges

Now note which dk* is the EFI one and newfs it (also note the ffs one
for later, see below):

 newfs_msdos /dev/rdk3  # replace dk3 with proper device

Then make it bootable:

 mount -t msdos /dev/dk3 /mnt
 mkdir -p /mnt/EFI/boot
 cp /usr/mdec/*.efi /mnt/EFI/boot
 umount /mnt

I have sysinst changes that will allow the remaining part to be handled
by sysinst in NetBSD 8.0 (hope to finsih that soon).

But for now you will have to install manually. Check the dkctl output
for which dk* is the ffs one and newfs/mount it:

 newfs -O 2 dk4 # replace dk4 by approrpiate device, see above
 mount -o async /dev/dk4 /mnt
 cd /mnt

Now extract (with tar xpzf) all sets you want, including the appropriate
kernel. Also:

 cp /usr/mdec/boot .# copy secondary bootloader (XXX is this needed for 
uefi)?
 cd dev
 sh MAKEDEV all
 vi /etc/fstab

A fstab could look like:

NAME=NetBSD /   ffs rw  1 1
NAME=swap   noneswapsw,dp   0 0
kernfs  /kern   kernfs  rw
ptyfs   /dev/pts ptyfs  rw
procfs  /proc   procfs  rw
tmpfs /var/shmtmpfs   rw,-m1777,-sram%25

Finally set rc_configured=YES in /mnt/etc/rc.conf, plus add hostname=
and whatever settings you need.

Now reboot, remove install usb medium, and watch NetBSD boot from uefi.

Martin


Re: How to boot in UEFI mode: practically no documentation

2018-05-29 Thread Patrick Welche
On Tue, May 29, 2018 at 08:15:43AM +, Thomas Mueller wrote:
> Where do I find documentation on how to boot NetBSD amd64 or possibly i386 in 
> UEFI mode?
> 
> I couldn't find any man page and couldn't find anything useful in the online 
> NetBSD wiki.
> 
> I don't want to be limited to NetBSD, would also want to be able to boot 
> FreeBSD and Linux in UEFI mode.
> 
> I noticed /usr/mdec/bootx64.efi and bootia32.efi (on an amd64 installation) 
> but don't really know where these would lead to.
> 
> I also saw /usr/src/sys/arch/i386/stand/efiboot .

Did you see Petra's excellent page:

  https://wiki.netbsd.org/users/spz/moderndisk/

?

Cheers,

Patrick


Re: How to boot in UEFI mode: practically no documentation

2018-05-29 Thread Paul Goyette

I bookmarked this Email a while ago - it might help...

https://mail-index.netbsd.org/current-users/2017/02/28/msg031220.html

On Tue, 29 May 2018, Thomas Mueller wrote:

Where do I find documentation on how to boot NetBSD amd64 or possibly 
i386 in UEFI mode?


I couldn't find any man page and couldn't find anything useful in the 
online NetBSD wiki.


I don't want to be limited to NetBSD, would also want to be able to 
boot FreeBSD and Linux in UEFI mode.


I noticed /usr/mdec/bootx64.efi and bootia32.efi (on an amd64 
installation) but don't really know where these would lead to.


I also saw /usr/src/sys/arch/i386/stand/efiboot .


Tom


!DSPAM:5b0d0c85242761302317190!




+--+--++
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:  |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+--+--++


How to boot in UEFI mode: practically no documentation

2018-05-29 Thread Thomas Mueller
Where do I find documentation on how to boot NetBSD amd64 or possibly i386 in 
UEFI mode?

I couldn't find any man page and couldn't find anything useful in the online 
NetBSD wiki.

I don't want to be limited to NetBSD, would also want to be able to boot 
FreeBSD and Linux in UEFI mode.

I noticed /usr/mdec/bootx64.efi and bootia32.efi (on an amd64 installation) but 
don't really know where these would lead to.

I also saw /usr/src/sys/arch/i386/stand/efiboot .


Tom



Re: PTHREAD_MUTEX_INITIALIZER on 6.1.5 issues

2018-05-29 Thread Martin Husemann
On Tue, May 29, 2018 at 08:29:02AM +0200, Riccardo wrote:
> Hi all,
> 
> 
> I am testing build og GNUstep base (head) on NetBSD 6.1.5/sparc
> 
> Build fails with:
> 
>  Compiling file NSObject.m ...
> NSObject.m: In function '+[NSObject initialize]':
> NSObject.m:1049:34: error: expected expression before '{' token
> NSObject.m: At top level:
> 
> you can see the file here:
> https://github.com/gnustep/libs-base/blob/master/Source/NSObject.m
> 
> I bet the issue is with PTHREAD_MUTEX_INITIALIZER

The code is doing something strange there. PTHREAD_MUTEX_INITIALIZER is
only needed for static mutex initializations. In this case it is way
easier to just do:

for (i = 0; i < LOCKCOUNT; i++)
{
pthread_mutex_init([i], NULL);
}

As the name says it is an initializer, which does not necessarily mean
it is an rvalue (that you could just assign).

Martin


PTHREAD_MUTEX_INITIALIZER on 6.1.5 issues

2018-05-29 Thread Riccardo

Hi all,


I am testing build og GNUstep base (head) on NetBSD 6.1.5/sparc

Build fails with:

 Compiling file NSObject.m ...
NSObject.m: In function '+[NSObject initialize]':
NSObject.m:1049:34: error: expected expression before '{' token
NSObject.m: At top level:

you can see the file here:
https://github.com/gnustep/libs-base/blob/master/Source/NSObject.m

I bet the issue is with PTHREAD_MUTEX_INITIALIZER

However, NetBSD 6.1.5 defines it it in pthread.h, which is imported in 
GSPthread.h . As a hack, I also tried including it explicitely in 
pthread.h


what's going on wrong? (7.1/x86 and linux and other platforms have no 
issues. I don't have 61.5/x86 anymore though)


perhaps the trick of defining to _PTHREAD_MUTEX_INITIALIZER goes wrong 
for some reason?


Riccardo