]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/net/drivers/emu/emunet.c: Move to ..
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 8 Oct 2013 16:42:46 +0000 (18:42 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 8 Oct 2013 16:42:46 +0000 (18:42 +0200)
* grub-core/osdep/linux/emunet.c: ..here.

ChangeLog
grub-core/Makefile.core.def
grub-core/osdep/basic/emunet.c [new file with mode: 0644]
grub-core/osdep/emunet.c [new file with mode: 0644]
grub-core/osdep/linux/emunet.c [moved from grub-core/net/drivers/emu/emunet.c with 92% similarity]

index 15ad7dfe008f5a5424af756f9bafb8402da73555..c1e9fbfec8210040314c7777de9008f71c048c2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-08  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/net/drivers/emu/emunet.c: Move to ..
+       * grub-core/osdep/linux/emunet.c: ..here.
+
 2013-10-08  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/ieee1275/ofpath.c: Move to ...
index a7ff80e70531d8b9e45f4b5882b3fc88c40478e3..483d8a89e8969297e4232edc5b876cb22f2f5a6f 100644 (file)
@@ -1973,7 +1973,7 @@ module = {
 
 module = {
   name = emunet;
-  emu = net/drivers/emu/emunet.c;
+  emu = osdep/emunet.c;
   enable = emu;
 };
 
diff --git a/grub-core/osdep/basic/emunet.c b/grub-core/osdep/basic/emunet.c
new file mode 100644 (file)
index 0000000..e798934
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ *  GRUB  --  GRand Unified Bootloader
+ *  Copyright (C) 2010,2011,2012,2013  Free Software Foundation, Inc.
+ *
+ *  GRUB is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  GRUB is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/dl.h>
+
+GRUB_MOD_LICENSE ("GPLv3+");
diff --git a/grub-core/osdep/emunet.c b/grub-core/osdep/emunet.c
new file mode 100644 (file)
index 0000000..4b0bac4
--- /dev/null
@@ -0,0 +1,5 @@
+#if defined (__linux__)
+#include "linux/emunet.c"
+#else
+#include "basic/emunet.c"
+#endif
similarity index 92%
rename from grub-core/net/drivers/emu/emunet.c
rename to grub-core/osdep/linux/emunet.c
index 6b533dde0a3b724aa69a3c93be1c83ecf0c69922..9b502c73d5f8453ea13f1599fff99c3820833af5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2010,2011  Free Software Foundation, Inc.
+ *  Copyright (C) 2010,2011,2012,2013  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #include <sys/socket.h>
 #include <grub/net.h>
 #include <sys/types.h>
-#ifdef __linux__
-# include <linux/if.h>
-# include <linux/if_tun.h>
-#endif /* __linux__ */
+#include <linux/if.h>
+#include <linux/if_tun.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -99,7 +97,6 @@ static struct grub_net_card emucard =
 
 GRUB_MOD_INIT(emunet)
 {
-#ifdef __linux__
   struct ifreq ifr;
   fd = open ("/dev/net/tun", O_RDWR | O_NONBLOCK);
   if (fd < 0)
@@ -113,10 +110,6 @@ GRUB_MOD_INIT(emunet)
       return;
     }
   grub_net_card_register (&emucard);
-#else /* !__linux__ */
-  fd = -1;
-  return;
-#endif /* __linux__ */
 }
 
 GRUB_MOD_FINI(emunet)