diff --git a/ChangeLog b/ChangeLog index 15ad7dfe0..c1e9fbfec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-10-08 Vladimir Serbinenko + + * grub-core/net/drivers/emu/emunet.c: Move to .. + * grub-core/osdep/linux/emunet.c: ..here. + 2013-10-08 Vladimir Serbinenko * util/ieee1275/ofpath.c: Move to ... diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index a7ff80e70..483d8a89e 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -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 index 000000000..e7989341c --- /dev/null +++ b/grub-core/osdep/basic/emunet.c @@ -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 . + */ + +#include + +GRUB_MOD_LICENSE ("GPLv3+"); diff --git a/grub-core/osdep/emunet.c b/grub-core/osdep/emunet.c new file mode 100644 index 000000000..4b0bac4a8 --- /dev/null +++ b/grub-core/osdep/emunet.c @@ -0,0 +1,5 @@ +#if defined (__linux__) +#include "linux/emunet.c" +#else +#include "basic/emunet.c" +#endif diff --git a/grub-core/net/drivers/emu/emunet.c b/grub-core/osdep/linux/emunet.c similarity index 92% rename from grub-core/net/drivers/emu/emunet.c rename to grub-core/osdep/linux/emunet.c index 6b533dde0..9b502c73d 100644 --- a/grub-core/net/drivers/emu/emunet.c +++ b/grub-core/osdep/linux/emunet.c @@ -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 @@ -21,10 +21,8 @@ #include #include #include -#ifdef __linux__ -# include -# include -#endif /* __linux__ */ +#include +#include #include #include #include @@ -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)