Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-03-28 Thread Maurizio Vairani
2018-02-04 14:40 GMT+01:00 Andriy Gapon :

> On 04/02/2018 11:50, Maurizio Vairani wrote:
> > I have added a socket in the ifioctl() call as in the
> > /usr/src/sys/nfs/bootp_subr.c source.
> > Please let me know if you prefer a patch.
>
> A patch here https://reviews.freebsd.org/ would be the best.
>
> --
> Andriy Gapon
>

Hi,
I have uploaded a patch here:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226982
--
Maurizio
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-08 Thread Maurizio Vairani
2018-02-07 19:29 GMT+01:00 John Nielsen :

> > On Feb 7, 2018, at 6:07 AM, Maurizio Vairani 
> wrote:
> >
> > 2018-02-06 23:02 GMT+01:00 John Nielsen :
> > > On Feb 6, 2018, at 11:50 AM, Ian Lepore  wrote:
> > >
> > > On Tue, 2018-02-06 at 11:33 -0700, John Nielsen wrote:
> > >>
> > >> Apparently sending a NULL socket pointer to ifioctl hasn't worked
> > >> since this commit in 2011:
> > >> https://svnweb.freebsd.org/base?view=revision=218757
> > >>
> > >> So I'm going to add this patch to the port unconditionally once it
> > >> works.
> > >>
> > >> Unfortunately, I can't compile the port with either my patch below or
> > >> your original replacement version of isboot_ifup(). :( Did you make
> > >> other changes? Here's the error I'm getting:
> > >>
> > >> --- isboot.o ---
> > >> isboot.c:425:53: error: incomplete definition of type 'struct thread'
> > >> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> > >>   ~~^
> > >> /usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct
> > >> thread'
> > >> struct thread;
> > >>^
> > >> 1 error generated.
> > >>
> > >
> > > Try adding #include  if it's not already in the list.  It
> > > may be that that file got included via pollution from some other header
> > > file in the past and maybe now that has changed.
> > >
> > > If you're already including sys/proc.h then I'm clueless.
> >
> > Thanks Ian, that appears to work.
> >
> > Maurizio, can you apply the attached patch to a clean ports tree and see
> if isboot-kmod will build and function properly for you? This is all the
> changes from this thread and the previous one. If you let me know it works
> I'll get the port updated.
> >
> >
> > Hi John, I need some help.
> >
> > I am running:
> >  # uname -a
> > FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25
> 04:48:52 UTC 2018 r...@releng3.nyi.freebsd.org:/
> usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
> >
> > after upgrading the ports tree with:
> > # portsnap fetch update
> >
> > I have copied the directory /usr/ports/net/isboot-kmod/ in
> /root/src/isboot-kmod and /root/src/isboot-kmod.orig
> > # ls -l /root/src
> > total 6
> > drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod
> > drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod.orig
> > -rw-rw-rw-  1 root  wheel  5630 Feb  7 11:38 isboot_patch.txt
> >
> > Trying to apply the patch I obtain the error:
> > # cd /root/src
> > # patch -sC < isboot_patch.txt
> > 2 out of 2 hunks failed while patching isboot-kmod/Makefile
> > 5 out of 5 hunks failed while patching isboot-kmod/files/patch-isboot.c
> >
> > What I am missing ?
> > Thanks again for your work.
>
> Not sure but I ran in to similar issues testing here as well. Here's the
> "svn diff" patch which does work for me. Note that this one should be
> applied from within the isboot-kmod directory.
>
>
With this patch I receive this error :
# pwd
/root/src/isboot-kmod
# patch -sC  < ../isboot-kmod-0.2.13_2.diff.txt
2 out of 2 hunks failed while patching Makefile
5 out of 5 hunks failed while patching files/patch-isboot.c
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-07 Thread John Nielsen
> On Feb 7, 2018, at 6:07 AM, Maurizio Vairani  wrote:
> 
> 2018-02-06 23:02 GMT+01:00 John Nielsen :
> > On Feb 6, 2018, at 11:50 AM, Ian Lepore  wrote:
> >
> > On Tue, 2018-02-06 at 11:33 -0700, John Nielsen wrote:
> >>
> >> Apparently sending a NULL socket pointer to ifioctl hasn't worked
> >> since this commit in 2011:
> >> https://svnweb.freebsd.org/base?view=revision=218757
> >>
> >> So I'm going to add this patch to the port unconditionally once it
> >> works.
> >>
> >> Unfortunately, I can't compile the port with either my patch below or
> >> your original replacement version of isboot_ifup(). :( Did you make
> >> other changes? Here's the error I'm getting:
> >>
> >> --- isboot.o ---
> >> isboot.c:425:53: error: incomplete definition of type 'struct thread'
> >> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> >>   ~~^
> >> /usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct
> >> thread'
> >> struct thread;
> >>^
> >> 1 error generated.
> >>
> >
> > Try adding #include  if it's not already in the list.  It
> > may be that that file got included via pollution from some other header
> > file in the past and maybe now that has changed.
> >
> > If you're already including sys/proc.h then I'm clueless.
> 
> Thanks Ian, that appears to work.
> 
> Maurizio, can you apply the attached patch to a clean ports tree and see if 
> isboot-kmod will build and function properly for you? This is all the changes 
> from this thread and the previous one. If you let me know it works I'll get 
> the port updated.
> 
> 
> Hi John, I need some help.
> 
> I am running:
>  # uname -a
> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52 
> UTC 2018 
> r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
> 
> after upgrading the ports tree with:
> # portsnap fetch update
> 
> I have copied the directory /usr/ports/net/isboot-kmod/ in  
> /root/src/isboot-kmod and /root/src/isboot-kmod.orig
> # ls -l /root/src
> total 6
> drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod
> drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod.orig
> -rw-rw-rw-  1 root  wheel  5630 Feb  7 11:38 isboot_patch.txt
> 
> Trying to apply the patch I obtain the error:
> # cd /root/src
> # patch -sC < isboot_patch.txt
> 2 out of 2 hunks failed while patching isboot-kmod/Makefile
> 5 out of 5 hunks failed while patching isboot-kmod/files/patch-isboot.c 
> 
> What I am missing ?
> Thanks again for your work.

Not sure but I ran in to similar issues testing here as well. Here's the "svn 
diff" patch which does work for me. Note that this one should be applied from 
within the isboot-kmod directory.

Index: Makefile
===
--- Makefile(revision 461112)
+++ Makefile(working copy)
@@ -2,7 +2,7 @@
 
 PORTNAME=  isboot-kmod
 PORTVERSION=   0.2.13
-PORTREVISION=  1
+PORTREVISION=  2
 CATEGORIES=net
 MASTER_SITES=  http://www.peach.ne.jp/archives/isboot/
 DISTNAME=  isboot-${PORTVERSION}
@@ -12,9 +12,7 @@
 
 LICENSE=   BSD2CLAUSE
 
-BROKEN_aarch64=fails to compile: 
/usr/src/sys/sys/bus.h:724:10: fatal error: 'device_if.h' file not found
 BROKEN_armv6=  fails to compile: implicit declaration of function 
'cp15_pmccntr_get' is invalid in C99
-BROKEN_armv7=  fails to compile: /usr/src/sys/sys/bus.h:724:10: fatal 
error: 'device_if.h' file not found
 BROKEN_powerpc64=  fails to compile: pcpu.h: size of array '__assert_0' is 
negative
 
 USES=  kmod uidfix
Index: files/patch-Makefile
===
--- files/patch-Makefile(nonexistent)
+++ files/patch-Makefile(working copy)
@@ -0,0 +1,10 @@
+--- Makefile.orig  2015-09-23 22:33:04.0 -0600
 Makefile   2018-01-29 10:20:10.453188000 -0700
+@@ -6,6 +6,7 @@
+ SRCS= isboot.c ibft.c iscsi.c
+ SRCS+=isboot.h ibft.h iscsi_compat.h
+ SRCS+=opt_cam.h
++SRCS+=device_if.h bus_if.h
+ #CFLAGS+= -DVIMAGE
+ #CFLAGS+= -DIBFT_VERBOSE
+ #CFLAGS+= -DDEBUG

Property changes on: files/patch-Makefile
___
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: files/patch-isboot.c
===
--- files/patch-isboot.c(revision 461112)
+++ files/patch-isboot.c(working copy)
@@ -1,6 +1,14 @@
 isboot.c.orig  2015-11-05 16:50:51 UTC
-+++ isboot.c
-@@ -347,9 +347,9 @@ isboot_set_v4gw(struct sockaddr_in *gate
+--- isboot.c.orig  2015-11-05 09:50:51.0 

Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-07 Thread Maurizio Vairani
2018-02-06 23:02 GMT+01:00 John Nielsen :

> > On Feb 6, 2018, at 11:50 AM, Ian Lepore  wrote:
> >
> > On Tue, 2018-02-06 at 11:33 -0700, John Nielsen wrote:
> >>
> >> Apparently sending a NULL socket pointer to ifioctl hasn't worked
> >> since this commit in 2011:
> >> https://svnweb.freebsd.org/base?view=revision=218757
> >>
> >> So I'm going to add this patch to the port unconditionally once it
> >> works.
> >>
> >> Unfortunately, I can't compile the port with either my patch below or
> >> your original replacement version of isboot_ifup(). :( Did you make
> >> other changes? Here's the error I'm getting:
> >>
> >> --- isboot.o ---
> >> isboot.c:425:53: error: incomplete definition of type 'struct thread'
> >> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> >>   ~~^
> >> /usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct
> >> thread'
> >> struct thread;
> >>^
> >> 1 error generated.
> >>
> >
> > Try adding #include  if it's not already in the list.  It
> > may be that that file got included via pollution from some other header
> > file in the past and maybe now that has changed.
> >
> > If you're already including sys/proc.h then I'm clueless.
>
> Thanks Ian, that appears to work.
>
> Maurizio, can you apply the attached patch to a clean ports tree and see
> if isboot-kmod will build and function properly for you? This is all the
> changes from this thread and the previous one. If you let me know it works
> I'll get the port updated.
>
>
> Hi John, I need some help.

I am running:
 # uname -a
FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
UTC 2018 
r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64

after upgrading the ports tree with:
# portsnap fetch update

I have copied the directory /usr/ports/net/isboot-kmod/ in
/root/src/isboot-kmod and /root/src/isboot-kmod.orig
# ls -l /root/src
total 6
drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod
drwxr-xr-x  3 root  wheel 6 Feb  7 13:46 isboot-kmod.orig
-rw-rw-rw-  1 root  wheel  5630 Feb  7 11:38 isboot_patch.txt

Trying to apply the patch I obtain the error:
# cd /root/src
# patch -sC < isboot_patch.txt
2 out of 2 hunks failed while patching isboot-kmod/Makefile
5 out of 5 hunks failed while patching isboot-kmod/files/patch-isboot.c

What I am missing ?
Thanks again for your work.
--
Maurizio
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-06 Thread John Nielsen
> On Feb 6, 2018, at 11:50 AM, Ian Lepore  wrote:
> 
> On Tue, 2018-02-06 at 11:33 -0700, John Nielsen wrote:
>> 
>> Apparently sending a NULL socket pointer to ifioctl hasn't worked
>> since this commit in 2011:
>> https://svnweb.freebsd.org/base?view=revision=218757
>> 
>> So I'm going to add this patch to the port unconditionally once it
>> works.
>> 
>> Unfortunately, I can't compile the port with either my patch below or
>> your original replacement version of isboot_ifup(). :( Did you make
>> other changes? Here's the error I'm getting:
>> 
>> --- isboot.o ---
>> isboot.c:425:53: error: incomplete definition of type 'struct thread'
>> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
>>   ~~^
>> /usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct
>> thread'
>> struct thread;
>>^
>> 1 error generated.
>> 
> 
> Try adding #include  if it's not already in the list.  It
> may be that that file got included via pollution from some other header
> file in the past and maybe now that has changed.
> 
> If you're already including sys/proc.h then I'm clueless.

Thanks Ian, that appears to work.

Maurizio, can you apply the attached patch to a clean ports tree and see if 
isboot-kmod will build and function properly for you? This is all the changes 
from this thread and the previous one. If you let me know it works I'll get the 
port updated.

diff -uPr isboot-kmod.orig/Makefile isboot-kmod/Makefile
--- isboot-kmod.orig/Makefile   2018-01-11 07:18:01.0 -0700
+++ isboot-kmod/Makefile2018-02-06 14:56:23.654737000 -0700
@@ -2,7 +2,7 @@
 
 PORTNAME=  isboot-kmod
 PORTVERSION=   0.2.13
-PORTREVISION=  1
+PORTREVISION=  2
 CATEGORIES=net
 MASTER_SITES=  http://www.peach.ne.jp/archives/isboot/
 DISTNAME=  isboot-${PORTVERSION}
@@ -12,9 +12,7 @@
 
 LICENSE=   BSD2CLAUSE
 
-BROKEN_aarch64=fails to compile: 
/usr/src/sys/sys/bus.h:724:10: fatal error: 'device_if.h' file not found
 BROKEN_armv6=  fails to compile: implicit declaration of function 
'cp15_pmccntr_get' is invalid in C99
-BROKEN_armv7=  fails to compile: /usr/src/sys/sys/bus.h:724:10: fatal 
error: 'device_if.h' file not found
 BROKEN_powerpc64=  fails to compile: pcpu.h: size of array '__assert_0' is 
negative
 
 USES=  kmod uidfix
diff -uPr isboot-kmod.orig/files/patch-Makefile isboot-kmod/files/patch-Makefile
--- isboot-kmod.orig/files/patch-Makefile   1969-12-31 17:00:00.0 
-0700
+++ isboot-kmod/files/patch-Makefile2018-01-29 10:24:27.372206000 -0700
@@ -0,0 +1,10 @@
+--- Makefile.orig  2015-09-23 22:33:04.0 -0600
 Makefile   2018-01-29 10:20:10.453188000 -0700
+@@ -6,6 +6,7 @@
+ SRCS= isboot.c ibft.c iscsi.c
+ SRCS+=isboot.h ibft.h iscsi_compat.h
+ SRCS+=opt_cam.h
++SRCS+=device_if.h bus_if.h
+ #CFLAGS+= -DVIMAGE
+ #CFLAGS+= -DIBFT_VERBOSE
+ #CFLAGS+= -DDEBUG
diff -uPr isboot-kmod.orig/files/patch-isboot.c isboot-kmod/files/patch-isboot.c
--- isboot-kmod.orig/files/patch-isboot.c   2016-05-06 08:34:57.0 
-0600
+++ isboot-kmod/files/patch-isboot.c2018-02-06 14:24:47.447244000 -0700
@@ -1,6 +1,14 @@
 isboot.c.orig  2015-11-05 16:50:51 UTC
-+++ isboot.c
-@@ -347,9 +347,9 @@ isboot_set_v4gw(struct sockaddr_in *gate
+--- isboot.c.orig  2015-11-05 09:50:51.0 -0700
 isboot.c   2018-02-06 14:23:24.479249000 -0700
+@@ -38,6 +38,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+@@ -347,9 +348,9 @@
netmask.sin_addr.s_addr = htonl(0);
  
/* delete gateway if exists */
@@ -12,7 +20,7 @@
if (error) {
if (error != ESRCH) {
printf("rtrequest RTM_DELETE error %d\n",
-@@ -359,9 +359,9 @@ isboot_set_v4gw(struct sockaddr_in *gate
+@@ -359,9 +360,9 @@
}
  
/* set new default gateway */
@@ -24,7 +32,7 @@
if (error) {
printf("rtrequest RTM_ADD error %d\n", error);
return (error);
-@@ -391,9 +391,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gat
+@@ -391,9 +392,9 @@
memset(_addr, 0, 16);
  
/* delete gateway if exists */
@@ -36,7 +44,7 @@
if (error) {
if (error != ESRCH) {
printf("rtrequest RTM_DELETE error %d\n",
-@@ -403,9 +403,9 @@ isboot_set_v6gw(struct sockaddr_in6 *gat
+@@ -403,9 +404,9 @@
}
  
/* set new default gateway */
@@ -48,3 +56,42 @@
if (error) {
printf("rtrequest RTM_ADD error %d\n", error);
return (error);
+@@ -417,28 +418,36 @@
+ isboot_ifup(struct ifnet *ifp)
+ {
+   struct ifreq ifr;
++  struct socket *so;
+   struct thread *td;
+   int error;
+ 
+   memset(, 0, sizeof(ifr));
+   td = curthread;
+ 
++  error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
++  if (error) {

Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-06 Thread Ian Lepore
On Tue, 2018-02-06 at 11:33 -0700, John Nielsen wrote:
> > 
> > On Feb 6, 2018, at 10:54 AM, John Nielsen 
> > wrote:
> > 
> > > 
> > > 
> > > On Feb 4, 2018, at 2:50 AM, Maurizio Vairani  > > com> wrote:
> > > 
> > > 2018-01-29 18:38 GMT+01:00 John Nielsen :
> > > [ resending from correct email address ]
> > > 
> > > > 
> > > > On Jan 29, 2018, at 6:05 AM, Maurizio Vairani  > > > il.com> wrote:
> > > > 
> > > > I am running
> > > > # uname
> > > > -a
> > > > 
> > > > FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan
> > > > 25 04:48:52
> > > > UTC 2018 r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd6
> > > > 4.amd64/sys/GENERIC
> > > > amd64
> > > > 
> > > > After compiling the kernel module as discussed in this thread :
> > > > https://lists.freebsd.org/pipermail/freebsd-current/2018-Januar
> > > > y/068272.html
> > > > 
> > > > I can boot FreeBSD via iSCSI using iPXE. But when the isboot,
> > > > the iSCSI
> > > > boot driver version 0.2.13, starts I receive a panic:
> > > > https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdU
> > > > A1BorD4
> > > > 
> > > > Any idea?
> > > Bummer! 
> > > 
> > > Aoyama-san-
> > > 
> > > Are you still maintaining isboot? Can you help debug this issue
> > > on FreeBSD 12-CURRENT?
> > > 
> > > Once we get it working I will update the port with whatever is
> > > needed and send you the patches in case you'd like to cut a new
> > > release.
> > > 
> > > Thank you!
> > > 
> > > I have solved the issue changing the function isboot_ifup() in
> > > the source file isboot.c.
> > Here is a patch with some changes to minimize the diff. Except for
> > the printed error messages does that look functionally equivalent?
> > 
> > Now the question is why is this change needed and for what values
> > of __FreeBSD_version is it appropriate?
> Apparently sending a NULL socket pointer to ifioctl hasn't worked
> since this commit in 2011:
> https://svnweb.freebsd.org/base?view=revision=218757
> 
> So I'm going to add this patch to the port unconditionally once it
> works.
> 
> Unfortunately, I can't compile the port with either my patch below or
> your original replacement version of isboot_ifup(). :( Did you make
> other changes? Here's the error I'm getting:
> 
> --- isboot.o ---
> isboot.c:425:53: error: incomplete definition of type 'struct thread'
> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
>   ~~^
> /usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct
> thread'
> struct thread;
>    ^
> 1 error generated.
> 

Try adding #include  if it's not already in the list.  It
may be that that file got included via pollution from some other header
file in the past and maybe now that has changed.

If you're already including sys/proc.h then I'm clueless.

-- Ian

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-06 Thread John Nielsen

> On Feb 6, 2018, at 10:54 AM, John Nielsen  wrote:
> 
>> 
>> On Feb 4, 2018, at 2:50 AM, Maurizio Vairani  wrote:
>> 
>> 2018-01-29 18:38 GMT+01:00 John Nielsen :
>> [ resending from correct email address ]
>> 
>>> On Jan 29, 2018, at 6:05 AM, Maurizio Vairani  
>>> wrote:
>>> 
>>> I am running
>>> # uname
>>> -a
>>> 
>>> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
>>> UTC 2018 
>>> r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
>>> amd64
>>> 
>>> After compiling the kernel module as discussed in this thread :
>>> https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html
>>> 
>>> I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
>>> boot driver version 0.2.13, starts I receive a panic:
>>> https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
>>> 
>>> Any idea?
>> 
>> Bummer! 
>> 
>> Aoyama-san-
>> 
>> Are you still maintaining isboot? Can you help debug this issue on FreeBSD 
>> 12-CURRENT?
>> 
>> Once we get it working I will update the port with whatever is needed and 
>> send you the patches in case you'd like to cut a new release.
>> 
>> Thank you!
>> 
>> I have solved the issue changing the function isboot_ifup() in the source 
>> file isboot.c.
> 
> Here is a patch with some changes to minimize the diff. Except for the 
> printed error messages does that look functionally equivalent?
> 
> Now the question is why is this change needed and for what values of 
> __FreeBSD_version is it appropriate?

Apparently sending a NULL socket pointer to ifioctl hasn't worked since this 
commit in 2011:
https://svnweb.freebsd.org/base?view=revision=218757

So I'm going to add this patch to the port unconditionally once it works.

Unfortunately, I can't compile the port with either my patch below or your 
original replacement version of isboot_ifup(). :( Did you make other changes? 
Here's the error I'm getting:

--- isboot.o ---
isboot.c:425:53: error: incomplete definition of type 'struct thread'
error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
  ~~^
/usr/src/sys/sys/systm.h:185:8: note: forward declaration of 'struct thread'
struct thread;
   ^
1 error generated.


> # diff -u isboot.c.patched1 isboot.c
> --- isboot.c.patched1 2018-02-06 10:35:20.808692000 -0700
> +++ isboot.c  2018-02-06 10:50:05.347663000 -0700
> @@ -417,28 +417,36 @@
> isboot_ifup(struct ifnet *ifp)
> {
>   struct ifreq ifr;
> + struct socket *so;
>   struct thread *td;
>   int error;
> 
>   memset(, 0, sizeof(ifr));
>   td = curthread;
> 
> + error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> + if (error) {
> + printf("%s: socreate, error=%d\n", __func__, error);
> + return (error);
> + }
> +
>   /* boot NIC */
>   strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
> 
>   /* set IFF_UP */
> - error = ifioctl(NULL, SIOCGIFFLAGS, (caddr_t), td);
> + error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
>   if (error) {
>   printf("ifioctl SIOCGIFFLAGS\n");
>   return (error);
>   }
>   ifr.ifr_flags |= IFF_UP;
> - error = ifioctl(NULL, SIOCSIFFLAGS, (caddr_t), td);
> + error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
>   if (error) {
>   printf("ifioctl SIOCSIFFLAGS\n");
>   return (error);
>   }
> 
> + soclose(so);
>   return (0);
> }
> 
> 
>> static int
>> isboot_ifup(struct ifnet *ifp)
>> {
>>struct socket *so;
>>struct ifreq ifr;
>>struct thread *td;
>>int error;
>> 
>>td = curthread;
>>error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
>>if (error) {
>>printf("%s: socreate, error=%d\n", __func__, error);
>>return (error);
>>}
>> 
>>/* boot NIC */
>>memset(, 0, sizeof(ifr));
>>strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
>> 
>>/* set IFF_UP */
>>error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
>>if (error) {
>>printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
>>return (error);
>>}
>> 
>>ifr.ifr_flags |= IFF_UP;
>>error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
>>if (error) {
>>printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
>>return (error);
>>}
>>soclose(so);
>>return (0);
>> }
>> 
>> I have added a socket in the ifioctl() call as in the 
>> /usr/src/sys/nfs/bootp_subr.c source.
>> Please let me know if you prefer a patch.
>> --
>> Regards,
>> Maurizio

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-06 Thread John Nielsen

> On Feb 4, 2018, at 2:50 AM, Maurizio Vairani  wrote:
> 
> 2018-01-29 18:38 GMT+01:00 John Nielsen :
> [ resending from correct email address ]
> 
>> On Jan 29, 2018, at 6:05 AM, Maurizio Vairani  wrote:
>> 
>> I am running
>> # uname
>> -a
>> 
>> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
>> UTC 2018 
>> r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
>> amd64
>> 
>> After compiling the kernel module as discussed in this thread :
>> https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html
>> 
>> I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
>> boot driver version 0.2.13, starts I receive a panic:
>> https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
>> 
>> Any idea?
> 
> Bummer! 
> 
> Aoyama-san-
> 
> Are you still maintaining isboot? Can you help debug this issue on FreeBSD 
> 12-CURRENT?
> 
> Once we get it working I will update the port with whatever is needed and 
> send you the patches in case you'd like to cut a new release.
> 
> Thank you!
> 
> I have solved the issue changing the function isboot_ifup() in the source 
> file isboot.c.

Here is a patch with some changes to minimize the diff. Except for the printed 
error messages does that look functionally equivalent?

Now the question is why is this change needed and for what values of 
__FreeBSD_version is it appropriate?

# diff -u isboot.c.patched1 isboot.c
--- isboot.c.patched1   2018-02-06 10:35:20.808692000 -0700
+++ isboot.c2018-02-06 10:50:05.347663000 -0700
@@ -417,28 +417,36 @@
 isboot_ifup(struct ifnet *ifp)
 {
struct ifreq ifr;
+   struct socket *so;
struct thread *td;
int error;
 
memset(, 0, sizeof(ifr));
td = curthread;
 
+   error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
+   if (error) {
+   printf("%s: socreate, error=%d\n", __func__, error);
+   return (error);
+   }
+
/* boot NIC */
strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
 
/* set IFF_UP */
-   error = ifioctl(NULL, SIOCGIFFLAGS, (caddr_t), td);
+   error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
if (error) {
printf("ifioctl SIOCGIFFLAGS\n");
return (error);
}
ifr.ifr_flags |= IFF_UP;
-   error = ifioctl(NULL, SIOCSIFFLAGS, (caddr_t), td);
+   error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
if (error) {
printf("ifioctl SIOCSIFFLAGS\n");
return (error);
}
 
+   soclose(so);
return (0);
 }


> static int
> isboot_ifup(struct ifnet *ifp)
> {
> struct socket *so;
> struct ifreq ifr;
> struct thread *td;
> int error;
> 
> td = curthread;
> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> if (error) {
> printf("%s: socreate, error=%d\n", __func__, error);
> return (error);
> }
> 
> /* boot NIC */
> memset(, 0, sizeof(ifr));
> strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
> 
> /* set IFF_UP */
> error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
> if (error) {
> printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
> return (error);
> }
> 
> ifr.ifr_flags |= IFF_UP;
> error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
> if (error) {
> printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
> return (error);
> }
> soclose(so);
> return (0);
> }
> 
> I have added a socket in the ifioctl() call as in the 
> /usr/src/sys/nfs/bootp_subr.c source.
> Please let me know if you prefer a patch.
> --
> Regards,
> Maurizio
> 

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-06 Thread John Nielsen
> On Feb 4, 2018, at 2:50 AM, Maurizio Vairani  wrote:
> 
> 2018-01-29 18:38 GMT+01:00 John Nielsen :
> [ resending from correct email address ]
> 
>> On Jan 29, 2018, at 6:05 AM, Maurizio Vairani  wrote:
>> 
>> I am running
>> # uname
>> -a
>> 
>> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
>> UTC 2018 
>> r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
>> amd64
>> 
>> After compiling the kernel module as discussed in this thread :
>> https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html
>> 
>> I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
>> boot driver version 0.2.13, starts I receive a panic:
>> https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
>> 
>> Any idea?
> 
> Bummer! 
> 
> Aoyama-san-
> 
> Are you still maintaining isboot? Can you help debug this issue on FreeBSD 
> 12-CURRENT?
> 
> Once we get it working I will update the port with whatever is needed and 
> send you the patches in case you'd like to cut a new release.
> 
> Thank you!
> 
> I have solved the issue changing the function isboot_ifup() in the source 
> file isboot.c.

Nice work, thank you! I'll put the below together with the necessary changes to 
iscsi.c and update the port. If you could re-install from the port at that 
point as a further test/sanity check that would be great.

> static int
> isboot_ifup(struct ifnet *ifp)
> {
> struct socket *so;
> struct ifreq ifr;
> struct thread *td;
> int error;
> 
> td = curthread;
> error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
> if (error) {
> printf("%s: socreate, error=%d\n", __func__, error);
> return (error);
> }
> 
> /* boot NIC */
> memset(, 0, sizeof(ifr));
> strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));
> 
> /* set IFF_UP */
> error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
> if (error) {
> printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
> return (error);
> }
> 
> ifr.ifr_flags |= IFF_UP;
> error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
> if (error) {
> printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
> return (error);
> }
> soclose(so);
> return (0);
> }
> 
> I have added a socket in the ifioctl() call as in the 
> /usr/src/sys/nfs/bootp_subr.c source.
> Please let me know if you prefer a patch.
> --
> Regards,
> Maurizio

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-04 Thread Andriy Gapon
On 04/02/2018 11:50, Maurizio Vairani wrote:
> I have added a socket in the ifioctl() call as in the
> /usr/src/sys/nfs/bootp_subr.c source.
> Please let me know if you prefer a patch.

A patch here https://reviews.freebsd.org/ would be the best.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-02-04 Thread Maurizio Vairani
2018-01-29 18:38 GMT+01:00 John Nielsen :

> [ resending from correct email address ]
>
> On Jan 29, 2018, at 6:05 AM, Maurizio Vairani 
> wrote:
>
> I am running
> # uname
> -a
>
> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
> UTC 2018 r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.
> amd64/sys/GENERIC
> amd64
>
> After compiling the kernel module as discussed in this thread :
> https://lists.freebsd.org/pipermail/freebsd-current/
> 2018-January/068272.html
>
> I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
> boot driver version 0.2.13, starts I receive a panic:
> https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
>
> Any idea?
>
>
> Bummer!
>
> Aoyama-san-
>
> Are you still maintaining isboot? Can you help debug this issue on FreeBSD
> 12-CURRENT?
>
> Once we get it working I will update the port with whatever is needed and
> send you the patches in case you'd like to cut a new release.
>
> Thank you!
>

I have solved the issue changing the function isboot_ifup() in the source
file isboot.c.

static int
isboot_ifup(struct ifnet *ifp)
{
struct socket *so;
struct ifreq ifr;
struct thread *td;
int error;

td = curthread;
error = socreate(AF_INET, , SOCK_DGRAM, 0, td->td_ucred, td);
if (error) {
printf("%s: socreate, error=%d\n", __func__, error);
return (error);
}

/* boot NIC */
memset(, 0, sizeof(ifr));
strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name));

/* set IFF_UP */
error = ifioctl(so, SIOCGIFFLAGS, (caddr_t), td);
if (error) {
printf("%s: ifioctl SIOCGIFFLAGS, error=%d\n", __func__, error);
return (error);
}

ifr.ifr_flags |= IFF_UP;
error = ifioctl(so, SIOCSIFFLAGS, (caddr_t), td);
if (error) {
printf("%s, ifioctl SIOCSIFFLAGS, error=%d\n", __func__, error);
return (error);
}
soclose(so);
return (0);
}

I have added a socket in the ifioctl() call as in the
/usr/src/sys/nfs/bootp_subr.c source.
Please let me know if you prefer a patch.
--
Regards,
Maurizio
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-01-29 Thread John Nielsen
[ resending from correct email address ]

> On Jan 29, 2018, at 6:05 AM, Maurizio Vairani  wrote:
> 
> I am running
> # uname
> -a
> 
> FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
> UTC 2018 
> r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
> amd64
> 
> After compiling the kernel module as discussed in this thread :
> https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html
> 
> I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
> boot driver version 0.2.13, starts I receive a panic:
> https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4
> 
> Any idea?

Bummer! 

Aoyama-san-

Are you still maintaining isboot? Can you help debug this issue on FreeBSD 
12-CURRENT?

Once we get it working I will update the port with whatever is needed and send 
you the patches in case you'd like to cut a new release.

Thank you!
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Fatal trap 12 booting FreeBSD-CURRENT via isboot kernel module.

2018-01-29 Thread Maurizio Vairani
I am running
# uname
-a

FreeBSD  12.0-CURRENT FreeBSD 12.0-CURRENT #0 r328383: Thu Jan 25 04:48:52
UTC 2018 
r...@releng3.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64

After compiling the kernel module as discussed in this thread :
https://lists.freebsd.org/pipermail/freebsd-current/2018-January/068272.html

I can boot FreeBSD via iSCSI using iPXE. But when the isboot, the iSCSI
boot driver version 0.2.13, starts I receive a panic:
https://mega.nz/#!tkVwBBKA!PUj14-Za6KCNaoo9hxuXORRLQoWkb4LMvTdUA1BorD4

Any idea?
--
Thanks,
Maurizio
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"