diff --git a/ChangeLog b/ChangeLog index c08a045f3..15ad7dfe0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-10-08 Vladimir Serbinenko + + * util/ieee1275/ofpath.c: Move to ... + * grub-core/osdep/linux/ofpath.c: ..here, split stub into ... + * grub-core/osdep/basic/ofpath.c: ..here. + 2013-10-08 Vladimir Serbinenko Move password-querying (util-version) routines to grub-core/osdep. diff --git a/Makefile.util.def b/Makefile.util.def index 9d781be14..a42562627 100644 --- a/Makefile.util.def +++ b/Makefile.util.def @@ -294,7 +294,7 @@ program = { installdir = sbin; mansection = 8; common = util/grub-probe.c; - common = util/ieee1275/ofpath.c; + common = grub-core/osdep/ofpath.c; common = grub-core/kern/emu/argp_common.c; ldadd = libgrubmods.a; @@ -327,7 +327,7 @@ program = { common = util/grub-setup.c; common = grub-core/kern/emu/argp_common.c; common = grub-core/lib/reed_solomon.c; - common = util/ieee1275/ofpath.c; + common = grub-core/osdep/ofpath.c; ldadd = libgrubmods.a; ldadd = libgrubkern.a; @@ -342,7 +342,7 @@ program = { installdir = sbin; mansection = 8; common = util/ieee1275/grub-ofpathname.c; - common = util/ieee1275/ofpath.c; + common = grub-core/osdep/ofpath.c; ldadd = libgrubmods.a; ldadd = libgrubgcry.a; diff --git a/grub-core/osdep/basic/ofpath.c b/grub-core/osdep/basic/ofpath.c new file mode 100644 index 000000000..c3fe06f68 --- /dev/null +++ b/grub-core/osdep/basic/ofpath.c @@ -0,0 +1,29 @@ +/* ofpath.c - calculate OpenFirmware path names given an OS device */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009, 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 +#include + +char * +grub_util_devname_to_ofpath (const char *sys_devname __attribute__ ((unused))) +{ + return NULL; +} + + diff --git a/util/ieee1275/ofpath.c b/grub-core/osdep/linux/ofpath.c similarity index 98% rename from util/ieee1275/ofpath.c rename to grub-core/osdep/linux/ofpath.c index c78de14a4..29ae56580 100644 --- a/util/ieee1275/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -1,7 +1,7 @@ /* ofpath.c - calculate OpenFirmware path names given an OS device */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. + * Copyright (C) 2009, 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 @@ -70,8 +70,6 @@ grub_util_info (const char *fmt, ...) #define xstrdup strdup #endif -#ifndef _WIN32 - static void kill_trailing_dir(char *path) { @@ -534,16 +532,6 @@ grub_util_devname_to_ofpath (const char *sys_devname) return ofpath; } -#else - -char * -grub_util_devname_to_ofpath (const char *sys_devname __attribute__ ((unused))) -{ - return NULL; -} - -#endif - #ifdef OFPATH_STANDALONE int main(int argc, char **argv) { diff --git a/grub-core/osdep/ofpath.c b/grub-core/osdep/ofpath.c new file mode 100644 index 000000000..1389b1d49 --- /dev/null +++ b/grub-core/osdep/ofpath.c @@ -0,0 +1,5 @@ +#if defined (__linux__) +#include "linux/ofpath.c" +#else +#include "basic/ofpath.c" +#endif