Fix grub-emu build on FreeBSD.
* Makefile.util.def (grub-mount): Add LIBGEOM to ldadd. * grub-core/net/drivers/emu/emunet.c: Only include Linux-specific headers on Linux. (GRUB_MOD_INIT): Return immediately on non-Linux platforms; this implementation is currently Linux-specific. * util/getroot.c (exec_pipe): Define only on Linux or when either libzfs or libnvpair is unavailable. (find_root_devices_from_poolname): Remove unused path variable.
This commit is contained in:
parent
86d08fdb18
commit
794c8c3375
4 changed files with 29 additions and 4 deletions
|
@ -21,8 +21,10 @@
|
|||
#include <sys/socket.h>
|
||||
#include <grub/net.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/if_tun.h>
|
||||
#ifdef __linux__
|
||||
# include <linux/if.h>
|
||||
# include <linux/if_tun.h>
|
||||
#endif /* __linux__ */
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
@ -97,6 +99,7 @@ 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)
|
||||
|
@ -110,6 +113,10 @@ GRUB_MOD_INIT(emunet)
|
|||
return;
|
||||
}
|
||||
grub_net_card_register (&emucard);
|
||||
#else /* !__linux__ */
|
||||
fd = -1;
|
||||
return;
|
||||
#endif /* __linux__ */
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(emunet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue