~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to util/grub-probe.c

ImportĀ upstreamĀ versionĀ 1.97~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <grub/file.h>
26
26
#include <grub/fs.h>
27
27
#include <grub/partition.h>
28
 
#include <grub/pc_partition.h>
 
28
#include <grub/msdos_partition.h>
29
29
#include <grub/util/hostdisk.h>
30
30
#include <grub/util/getroot.h>
31
31
#include <grub/term.h>
79
79
static void
80
80
probe_partmap (grub_disk_t disk)
81
81
{
82
 
  char *name;
83
 
  char *underscore;
84
 
 
85
82
  if (disk->partition == NULL)
86
83
    {
87
84
      grub_util_info ("No partition map found for %s", disk->name);
88
85
      return;
89
86
    }
90
87
 
91
 
  name = strdup (disk->partition->partmap->name);
92
 
  if (! name)
93
 
    grub_util_error ("Not enough memory");
94
 
 
95
 
  underscore = strchr (name, '_');
96
 
  if (! underscore)
97
 
    grub_util_error ("Invalid partition map %s", name);
98
 
 
99
 
  *underscore = '\0';
100
 
  printf ("%s\n", name);
101
 
  free (name);
 
88
  printf ("%s\n", disk->partition->partmap->name);
102
89
}
103
90
 
104
91
static int
248
235
 
249
236
  if (print == PRINT_FS)
250
237
    {
 
238
      /* FIXME: `path' can't be used to read a file via GRUB facilities,
 
239
         because it's not relative to its root.  */
 
240
#if 0
251
241
      struct stat st;
252
242
 
253
243
      stat (path, &st);
254
244
 
255
 
      if (st.st_mode == S_IFREG)
 
245
      if (S_ISREG (st.st_mode))
256
246
        {
257
247
          /* Regular file.  Verify that we can read it properly.  */
258
248
 
271
261
          if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
272
262
            grub_util_error ("files differ");
273
263
        }
 
264
#endif
 
265
 
274
266
      printf ("%s\n", fs->name);
275
267
    }
276
268