~ubuntu-branches/ubuntu/precise/util-linux/precise-proposed

« back to all changes in this revision

Viewing changes to disk-utils/blockdev.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-06-20 22:31:50 UTC
  • mfrom: (1.6.3 upstream) (4.5.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110620223150-lz8wrv0946ihcz3z
Tags: 2.19.1-2ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build for multiarch.
  - Add pre-depends on multiarch-support.
  - configure.ac: don't try to be clever about extracting a path name from
    $libdir to append to /usr in a way that's not overridable; instead,
    reuse the built-in configurable libexecdir.
  - Fix up the .pc.in files to know about libexecdir, so our substitutions
    don't leave us with unusable pkg-config files.
  - Install custom blkid.conf to use /dev/.blkid.tab since we don't
    expect device names to survive a reboot
  - Mention mountall(8) in fstab(5) manpages, along with its special
    options.
  - Since upstart is required in Ubuntu, the hwclock.sh init script is not
    called on startup and the hwclockfirst.sh init script is removed.
  - Drop depends on initscripts for the above.
  - Replace hwclock udev rule with an Upstart job.
  - For the case where mount is called with a directory to mount, look
    that directory up in mountall's /lib/init/fstab if we couldn't find
    it mentioned anywhere else.  This means "mount /proc", "mount /sys",
    etc. work.
  - mount.8 points to the cifs-utils package, not the obsolete smbfs one. 
* Dropped changes:
  - mount.preinst: lsb_release has been fixed in lucid and above to be
    usable without configuration, so we don't have to diverge from Debian
    here anymore.
* Changes merged upstream:
  - sfdisk support for '+' with '-N'
  - mount/umount.c: fix a segfault on umount with empty mtab entry
  - Fix arbitrary unmount with fuse security issue

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
                .argval = -1,
76
76
                .help = N_("get read-only")
77
77
        },{
 
78
                IOCTL_ENTRY(BLKDISCARDZEROES),
 
79
                .name = "--getdiscardzeroes",
 
80
                .argtype = ARG_UINT,
 
81
                .argval = -1,
 
82
                .help = N_("get discard zeroes support status")
 
83
        },{
78
84
                IOCTL_ENTRY(BLKSSZGET),
79
85
                .name = "--getss",
80
86
                .argtype = ARG_INT,
103
109
                .name = "--getalignoff",
104
110
                .argtype = ARG_INT,
105
111
                .argval = -1,
106
 
                .help = N_("get alignment offset")
 
112
                .help = N_("get alignment offset in bytes")
107
113
        },{
108
114
                IOCTL_ENTRY(BLKSECTGET),
109
115
                .name = "--getmaxsect",
119
125
        },{
120
126
                IOCTL_ENTRY(BLKBSZSET),
121
127
                .name = "--setbsz",
122
 
                .argname = "BLOCKSIZE",
 
128
                .argname = "<bytes>",
123
129
                .argtype = ARG_INT,
124
130
                .flags = FL_NORESULT,
125
131
                .help = N_("set blocksize")
128
134
                .name = "--getsize",
129
135
                .argtype = ARG_ULONG,
130
136
                .argval = -1,
131
 
                .help = N_("get 32-bit sector count")
 
137
                .help = N_("get 32-bit sector count (deprecated, use --getsz)")
132
138
        },{
133
139
                IOCTL_ENTRY(BLKGETSIZE64),
134
140
                .name = "--getsize64",
138
144
        },{
139
145
                IOCTL_ENTRY(BLKRASET),
140
146
                .name = "--setra",
141
 
                .argname = "READAHEAD",
 
147
                .argname = "<sectors>",
142
148
                .argtype = ARG_INT,
143
149
                .flags = FL_NOPTR | FL_NORESULT,
144
150
                .help = N_("set readahead")
151
157
        },{
152
158
                IOCTL_ENTRY(BLKFRASET),
153
159
                .name = "--setfra",
154
 
                .argname = "FSREADAHEAD",
 
160
                .argname = "<sectors>",
155
161
                .argtype = ARG_INT,
156
162
                .flags = FL_NOPTR | FL_NORESULT,
157
163
                .help = N_("set filesystem readahead")
177
183
        int i;
178
184
        fputc('\n', stderr);
179
185
        fprintf(stderr, _("Usage:\n"));
180
 
        fprintf(stderr, "  %s -V\n", progname);
 
186
        fprintf(stderr, _("  %s -V\n"), progname);
181
187
        fprintf(stderr, _("  %s --report [devices]\n"), progname);
182
188
        fprintf(stderr, _("  %s [-v|-q] commands devices\n"), progname);
183
189
        fputc('\n', stderr);
184
190
 
185
191
        fprintf(stderr, _("Available commands:\n"));
186
 
        fprintf(stderr, "\t%-30s %s\n", "--getsz",
 
192
        fprintf(stderr, "  %-25s %s\n", "--getsz",
187
193
                        _("get size in 512-byte sectors"));
188
194
        for (i = 0; i < ARRAY_SIZE(bdcms); i++) {
189
195
                if (bdcms[i].argname)
190
 
                        fprintf(stderr, "\t%s %-*s %s\n", bdcms[i].name,
191
 
                                        (int) (29 - strlen(bdcms[i].name)),
 
196
                        fprintf(stderr, "  %s %-*s %s\n", bdcms[i].name,
 
197
                                        (int) (24 - strlen(bdcms[i].name)),
192
198
                                        bdcms[i].argname, _(bdcms[i].help));
193
199
                else
194
 
                        fprintf(stderr, "\t%-30s %s\n", bdcms[i].name,
 
200
                        fprintf(stderr, "  %-25s %s\n", bdcms[i].name,
195
201
                                        _(bdcms[i].help));
196
202
        }
197
203
        fputc('\n', stderr);
235
241
 
236
242
        /* -V not together with commands */
237
243
        if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
238
 
                printf("%s (%s)\n", progname, PACKAGE_STRING);
 
244
                printf(_("%s (%s)\n"), progname, PACKAGE_STRING);
239
245
                exit(0);
240
246
        }
241
247