diff --git a/ChangeLog b/ChangeLog index 0bc9ac7c2..379549b95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-26 Robert Millan + + Build fixes for GNU/kFreeBSD. + + * Makefile.util.def: Add `$(LIBZFS) $(LIBNVPAIR)' library dependencies + to programs that require ZFS conversion. + * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy): Support + kernels that don't have FLOPPY_MAJOR. + 2010-09-25 BVK Chaitanya * grub-core/kern/emu/full.c (grub_emu_post_init): Fix typo. diff --git a/Makefile.util.def b/Makefile.util.def index 42165df3d..21dda2df7 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -109,7 +109,7 @@ program = { ldadd = libgrub.a; ldadd = '$(LIBLZMA)'; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; cppflags = '-DGRUB_PKGLIBROOTDIR=\"$(pkglibrootdir)\"'; }; @@ -121,7 +121,7 @@ program = { common = util/grub-mkrelpath.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -132,7 +132,7 @@ program = { common = util/grub-script-check.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -143,7 +143,7 @@ program = { common = util/grub-editenv.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -154,7 +154,7 @@ program = { common = util/grub-mkpasswd-pbkdf2.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; cflags = '$(CFLAGS_GCRY)'; cppflags = '$(CPPFLAGS_GCRY)'; @@ -190,7 +190,7 @@ program = { cppflags = '$(CPPFLAGS_GCRY)'; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -203,7 +203,7 @@ program = { cflags = '$(freetype_cflags)'; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; ldadd = '$(freetype_libs)'; condition = COND_GRUB_MKFONT; @@ -222,7 +222,7 @@ program = { sparc64_ieee1275 = util/ieee1275/devicemap.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -233,7 +233,7 @@ program = { common = util/grub-probe.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -248,7 +248,7 @@ program = { sparc64_ieee1275 = util/ieee1275/ofpath.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; enable = i386_pc; @@ -274,7 +274,7 @@ program = { common = util/grub-mklayout.c; ldadd = libgrub.a; - ldadd = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; @@ -595,6 +595,6 @@ program = { common = grub-core/lib/i386/pc/vesa_modes_table.c; ldadd = libgrub.a; - ldflags = '$(LIBINTL) $(LIBDEVMAPPER)'; + ldflags = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR)'; ldadd = grub-core/gnulib/libgnu.a; }; diff --git a/grub-core/kern/emu/hostdisk.c b/grub-core/kern/emu/hostdisk.c index 19d3856a2..08f60ee66 100644 --- a/grub-core/kern/emu/hostdisk.c +++ b/grub-core/kern/emu/hostdisk.c @@ -1,7 +1,7 @@ /* hostdisk.c - emulate biosdisk */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010 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 @@ -1627,7 +1627,16 @@ grub_util_biosdisk_is_floppy (grub_disk_t disk) return 1; #endif +#if defined(FLOPPY_MAJOR) if (major(st.st_rdev) == FLOPPY_MAJOR) +#else + /* Some kernels (e.g. kFreeBSD) don't have a static major number + for floppies, but they still use a "fd[0-9]" pathname. */ + if (map[disk->id].device[5] == 'f' + && map[disk->id].device[6] == 'd' + && map[disk->id].device[7] >= '0' + && map[disk->id].device[7] <= '9') +#endif return 1; return 0;