View | Details | Raw Unified | Return to bug 19388
Collapse All | Expand All

(-)mkinitrd.orig (-1 / +48 lines)
Lines 182-187 Link Here
182
loopFile=
182
loopFile=
183
uname_r=`uname -r`
183
uname_r=`uname -r`
184
184
185
# LVM constants
186
HAVE_LVM=
187
LVM_MODNAME="dm-mod"
188
LVM=/sbin/lvm.static
189
[ -x "$LVM" ] || LVM=
190
185
ParseKernelVersion()
191
ParseKernelVersion()
186
{
192
{
187
	KERNEL_MAJOR="${KERNEL%%.*}"
193
	KERNEL_MAJOR="${KERNEL%%.*}"
Lines 953-958 Link Here
953
		sed -e 's/^raid\([0-9]*\)$/\1/'
959
		sed -e 's/^raid\([0-9]*\)$/\1/'
954
}
960
}
955
961
962
FindLVMModules()
963
{
964
	if [ -n "$HAVE_LVM" ]; then
965
		FindModule $LVM_MODNAME 
966
	fi 
967
}
968
956
FindRaidModules()
969
FindRaidModules()
957
{
970
{
958
	[ -z "$noraid" ] || return
971
	[ -z "$noraid" ] || return
Lines 1085-1090 Link Here
1085
	done
1098
	done
1086
}
1099
}
1087
1100
1101
ConfigInitramfsForLVM()
1102
{
1103
# this is creating of script for init of LVM
1104
	cat >>"$MNTDIR"/scripts/local-top <<'EOF'
1105
# Preparing LVM			-*- shell-script -*-
1106
1107
log_begin_msg "Starting up LVM"
1108
1109
vgscan
1110
vgchange -ay
1111
1112
log_end_msg
1113
EOF
1114
1115
}
1116
1088
ConfigInitramfsForRaid()
1117
ConfigInitramfsForRaid()
1089
{
1118
{
1090
	# /scripts/local-top runs before swsusp resume - start RAID in
1119
	# /scripts/local-top runs before swsusp resume - start RAID in
Lines 1181-1186 Link Here
1181
			Cp -aL "$f" "$MNTDIR"/etc/udev/rules.d/
1210
			Cp -aL "$f" "$MNTDIR"/etc/udev/rules.d/
1182
		done
1211
		done
1183
	fi
1212
	fi
1213
	
1214
	if [ -n "$HAVE_LVM" ]; then
1215
		if [ -z $LVM ]; then 
1216
			Fatal "Couldn't find executable lvm.static " 
1217
		fi
1218
		Cp -aL "$LVM" "$MNTDIR"/sbin/
1219
		cd "$MNTDIR"/sbin/
1220
		Ln -s lvm.static vgscan
1221
		Ln -s lvm.static vgchange
1222
		ConfigInitramfsForLVM
1223
	fi
1184
1224
1185
	if [ -n "$HAVE_RAID" ]; then
1225
	if [ -n "$HAVE_RAID" ]; then
1186
		ConfigInitramfsForRaid
1226
		ConfigInitramfsForRaid
Lines 1322-1327 Link Here
1322
--with MODULES                  load MODULES after all found automatically.
1362
--with MODULES                  load MODULES after all found automatically.
1323
--extra MODULES                 add MODULES to be loaded only if needed.
1363
--extra MODULES                 add MODULES to be loaded only if needed.
1324
--with-raid                     enable software RAID (md) support.
1364
--with-raid                     enable software RAID (md) support.
1365
--with-lvm			enable LVM support.
1325
--omit-scsi-modules             do not load any SCSI modules.
1366
--omit-scsi-modules             do not load any SCSI modules.
1326
--omit-ide-modules              do not load any IDE modules.
1367
--omit-ide-modules              do not load any IDE modules.
1327
--omit-raid-modules             do not load any raid modules.
1368
--omit-raid-modules             do not load any raid modules.
Lines 1344-1350 Link Here
1344
	[ -n "$1" ] && Exit "$1" || Exit
1385
	[ -n "$1" ] && Exit "$1" || Exit
1345
}
1386
}
1346
1387
1347
TEMP=`getopt -n "$PROG" -o a:fhvd -l help,version,verbose,debug,force,ifneeded,omit-scsi-modules,omit-ide-modules,omit-raid-modules,with-raid,pause,image-version,nocompress,nobootsplash,strict,fstab:,before:,preload:,with:,after:,extra:,type:,add: -- "$@"` || Usage 1
1388
TEMP=`getopt -n "$PROG" -o a:fhvd -l help,version,verbose,debug,force,ifneeded,omit-scsi-modules,omit-ide-modules,omit-raid-modules,with-raid,with-lvm,pause,image-version,nocompress,nobootsplash,strict,fstab:,before:,preload:,with:,after:,extra:,type:,add: -- "$@"` || Usage 1
1348
eval set -- "$TEMP"
1389
eval set -- "$TEMP"
1349
1390
1350
img_vers=
1391
img_vers=
Lines 1417-1422 Link Here
1417
			HAVE_RAID=1
1458
			HAVE_RAID=1
1418
			shift
1459
			shift
1419
			;;
1460
			;;
1461
		--with-lvm)
1462
			HAVE_LVM=1
1463
			shift
1464
			;;
1420
		--pause)
1465
		--pause)
1421
			pause=1
1466
			pause=1
1422
			shift
1467
			shift
Lines 1531-1536 Link Here
1531
1576
1532
FindRaidModules
1577
FindRaidModules
1533
1578
1579
FindLVMModules
1580
1534
FindRootModules
1581
FindRootModules
1535
1582
1536
FindLoopModules
1583
FindLoopModules

Return to bug 19388