summaryrefslogtreecommitdiffstats
path: root/grub-core/osdep/basic
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--grub-core/osdep/basic/compress.c21
-rw-r--r--grub-core/osdep/basic/emunet.c50
-rw-r--r--grub-core/osdep/basic/getroot.c82
-rw-r--r--grub-core/osdep/basic/hostdisk.c58
-rw-r--r--grub-core/osdep/basic/init.c38
-rw-r--r--grub-core/osdep/basic/no_platform.c46
-rw-r--r--grub-core/osdep/basic/ofpath.c29
-rw-r--r--grub-core/osdep/basic/platform.c32
-rw-r--r--grub-core/osdep/basic/random.c43
9 files changed, 399 insertions, 0 deletions
diff --git a/grub-core/osdep/basic/compress.c b/grub-core/osdep/basic/compress.c
new file mode 100644
index 0000000..9794640
--- /dev/null
+++ b/grub-core/osdep/basic/compress.c
@@ -0,0 +1,21 @@
+#include <config.h>
+#include <grub/util/install.h>
+#include <grub/util/misc.h>
+
+int
+grub_install_compress_gzip (const char *src, const char *dest)
+{
+ grub_util_error (_("no compression is available for your platform"));
+}
+
+int
+grub_install_compress_xz (const char *src, const char *dest)
+{
+ grub_util_error (_("no compression is available for your platform"));
+}
+
+int
+grub_install_compress_lzop (const char *src, const char *dest)
+{
+ grub_util_error (_("no compression is available for your platform"));
+}
diff --git a/grub-core/osdep/basic/emunet.c b/grub-core/osdep/basic/emunet.c
new file mode 100644
index 0000000..6362e5c
--- /dev/null
+++ b/grub-core/osdep/basic/emunet.c
@@ -0,0 +1,50 @@
+/*
+ * 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 <config.h>
+#include <config-util.h>
+
+#include <grub/i18n.h>
+#include <grub/emu/net.h>
+
+grub_ssize_t
+grub_emunet_send (const void *packet __attribute__ ((unused)),
+ grub_size_t sz __attribute__ ((unused)))
+{
+ return -1;
+}
+
+grub_ssize_t
+grub_emunet_receive (void *packet __attribute__ ((unused)),
+ grub_size_t sz __attribute__ ((unused)))
+{
+ return -1;
+}
+
+int
+grub_emunet_create (grub_size_t *mtu)
+{
+ *mtu = 1500;
+ return -1;
+}
+
+void
+grub_emunet_close (void)
+{
+ return;
+}
diff --git a/grub-core/osdep/basic/getroot.c b/grub-core/osdep/basic/getroot.c
new file mode 100644
index 0000000..8831eb3
--- /dev/null
+++ b/grub-core/osdep/basic/getroot.c
@@ -0,0 +1,82 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009,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 <config-util.h>
+#include <config.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <assert.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <dirent.h>
+#include <errno.h>
+#include <error.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <grub/types.h>
+
+#include <grub/util/misc.h>
+
+#include <grub/mm.h>
+#include <grub/misc.h>
+#include <grub/emu/misc.h>
+#include <grub/emu/hostdisk.h>
+#include <grub/emu/getroot.h>
+
+
+char *
+grub_util_part_to_disk (const char *os_dev,
+ struct stat *st __attribute__ ((unused)),
+ int *is_part)
+{
+ *is_part = 0;
+ return xstrdup (os_dev);
+}
+
+enum grub_dev_abstraction_types
+grub_util_get_dev_abstraction_os (const char *os_dev __attribute__((unused)))
+{
+ return GRUB_DEV_ABSTRACTION_NONE;
+}
+
+int
+grub_util_pull_device_os (const char *os_dev __attribute__ ((unused)),
+ enum grub_dev_abstraction_types ab __attribute__ ((unused)))
+{
+ return 0;
+}
+
+char *
+grub_util_get_grub_dev_os (const char *os_dev __attribute__ ((unused)))
+{
+ return NULL;
+}
+
+
+grub_disk_addr_t
+grub_util_find_partition_start_os (const char *dev __attribute__ ((unused)))
+{
+ return 0;
+}
diff --git a/grub-core/osdep/basic/hostdisk.c b/grub-core/osdep/basic/hostdisk.c
new file mode 100644
index 0000000..529bf29
--- /dev/null
+++ b/grub-core/osdep/basic/hostdisk.c
@@ -0,0 +1,58 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,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 <config-util.h>
+
+#include <grub/disk.h>
+#include <grub/partition.h>
+#include <grub/msdos_partition.h>
+#include <grub/types.h>
+#include <grub/err.h>
+#include <grub/emu/misc.h>
+#include <grub/emu/hostdisk.h>
+#include <grub/emu/getroot.h>
+#include <grub/misc.h>
+#include <grub/i18n.h>
+#include <grub/list.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+
+grub_int64_t
+grub_util_get_fd_size_os (grub_util_fd_t fd __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
+ unsigned *log_secsize __attribute__ ((unused)))
+{
+# warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal."
+
+ return -1;
+}
+
+void
+grub_hostdisk_flush_initial_buffer (const char *os_dev __attribute__ ((unused)))
+{
+}
diff --git a/grub-core/osdep/basic/init.c b/grub-core/osdep/basic/init.c
new file mode 100644
index 0000000..c54c710
--- /dev/null
+++ b/grub-core/osdep/basic/init.c
@@ -0,0 +1,38 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 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 <config.h>
+#include <config-util.h>
+
+#include <grub/util/misc.h>
+#include <grub/i18n.h>
+
+#include "progname.h"
+
+void
+grub_util_host_init (int *argc __attribute__ ((unused)),
+ char ***argv)
+{
+ set_program_name ((*argv)[0]);
+
+#if (defined (GRUB_UTIL) && defined(ENABLE_NLS) && ENABLE_NLS)
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+#endif /* (defined(ENABLE_NLS) && ENABLE_NLS) */
+}
diff --git a/grub-core/osdep/basic/no_platform.c b/grub-core/osdep/basic/no_platform.c
new file mode 100644
index 0000000..d76c34c
--- /dev/null
+++ b/grub-core/osdep/basic/no_platform.c
@@ -0,0 +1,46 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 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/types.h>
+#include <grub/emu/misc.h>
+#include <grub/util/install.h>
+#include <grub/util/misc.h>
+
+#include "platform.c"
+
+void
+grub_install_register_ieee1275 (int is_prep, const char *install_device,
+ int partno, const char *relpath)
+{
+ grub_util_error ("%s", _("no IEEE1275 routines are available for your platform"));
+}
+
+void
+grub_install_register_efi (grub_device_t efidir_grub_dev,
+ const char *efifile_path,
+ const char *efi_distributor)
+{
+ grub_util_error ("%s", _("no EFI routines are available for your platform"));
+}
+
+void
+grub_install_sgi_setup (const char *install_device,
+ const char *imgfile, const char *destname)
+{
+ grub_util_error ("%s", _("no SGI routines are available for your platform"));
+}
diff --git a/grub-core/osdep/basic/ofpath.c b/grub-core/osdep/basic/ofpath.c
new file mode 100644
index 0000000..c3fe06f
--- /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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/util/ofpath.h>
+#include <grub/mm.h>
+
+char *
+grub_util_devname_to_ofpath (const char *sys_devname __attribute__ ((unused)))
+{
+ return NULL;
+}
+
+
diff --git a/grub-core/osdep/basic/platform.c b/grub-core/osdep/basic/platform.c
new file mode 100644
index 0000000..a7dafd8
--- /dev/null
+++ b/grub-core/osdep/basic/platform.c
@@ -0,0 +1,32 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 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/util/install.h>
+
+const char *
+grub_install_get_default_arm_platform (void)
+{
+ return "arm-uboot";
+}
+
+const char *
+grub_install_get_default_x86_platform (void)
+{
+ return "i386-pc";
+}
+
diff --git a/grub-core/osdep/basic/random.c b/grub-core/osdep/basic/random.c
new file mode 100644
index 0000000..b5ccad4
--- /dev/null
+++ b/grub-core/osdep/basic/random.c
@@ -0,0 +1,43 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 1992-1999,2001,2003,2004,2005,2009,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 <config.h>
+
+#include <grub/types.h>
+#include <grub/crypto.h>
+#include <grub/auth.h>
+#include <grub/emu/misc.h>
+#include <grub/util/misc.h>
+#include <grub/i18n.h>
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+grub_get_random (void *out, grub_size_t len)
+{
+#warning "No random number generator is available for your OS. \
+Some functions like grub-mkpaswd and installing on UUID-less disks will be \
+disabled."
+ grub_util_error ("%s",
+ /* TRANSLATORS: The OS itself may very well have a random
+ number generator but GRUB doesn't know how to access it. */
+ _("no random number generator is available for your OS"));
+}