From 630b4c21114c831c2b6fb78bcdd35fdfd5218805 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Sat, 12 Nov 2011 17:03:53 +0000 Subject: [PATCH] Move gentoo MAKEDEV to /sbin in lvm2create_initrd. (James Le Cuirot) --- WHATS_NEW | 1 + scripts/lvm2create_initrd/lvm2create_initrd | 4 +- scripts/lvm2create_initrd/lvm2create_initrd.8 | 97 ++++++++++--------- .../lvm2create_initrd/lvm2create_initrd.pod | 10 +- 4 files changed, 61 insertions(+), 51 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 0ee727160..70a07d8b4 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Move gentoo MAKEDEV to /sbin in lvm2create_initrd. Add filter to avoid scan of device if it is part of active multipath. Add missing default $LVM_VG_NAME usage for snapshots. Fix extent_count overflow with lvextend. diff --git a/scripts/lvm2create_initrd/lvm2create_initrd b/scripts/lvm2create_initrd/lvm2create_initrd index 88261db5a..36034cf7c 100644 --- a/scripts/lvm2create_initrd/lvm2create_initrd +++ b/scripts/lvm2create_initrd/lvm2create_initrd @@ -74,7 +74,7 @@ usage () { echo " -e|--extra extra files to add to initrd" echo " -r|--raid raid devices to start in initrd" echo " -R|--raidconf location of mdadm.conf file to include" - echo " -M|--makedev set MAKEDEV type (debian or redhat)" + echo " -M|--makedev set MAKEDEV type (debian, redhat, gentoo)" } verbose () { @@ -379,7 +379,7 @@ redhat) RETCODE=$? ;; gentoo) - (cd $TMPMNT/dev; /usr/sbin/MAKEDEV $OPT_Q $BASICDEVICES $BLOCKDEVICES) + (cd $TMPMNT/dev; /sbin/MAKEDEV $OPT_Q $BASICDEVICES $BLOCKDEVICES) RETCODE=$? ;; *) diff --git a/scripts/lvm2create_initrd/lvm2create_initrd.8 b/scripts/lvm2create_initrd/lvm2create_initrd.8 index c9dae9f9e..47436780d 100644 --- a/scripts/lvm2create_initrd/lvm2create_initrd.8 +++ b/scripts/lvm2create_initrd/lvm2create_initrd.8 @@ -1,15 +1,7 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== -.de Sh \" Subsection heading -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp @@ -25,11 +17,11 @@ .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. | will give a -.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to -.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' -.\" expand to `' in nroff, nothing in troff, for use with C<>. -.tr \(*W-|\(bv\*(Tr +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- @@ -48,22 +40,25 @@ . ds R" '' 'br\} .\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" .\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. -.if \nF \{\ +.ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} -.\" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.hy 0 -.if n .na +.el \{\ +. de IX +.. +.\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -129,7 +124,11 @@ .\" ======================================================================== .\" .IX Title "lvm2create_initrd 8" -.TH lvm2create_initrd 8 "2004-06-05" "lvm2create_initrd" "create LVM2 initrd" +.TH lvm2create_initrd 8 "2011-11-12" "lvm2create_initrd" "create LVM2 initrd" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh .SH "NAME" lvm2create_initrd \- create initrd image for booting to root\e\-on\e\-LVM2 .SH "SYNOPSIS" @@ -145,10 +144,10 @@ either need a bootloader that understands \s-1LVM2\s0 volumes, or you'll need a filesystem on a regular volume to act as a boot partition (typically mounted on /boot). .PP -The resulting initrd image is fairly full\-featured. It can harbor and load +The resulting initrd image is fairly full-featured. It can harbor and load kernel modules, start \s-1MD\s0 devices, and boot to a shell to perform rescue operations. -.Sh "Booting to your initrd Image:" +.SS "Booting to your initrd Image:" .IX Subsection "Booting to your initrd Image:" The filesystem image created is an ext2fs filesystem, hence your kernel must have ext2fs built into it statically in order to boot to the image. @@ -189,7 +188,7 @@ Specify an lvm.conf file to include in the image. This is useful if you have special device filters or other options you wish to use during the initrd stage. If this option is not included, then a lvm.conf file is created that contains only the current -device filter from an \fBlvm dumpconfig\fR. This can also be set via the \fB$LVMCONF\fR +device filter from an \fBlvm dumpconfig\fR. This can also be set via the \fB\f(CB$LVMCONF\fB\fR environment variable. .ie n .IP "\fB\-m|\-\-modules\fR ""\fI/path/to/module1.ko /path/to/module2.ko ...\fR""" 4 .el .IP "\fB\-m|\-\-modules\fR ``\fI/path/to/module1.ko /path/to/module2.ko ...\fR''" 4 @@ -198,70 +197,80 @@ Specify modules to include and plug in during the initrd phase. This option takes a quoted, space-separated list of modules. Full pathnames are required. These modules are loaded into the kernel early in the initrd phase of the boot process. The current modprobe.conf file is also copied to the initrd image -as well. This can also be specified via the \fB$MODULES\fR environment variable. +as well. This can also be specified via the \fB\f(CB$MODULES\fB\fR environment variable. .ie n .IP "\fB\-e|\-\-extra\fR ""\fI/path/to/file1 /path/to/file2 ...\fR""" 4 .el .IP "\fB\-e|\-\-extra\fR ``\fI/path/to/file1 /path/to/file2 ...\fR''" 4 .IX Item "-e|--extra ""/path/to/file1 /path/to/file2 ...""" Extra files that should be included in the initrd image. These files will be copied to the same location in the initrd image that they are in the current filesystem. Again full pathnames are required. This can also be specified via -the \fB$EXTRAFILES\fR environment variable. +the \fB\f(CB$EXTRAFILES\fB\fR environment variable. .ie n .IP "\fB\-r|\-\-raid\fR ""\fI/dev/md1 /dev/md2...\fR""" 4 .el .IP "\fB\-r|\-\-raid\fR ``\fI/dev/md1 /dev/md2...\fR''" 4 .IX Item "-r|--raid ""/dev/md1 /dev/md2...""" \&\s-1RAID\s0 devices to be started prior to scanning for \s-1LVM2\s0 volume groups. If this option is used then then \fBmdadm\fR program must be installed. This can also be -specified via the \fB$RAID\fR environment variable. +specified via the \fB\f(CB$RAID\fB\fR environment variable. .ie n .IP "\fB\-R|\-\-raidconf\fR ""\fI/path/to/mdadm.conf\fR""" 4 .el .IP "\fB\-R|\-\-raidconf\fR ``\fI/path/to/mdadm.conf\fR''" 4 .IX Item "-R|--raidconf ""/path/to/mdadm.conf""" Location of a mdadm.conf file to include. If this is not specified, then no files are included, and any devices specified with the \fB\-r\fR option above must have minor numbers that match their superblock values. This can also be -specified via the \fB$RAIDCONF\fR environment variable. +specified via the \fB\f(CB$RAIDCONF\fB\fR environment variable. .IP "\fB\-M|\-\-makedev\fR \fIstyle\fR" 4 .IX Item "-M|--makedev style" -Set \s-1MAKEDEV\s0 invocation style. The script currently supports 2 styles of -\&\s-1MAKEDEV\s0 programs \fIdebian\fR and \fIredhat\fR. The default is \fIdebian\fR. Set -to \fIredhat\fR if using the RedHat/Fedora binary \s-1MAKEDEV\s0 program. Please send -a bug report to maintainer if your distrib doesn't work with any of the -current options. +Set \s-1MAKEDEV\s0 invocation style. The script currently supports 3 styles of +\&\s-1MAKEDEV\s0 programs \fIdebian\fR, \fIredhat\fR and \fIgentoo\fR. The default is \fIdebian\fR. +Set to \fIredhat\fR if using the RedHat/Fedora binary \s-1MAKEDEV\s0 program. \fIgentoo\fR +has the same binary but in /sbin instead of /dev. Please send a bug report to +maintainer if your distribution doesn't work with any of the current options. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" Most of the options to this script can be set via environment variables. In situations where both are set, then the command-line options take precedence. -.IP "\fB$LVMCONF\fR" 4 +.ie n .IP "\fB\fB$LVMCONF\fB\fR" 4 +.el .IP "\fB\f(CB$LVMCONF\fB\fR" 4 .IX Item "$LVMCONF" Same as \-c option. -.IP "\fB$MODULES\fR" 4 +.ie n .IP "\fB\fB$MODULES\fB\fR" 4 +.el .IP "\fB\f(CB$MODULES\fB\fR" 4 .IX Item "$MODULES" Same as \-m option. -.IP "\fB$EXTRAFILES\fR" 4 +.ie n .IP "\fB\fB$EXTRAFILES\fB\fR" 4 +.el .IP "\fB\f(CB$EXTRAFILES\fB\fR" 4 .IX Item "$EXTRAFILES" Same as \-e option. -.IP "\fB$RAID\fR" 4 +.ie n .IP "\fB\fB$RAID\fB\fR" 4 +.el .IP "\fB\f(CB$RAID\fB\fR" 4 .IX Item "$RAID" Same as \-r option. -.IP "\fB$RAIDCONF\fR" 4 +.ie n .IP "\fB\fB$RAIDCONF\fB\fR" 4 +.el .IP "\fB\f(CB$RAIDCONF\fB\fR" 4 .IX Item "$RAIDCONF" Same as \-R option. -.IP "\fB$MAKEDEV\fR" 4 +.ie n .IP "\fB\fB$MAKEDEV\fB\fR" 4 +.el .IP "\fB\f(CB$MAKEDEV\fB\fR" 4 .IX Item "$MAKEDEV" Same as \-M option. -.IP "\fB$BASICDEVICES\fR" 4 +.ie n .IP "\fB\fB$BASICDEVICES\fB\fR" 4 +.el .IP "\fB\f(CB$BASICDEVICES\fB\fR" 4 .IX Item "$BASICDEVICES" Overrides the default value of \f(CW$BASICDEVICES\fR in the script (which is \*(L"std consoleonly fd\*(R"). These values are passed to the \fB\s-1MAKEDEV\s0\fR program to create device entries in the initrd image. -.IP "\fB$BLOCKDEVICES\fR" 4 +.ie n .IP "\fB\fB$BLOCKDEVICES\fB\fR" 4 +.el .IP "\fB\f(CB$BLOCKDEVICES\fB\fR" 4 .IX Item "$BLOCKDEVICES" Overrides the default value of \f(CW$BLOCKDEVICES\fR in the script (which is \*(L"md hda hdb hdc hdd sda sdb sdc sdd\*(R"). This value is passed to the \fB\s-1MAKEDEV\s0\fR program to create device entries in the initrd image. -.IP "\fB$BINFILES\fR" 4 +.ie n .IP "\fB\fB$BINFILES\fB\fR" 4 +.el .IP "\fB\f(CB$BINFILES\fB\fR" 4 .IX Item "$BINFILES" Overrides the default value of \f(CW$BINFILES\fR (which is \*(L"/lib/lvm\-200/lvm /bin/bash /bin/busybox /sbin/pivot_root\*(R"). The difference between using this and adding a file to the \f(CW$EXTRAFILES\fR list above is that libraries that these depend upon are also included. You can still use \f(CW$EXTRAFILES\fR to achieve the same effect, but you must resolve library dependencies youself. -.IP "\fB$INITRDSIZE\fR" 4 +.ie n .IP "\fB\fB$INITRDSIZE\fB\fR" 4 +.el .IP "\fB\f(CB$INITRDSIZE\fB\fR" 4 .IX Item "$INITRDSIZE" Force a particular size for your initrd image. The default is to total up the size of the included files and to add 512K as a buffer. diff --git a/scripts/lvm2create_initrd/lvm2create_initrd.pod b/scripts/lvm2create_initrd/lvm2create_initrd.pod index 577930f80..b25de62ac 100644 --- a/scripts/lvm2create_initrd/lvm2create_initrd.pod +++ b/scripts/lvm2create_initrd/lvm2create_initrd.pod @@ -107,11 +107,11 @@ specified via the B<$RAIDCONF> environment variable. =item B<-M|--makedev> I