diff mbox

[v2,07/10] Do not link libnet to net-snk anymore, and remove net-snk from board-qemu

Message ID 1474312112-27835-8-git-send-email-thuth@redhat.com
State Superseded
Headers show

Commit Message

Thomas Huth Sept. 19, 2016, 7:08 p.m. UTC
Since libnet is now linked to Paflof directly, we do not have to
link it into net-snk anymore. So for board-qemu, we can now even
exclude net-snk completely from the build (for board-js2x, it is
still required for the biosemu, so we can not erase the net-snk
folder completely yet).

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 board-qemu/Makefile           | 2 +-
 board-qemu/romfs/boot_rom.ffs | 1 -
 clients/net-snk/Makefile      | 2 +-
 clients/net-snk/app/Makefile  | 2 +-
 clients/net-snk/app/main.c    | 5 -----
 lib/libnet/Makefile           | 3 +--
 lib/libnet/netload.c          | 2 +-
 7 files changed, 5 insertions(+), 12 deletions(-)

Comments

Alexey Kardashevskiy Oct. 10, 2016, 2:46 a.m. UTC | #1
On 20/09/16 05:08, Thomas Huth wrote:
> Since libnet is now linked to Paflof directly, we do not have to
> link it into net-snk anymore. So for board-qemu, we can now even
> exclude net-snk completely from the build (for board-js2x, it is
> still required for the biosemu, so we can not erase the net-snk
> folder completely yet).
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  board-qemu/Makefile           | 2 +-
>  board-qemu/romfs/boot_rom.ffs | 1 -
>  clients/net-snk/Makefile      | 2 +-
>  clients/net-snk/app/Makefile  | 2 +-
>  clients/net-snk/app/main.c    | 5 -----
>  lib/libnet/Makefile           | 3 +--
>  lib/libnet/netload.c          | 2 +-
>  7 files changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/board-qemu/Makefile b/board-qemu/Makefile
> index 78639cc..7208fcc 100644
> --- a/board-qemu/Makefile
> +++ b/board-qemu/Makefile
> @@ -10,7 +10,7 @@
>  # *     IBM Corporation - initial implementation
>  # ****************************************************************************/
>  
> -BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
> +BOARD_TARGETS = tools_build romfs_build stage1 subdirs
>  
>  SUBDIRS = slof
>  
> diff --git a/board-qemu/romfs/boot_rom.ffs b/board-qemu/romfs/boot_rom.ffs
> index 3cdb7d3..0248115 100644
> --- a/board-qemu/romfs/boot_rom.ffs
> +++ b/board-qemu/romfs/boot_rom.ffs
> @@ -17,4 +17,3 @@ stage1		board-qemu/llfw/stage1.bin	1			0x100
>  xvect		slof/xvect.bin			0			0
>  ofw_main	board-qemu/slof/paflof		0			0
>  bootinfo	board-qemu/llfw/Cboot.bin	0			0
> -snk		clients/net-snk.client		0			0
> diff --git a/clients/net-snk/Makefile b/clients/net-snk/Makefile
> index 1cab7ae..c0bb73a 100644
> --- a/clients/net-snk/Makefile
> +++ b/clients/net-snk/Makefile
> @@ -17,7 +17,7 @@ include $(TOP)/make.rules
>  OBJS	=  kernel/kernel.o oflib/oflib.o libc/libc-glue.o app/app.o
>  .PHONY : subdirs clean depend mrproper
>  
> -CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libnet.a $(LIBCMNDIR)/libc.a
> +CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
>  
>  all:	.depend subdirs
>  	$(MAKE) client
> diff --git a/clients/net-snk/app/Makefile b/clients/net-snk/app/Makefile
> index 52d446c..2da02b9 100644
> --- a/clients/net-snk/app/Makefile
> +++ b/clients/net-snk/app/Makefile
> @@ -16,7 +16,7 @@ export TOP
>  endif
>  include $(TOP)/make.rules
>  
> -CFLAGS +=$(ADDCFLAGS) -I$(LIBCMNDIR)/libnet
> +CFLAGS +=$(ADDCFLAGS)
>  
>  OBJS = main.o
>  
> diff --git a/clients/net-snk/app/main.c b/clients/net-snk/app/main.c
> index 22aeba7..17c16b6 100644
> --- a/clients/net-snk/app/main.c
> +++ b/clients/net-snk/app/main.c
> @@ -13,7 +13,6 @@
>  #include <string.h>
>  #include <stdio.h>
>  #include <of.h>
> -#include <netapps.h>
>  #include <libbootmsg.h>
>  
>  #ifdef SNK_BIOSEMU_APPS
> @@ -31,10 +30,6 @@ main(int argc, char *argv[])
>  	int i;
>  	of_set_callback((void *) &_callback_entry);
>  
> -	if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
> -		return netboot(argc, argv);

This logically belongs to 05/10.

> -	if (strcmp(argv[0], "ping") == 0)
> -		return ping(argc, argv);

And this - to 06/10.


>  #ifdef SNK_BIOSEMU_APPS
>  	// BIOS Emulator applications
>  	if (strcmp(argv[0], "biosemu") == 0)
> diff --git a/lib/libnet/Makefile b/lib/libnet/Makefile
> index 2c9b7c2..83ac1e5 100644
> --- a/lib/libnet/Makefile
> +++ b/lib/libnet/Makefile
> @@ -16,8 +16,7 @@ ifndef TOP
>  endif
>  include $(TOP)/make.rules
>  
> -CFLAGS += -I. -I.. -I../libc/include
> -CFLAGS += -I../../clients/net-snk/app/netapps -I../../clients/net-snk/include
> +CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include
>  
>  SRCS =	ethernet.c ipv4.c udp.c tcp.c dns.c bootp.c dhcp.c tftp.c \
>  	ipv6.c dhcpv6.c icmpv6.c ndp.c netload.c ping.c args.c
> diff --git a/lib/libnet/netload.c b/lib/libnet/netload.c
> index 1b7c1bc..6429405 100644
> --- a/lib/libnet/netload.c
> +++ b/lib/libnet/netload.c
> @@ -24,7 +24,7 @@
>  #include <stdlib.h>
>  #include <sys/socket.h>
>  #include <libbootmsg/libbootmsg.h>
> -#include <of.h>
> +#include <helpers.h>
>  #include "args.h"
>  #include "netapps.h"
>  
>
Thomas Huth Oct. 11, 2016, 12:45 p.m. UTC | #2
On 10.10.2016 04:46, Alexey Kardashevskiy wrote:
> On 20/09/16 05:08, Thomas Huth wrote:
>> Since libnet is now linked to Paflof directly, we do not have to
>> link it into net-snk anymore. So for board-qemu, we can now even
>> exclude net-snk completely from the build (for board-js2x, it is
>> still required for the biosemu, so we can not erase the net-snk
>> folder completely yet).
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  board-qemu/Makefile           | 2 +-
>>  board-qemu/romfs/boot_rom.ffs | 1 -
>>  clients/net-snk/Makefile      | 2 +-
>>  clients/net-snk/app/Makefile  | 2 +-
>>  clients/net-snk/app/main.c    | 5 -----
>>  lib/libnet/Makefile           | 3 +--
>>  lib/libnet/netload.c          | 2 +-
>>  7 files changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/board-qemu/Makefile b/board-qemu/Makefile
>> index 78639cc..7208fcc 100644
>> --- a/board-qemu/Makefile
>> +++ b/board-qemu/Makefile
>> @@ -10,7 +10,7 @@
>>  # *     IBM Corporation - initial implementation
>>  # ****************************************************************************/
>>  
>> -BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
>> +BOARD_TARGETS = tools_build romfs_build stage1 subdirs
>>  
>>  SUBDIRS = slof
>>  
>> diff --git a/board-qemu/romfs/boot_rom.ffs b/board-qemu/romfs/boot_rom.ffs
>> index 3cdb7d3..0248115 100644
>> --- a/board-qemu/romfs/boot_rom.ffs
>> +++ b/board-qemu/romfs/boot_rom.ffs
>> @@ -17,4 +17,3 @@ stage1		board-qemu/llfw/stage1.bin	1			0x100
>>  xvect		slof/xvect.bin			0			0
>>  ofw_main	board-qemu/slof/paflof		0			0
>>  bootinfo	board-qemu/llfw/Cboot.bin	0			0
>> -snk		clients/net-snk.client		0			0
>> diff --git a/clients/net-snk/Makefile b/clients/net-snk/Makefile
>> index 1cab7ae..c0bb73a 100644
>> --- a/clients/net-snk/Makefile
>> +++ b/clients/net-snk/Makefile
>> @@ -17,7 +17,7 @@ include $(TOP)/make.rules
>>  OBJS	=  kernel/kernel.o oflib/oflib.o libc/libc-glue.o app/app.o
>>  .PHONY : subdirs clean depend mrproper
>>  
>> -CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libnet.a $(LIBCMNDIR)/libc.a
>> +CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
>>  
>>  all:	.depend subdirs
>>  	$(MAKE) client
>> diff --git a/clients/net-snk/app/Makefile b/clients/net-snk/app/Makefile
>> index 52d446c..2da02b9 100644
>> --- a/clients/net-snk/app/Makefile
>> +++ b/clients/net-snk/app/Makefile
>> @@ -16,7 +16,7 @@ export TOP
>>  endif
>>  include $(TOP)/make.rules
>>  
>> -CFLAGS +=$(ADDCFLAGS) -I$(LIBCMNDIR)/libnet
>> +CFLAGS +=$(ADDCFLAGS)
>>  
>>  OBJS = main.o
>>  
>> diff --git a/clients/net-snk/app/main.c b/clients/net-snk/app/main.c
>> index 22aeba7..17c16b6 100644
>> --- a/clients/net-snk/app/main.c
>> +++ b/clients/net-snk/app/main.c
>> @@ -13,7 +13,6 @@
>>  #include <string.h>
>>  #include <stdio.h>
>>  #include <of.h>
>> -#include <netapps.h>
>>  #include <libbootmsg.h>
>>  
>>  #ifdef SNK_BIOSEMU_APPS
>> @@ -31,10 +30,6 @@ main(int argc, char *argv[])
>>  	int i;
>>  	of_set_callback((void *) &_callback_entry);
>>  
>> -	if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
>> -		return netboot(argc, argv);
> 
> This logically belongs to 05/10.
> 
>> -	if (strcmp(argv[0], "ping") == 0)
>> -		return ping(argc, argv);
> 
> And this - to 06/10.

IMHO it does not really matter, but if you prefer it the other way, I
can rework my patches and send a v3.

 Thomas


PS: If you're happy with the first three or four patches, could you
maybe push them into the repository already, so that I do not have to
send them again and again? They are pretty independent from the rest of
the series, so it should be OK if they go in first, I think.
Alexey Kardashevskiy Oct. 12, 2016, 12:44 a.m. UTC | #3
On 11/10/16 23:45, Thomas Huth wrote:
> On 10.10.2016 04:46, Alexey Kardashevskiy wrote:
>> On 20/09/16 05:08, Thomas Huth wrote:
>>> Since libnet is now linked to Paflof directly, we do not have to
>>> link it into net-snk anymore. So for board-qemu, we can now even
>>> exclude net-snk completely from the build (for board-js2x, it is
>>> still required for the biosemu, so we can not erase the net-snk
>>> folder completely yet).
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>  board-qemu/Makefile           | 2 +-
>>>  board-qemu/romfs/boot_rom.ffs | 1 -
>>>  clients/net-snk/Makefile      | 2 +-
>>>  clients/net-snk/app/Makefile  | 2 +-
>>>  clients/net-snk/app/main.c    | 5 -----
>>>  lib/libnet/Makefile           | 3 +--
>>>  lib/libnet/netload.c          | 2 +-
>>>  7 files changed, 5 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/board-qemu/Makefile b/board-qemu/Makefile
>>> index 78639cc..7208fcc 100644
>>> --- a/board-qemu/Makefile
>>> +++ b/board-qemu/Makefile
>>> @@ -10,7 +10,7 @@
>>>  # *     IBM Corporation - initial implementation
>>>  # ****************************************************************************/
>>>  
>>> -BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
>>> +BOARD_TARGETS = tools_build romfs_build stage1 subdirs
>>>  
>>>  SUBDIRS = slof
>>>  
>>> diff --git a/board-qemu/romfs/boot_rom.ffs b/board-qemu/romfs/boot_rom.ffs
>>> index 3cdb7d3..0248115 100644
>>> --- a/board-qemu/romfs/boot_rom.ffs
>>> +++ b/board-qemu/romfs/boot_rom.ffs
>>> @@ -17,4 +17,3 @@ stage1		board-qemu/llfw/stage1.bin	1			0x100
>>>  xvect		slof/xvect.bin			0			0
>>>  ofw_main	board-qemu/slof/paflof		0			0
>>>  bootinfo	board-qemu/llfw/Cboot.bin	0			0
>>> -snk		clients/net-snk.client		0			0
>>> diff --git a/clients/net-snk/Makefile b/clients/net-snk/Makefile
>>> index 1cab7ae..c0bb73a 100644
>>> --- a/clients/net-snk/Makefile
>>> +++ b/clients/net-snk/Makefile
>>> @@ -17,7 +17,7 @@ include $(TOP)/make.rules
>>>  OBJS	=  kernel/kernel.o oflib/oflib.o libc/libc-glue.o app/app.o
>>>  .PHONY : subdirs clean depend mrproper
>>>  
>>> -CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libnet.a $(LIBCMNDIR)/libc.a
>>> +CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
>>>  
>>>  all:	.depend subdirs
>>>  	$(MAKE) client
>>> diff --git a/clients/net-snk/app/Makefile b/clients/net-snk/app/Makefile
>>> index 52d446c..2da02b9 100644
>>> --- a/clients/net-snk/app/Makefile
>>> +++ b/clients/net-snk/app/Makefile
>>> @@ -16,7 +16,7 @@ export TOP
>>>  endif
>>>  include $(TOP)/make.rules
>>>  
>>> -CFLAGS +=$(ADDCFLAGS) -I$(LIBCMNDIR)/libnet
>>> +CFLAGS +=$(ADDCFLAGS)
>>>  
>>>  OBJS = main.o
>>>  
>>> diff --git a/clients/net-snk/app/main.c b/clients/net-snk/app/main.c
>>> index 22aeba7..17c16b6 100644
>>> --- a/clients/net-snk/app/main.c
>>> +++ b/clients/net-snk/app/main.c
>>> @@ -13,7 +13,6 @@
>>>  #include <string.h>
>>>  #include <stdio.h>
>>>  #include <of.h>
>>> -#include <netapps.h>
>>>  #include <libbootmsg.h>
>>>  
>>>  #ifdef SNK_BIOSEMU_APPS
>>> @@ -31,10 +30,6 @@ main(int argc, char *argv[])
>>>  	int i;
>>>  	of_set_callback((void *) &_callback_entry);
>>>  
>>> -	if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
>>> -		return netboot(argc, argv);
>>
>> This logically belongs to 05/10.
>>
>>> -	if (strcmp(argv[0], "ping") == 0)
>>> -		return ping(argc, argv);
>>
>> And this - to 06/10.
> 
> IMHO it does not really matter, but if you prefer it the other way, I
> can rework my patches and send a v3.

Do not you prefer it the other way for some reason? If so - speak. I agree
it does not matter that much but it is a bit inaccurate and I thought your
intention is to make everything here more accurate and this is a part of
the process :)


> 
>  Thomas
> 
> 
> PS: If you're happy with the first three or four patches, could you
> maybe push them into the repository already, so that I do not have to
> send them again and again? They are pretty independent from the rest of
> the series, so it should be OK if they go in first, I think.

Well, if it is independent, post them in separate patchsets. Also, I was
waiting for your reply to other patches in case if you insist on the
current versions and then I could have agreed and pushed the whole set as is.

I have just pushed 01/10..04/10.
diff mbox

Patch

diff --git a/board-qemu/Makefile b/board-qemu/Makefile
index 78639cc..7208fcc 100644
--- a/board-qemu/Makefile
+++ b/board-qemu/Makefile
@@ -10,7 +10,7 @@ 
 # *     IBM Corporation - initial implementation
 # ****************************************************************************/
 
-BOARD_TARGETS = tools_build romfs_build clients_build stage1 subdirs
+BOARD_TARGETS = tools_build romfs_build stage1 subdirs
 
 SUBDIRS = slof
 
diff --git a/board-qemu/romfs/boot_rom.ffs b/board-qemu/romfs/boot_rom.ffs
index 3cdb7d3..0248115 100644
--- a/board-qemu/romfs/boot_rom.ffs
+++ b/board-qemu/romfs/boot_rom.ffs
@@ -17,4 +17,3 @@  stage1		board-qemu/llfw/stage1.bin	1			0x100
 xvect		slof/xvect.bin			0			0
 ofw_main	board-qemu/slof/paflof		0			0
 bootinfo	board-qemu/llfw/Cboot.bin	0			0
-snk		clients/net-snk.client		0			0
diff --git a/clients/net-snk/Makefile b/clients/net-snk/Makefile
index 1cab7ae..c0bb73a 100644
--- a/clients/net-snk/Makefile
+++ b/clients/net-snk/Makefile
@@ -17,7 +17,7 @@  include $(TOP)/make.rules
 OBJS	=  kernel/kernel.o oflib/oflib.o libc/libc-glue.o app/app.o
 .PHONY : subdirs clean depend mrproper
 
-CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libnet.a $(LIBCMNDIR)/libc.a
+CLIENTLIBS = $(LIBCMNDIR)/libelf.a $(LIBCMNDIR)/libc.a
 
 all:	.depend subdirs
 	$(MAKE) client
diff --git a/clients/net-snk/app/Makefile b/clients/net-snk/app/Makefile
index 52d446c..2da02b9 100644
--- a/clients/net-snk/app/Makefile
+++ b/clients/net-snk/app/Makefile
@@ -16,7 +16,7 @@  export TOP
 endif
 include $(TOP)/make.rules
 
-CFLAGS +=$(ADDCFLAGS) -I$(LIBCMNDIR)/libnet
+CFLAGS +=$(ADDCFLAGS)
 
 OBJS = main.o
 
diff --git a/clients/net-snk/app/main.c b/clients/net-snk/app/main.c
index 22aeba7..17c16b6 100644
--- a/clients/net-snk/app/main.c
+++ b/clients/net-snk/app/main.c
@@ -13,7 +13,6 @@ 
 #include <string.h>
 #include <stdio.h>
 #include <of.h>
-#include <netapps.h>
 #include <libbootmsg.h>
 
 #ifdef SNK_BIOSEMU_APPS
@@ -31,10 +30,6 @@  main(int argc, char *argv[])
 	int i;
 	of_set_callback((void *) &_callback_entry);
 
-	if (strcmp(argv[0], "netboot") == 0 && argc >= 5)
-		return netboot(argc, argv);
-	if (strcmp(argv[0], "ping") == 0)
-		return ping(argc, argv);
 #ifdef SNK_BIOSEMU_APPS
 	// BIOS Emulator applications
 	if (strcmp(argv[0], "biosemu") == 0)
diff --git a/lib/libnet/Makefile b/lib/libnet/Makefile
index 2c9b7c2..83ac1e5 100644
--- a/lib/libnet/Makefile
+++ b/lib/libnet/Makefile
@@ -16,8 +16,7 @@  ifndef TOP
 endif
 include $(TOP)/make.rules
 
-CFLAGS += -I. -I.. -I../libc/include
-CFLAGS += -I../../clients/net-snk/app/netapps -I../../clients/net-snk/include
+CFLAGS += -I. -I.. -I../libc/include -I$(TOP)/include
 
 SRCS =	ethernet.c ipv4.c udp.c tcp.c dns.c bootp.c dhcp.c tftp.c \
 	ipv6.c dhcpv6.c icmpv6.c ndp.c netload.c ping.c args.c
diff --git a/lib/libnet/netload.c b/lib/libnet/netload.c
index 1b7c1bc..6429405 100644
--- a/lib/libnet/netload.c
+++ b/lib/libnet/netload.c
@@ -24,7 +24,7 @@ 
 #include <stdlib.h>
 #include <sys/socket.h>
 #include <libbootmsg/libbootmsg.h>
-#include <of.h>
+#include <helpers.h>
 #include "args.h"
 #include "netapps.h"