~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to grub-core/kern/fs.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include <grub/types.h>
27
27
#include <grub/mm.h>
28
28
#include <grub/term.h>
 
29
#include <grub/i18n.h>
29
30
 
30
31
grub_fs_t grub_fs_list = 0;
31
32
 
52
53
      for (p = grub_fs_list; p; p = p->next)
53
54
        {
54
55
          grub_dprintf ("fs", "Detecting %s...\n", p->name);
55
 
          (p->dir) (device, "/", dummy_func);
 
56
 
 
57
          /* This is evil: newly-created just mounted BtrFS after copying all
 
58
             GRUB files has a very peculiar unrecoverable corruption which
 
59
             will be fixed at sync but we'd rather not do a global sync and
 
60
             syncing just files doesn't seem to help. Relax the check for
 
61
             this time.  */
 
62
#ifdef GRUB_UTIL
 
63
          if (grub_strcmp (p->name, "btrfs") == 0)
 
64
            {
 
65
              char *label = 0;
 
66
              p->uuid (device, &label);
 
67
              if (label)
 
68
                grub_free (label);
 
69
            }
 
70
          else
 
71
#endif
 
72
            (p->dir) (device, "/", dummy_func);
56
73
          if (grub_errno == GRUB_ERR_NONE)
57
74
            return p;
58
75
 
60
77
          grub_dprintf ("fs", "%s detection failed.\n", p->name);
61
78
          grub_error_pop ();
62
79
 
63
 
          if (grub_errno != GRUB_ERR_BAD_FS)
 
80
          if (grub_errno != GRUB_ERR_BAD_FS
 
81
              && grub_errno != GRUB_ERR_OUT_OF_RANGE)
64
82
            return 0;
65
83
 
66
84
          grub_errno = GRUB_ERR_NONE;
82
100
                  return p;
83
101
                }
84
102
 
85
 
              if (grub_errno != GRUB_ERR_BAD_FS)
 
103
              if (grub_errno != GRUB_ERR_BAD_FS
 
104
                  && grub_errno != GRUB_ERR_OUT_OF_RANGE)
86
105
                {
87
106
                  count--;
88
107
                  return 0;
94
113
          count--;
95
114
        }
96
115
    }
97
 
  else if (device->net->fs)
 
116
  else if (device->net && device->net->fs)
98
117
    return device->net->fs;
99
118
 
100
 
  grub_error (GRUB_ERR_UNKNOWN_FS, "unknown filesystem");
 
119
  grub_error (GRUB_ERR_UNKNOWN_FS, N_("unknown filesystem"));
101
120
  return 0;
102
121
}
103
122
 
145
164
          if (grub_errno != GRUB_ERR_NONE || *p != '+')
146
165
            {
147
166
              grub_error (GRUB_ERR_BAD_FILENAME,
148
 
                          "invalid file name `%s'", name);
 
167
                          N_("invalid file name `%s'"), name);
149
168
              goto fail;
150
169
            }
151
170
        }
157
176
          || (*p && *p != ',' && ! grub_isspace (*p)))
158
177
        {
159
178
          grub_error (GRUB_ERR_BAD_FILENAME,
160
 
                      "invalid file name `%s'", name);
 
179
                      N_("invalid file name `%s'"), name);
161
180
          goto fail;
162
181
        }
163
182