Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 122421 | Differences between
and this patch

Collapse All | Expand All

(-)genkernel-3.3.10/gen_cmdline.sh (+6 lines)
Lines 56-95 Link Here
56
  echo "	--utils-as=<assembler>	Assembler to use for utils"
56
  echo "	--utils-as=<assembler>	Assembler to use for utils"
57
  echo "	--utils-ld=<linker>	Linker to use for utils"
57
  echo "	--utils-ld=<linker>	Linker to use for utils"
58
  echo "	--utils-make=<makeprog>	GNU Make to use for utils"
58
  echo "	--utils-make=<makeprog>	GNU Make to use for utils"
59
  echo "	--makeopts=<makeopts>	Make options such as -j2, etc..."
59
  echo "	--makeopts=<makeopts>	Make options such as -j2, etc..."
60
  echo "	--mountboot		Mount /boot automatically"
60
  echo "	--mountboot		Mount /boot automatically"
61
  echo "	--no-mountboot		Don't mount /boot automatically"  
61
  echo "	--no-mountboot		Don't mount /boot automatically"  
62
  echo "  Initialization"
62
  echo "  Initialization"
63
  echo "	--bootsplash=<theme>	Force bootsplash using <theme>"
63
  echo "	--bootsplash=<theme>	Force bootsplash using <theme>"
64
  echo "	--gensplash=<theme>	Force gensplash using <theme>"
64
  echo "	--gensplash=<theme>	Force gensplash using <theme>"
65
  echo "	--gensplash-res=<res>	Select gensplash resolutions"
65
  echo "	--gensplash-res=<res>	Select gensplash resolutions"
66
  echo "	--do-keymap-auto	Forces keymap selection at boot"
66
  echo "	--do-keymap-auto	Forces keymap selection at boot"
67
  echo "	--evms2			Include EVMS2 support"
67
  echo "	--evms2			Include EVMS2 support"
68
  echo "				--> 'emerge evms' in the host operating system first"
68
  echo "				--> 'emerge evms' in the host operating system first"
69
  echo "	--lvm2			Include LVM2 support"
69
  echo "	--lvm2			Include LVM2 support"
70
#  echo "	--unionfs		Include UNIONFS support"
70
#  echo "	--unionfs		Include UNIONFS support"
71
  echo "	--dmraid		Include DMRAID support"
71
  echo "	--dmraid		Include DMRAID support"
72
  echo "	--bladecenter	Enables extra pauses for IBM Bladecenter CD boots"
72
  echo "	--bladecenter	Enables extra pauses for IBM Bladecenter CD boots"
73
  echo "	--bootloader=grub	Add new kernel to GRUB configuration"
73
  echo "	--bootloader=grub	Add new kernel to GRUB configuration"
74
  echo "	--linuxrc=<file>	Specifies a user created linuxrc"
74
  echo "	--linuxrc=<file>	Specifies a user created linuxrc"
75
  echo "	--disklabel	        Include disk label and uuid support in your initrd"
75
  echo "	--disklabel	        Include disk label and uuid support in your initrd"
76
  echo "	--luks                  Include LUKS support"
77
  echo "				--> 'emerge cryptsetup-luks with -dynamic first"
76
  echo "  Internals"
78
  echo "  Internals"
77
  echo "	--arch-override=<arch>	Force to arch instead of autodetect"
79
  echo "	--arch-override=<arch>	Force to arch instead of autodetect"
78
  echo "	--cachedir=<dir>	Override the default cache location"
80
  echo "	--cachedir=<dir>	Override the default cache location"
79
  echo "	--tempdir=<dir>		Location of Genkernel's temporary directory"
81
  echo "	--tempdir=<dir>		Location of Genkernel's temporary directory"
80
  echo "	--postclear		Clear all tmp files and caches after genkernel has run"
82
  echo "	--postclear		Clear all tmp files and caches after genkernel has run"
81
  echo "  Output Settings"
83
  echo "  Output Settings"
82
  echo "        --kernname=<...> 	Tag the kernel and initrd with a name:"
84
  echo "        --kernname=<...> 	Tag the kernel and initrd with a name:"
83
  echo "        	 		If not defined the option defaults to 'genkernel'"
85
  echo "        	 		If not defined the option defaults to 'genkernel'"
84
  echo "        --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
86
  echo "        --minkernpackage=<tbz2> File to output a .tar.bz2'd kernel and initrd:"
85
  echo "                                No modules outside of the initrd will be"
87
  echo "                                No modules outside of the initrd will be"
86
  echo "                                included..."
88
  echo "                                included..."
87
  echo "        --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the callbacks have run"
89
  echo "        --modulespackage=<tbz2> File to output a .tar.bz2'd modules after the callbacks have run"
88
  echo "        --kerncache=<tbz2> 	File to output a .tar.bz2'd kernel,"
90
  echo "        --kerncache=<tbz2> 	File to output a .tar.bz2'd kernel,"
89
  echo "                                contents of /lib/modules/ and the kernel config"
91
  echo "                                contents of /lib/modules/ and the kernel config"
90
  echo "                                NOTE: This is created before the callbacks are run!"
92
  echo "                                NOTE: This is created before the callbacks are run!"
91
  echo "        --no-kernel-sources	This option is only valid if kerncache is defined"
93
  echo "        --no-kernel-sources	This option is only valid if kerncache is defined"
92
  echo "        			If there is a valid kerncache no checks will be made"
94
  echo "        			If there is a valid kerncache no checks will be made"
93
  echo "        			against a kernel source tree"
95
  echo "        			against a kernel source tree"
94
  echo "        --initramfs-overlay=<dir>"
96
  echo "        --initramfs-overlay=<dir>"
95
  echo "        			Directory structure to include in the initramfs,"
97
  echo "        			Directory structure to include in the initramfs,"
Lines 421-460 Link Here
421
		      print_info 2 "CMD_NO_KERNEL_SOURCES: $CMD_NO_KERNEL_SOURCES"
423
		      print_info 2 "CMD_NO_KERNEL_SOURCES: $CMD_NO_KERNEL_SOURCES"
422
	      ;;
424
	      ;;
423
	      --initramfs-overlay=*)
425
	      --initramfs-overlay=*)
424
		      CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
426
		      CMD_INITRAMFS_OVERLAY=`parse_opt "$*"`
425
		      print_info 2 "CMD_INITRAMFS_OVERLAY: $CMD_INITRAMFS_OVERLAY"
427
		      print_info 2 "CMD_INITRAMFS_OVERLAY: $CMD_INITRAMFS_OVERLAY"
426
	      ;;
428
	      ;;
427
	      --linuxrc=*)
429
	      --linuxrc=*)
428
	      		CMD_LINUXRC=`parse_opt "$*"`
430
	      		CMD_LINUXRC=`parse_opt "$*"`
429
			print_info 2 "CMD_LINUXRC: $CMD_LINUXRC"
431
			print_info 2 "CMD_LINUXRC: $CMD_LINUXRC"
430
	      ;;
432
	      ;;
431
              --genzimage)
433
              --genzimage)
432
			KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
434
			KERNEL_MAKE_DIRECTIVE_2='zImage.initrd'
433
			KERNEL_BINARY_2='arch/ppc/boot/images/zImage.initrd.chrp'
435
			KERNEL_BINARY_2='arch/ppc/boot/images/zImage.initrd.chrp'
434
			GENERATE_Z_IMAGE=1
436
			GENERATE_Z_IMAGE=1
435
			print_info 2 "GENERATE_Z_IMAGE: $GENERATE_Z_IMAGE"
437
			print_info 2 "GENERATE_Z_IMAGE: $GENERATE_Z_IMAGE"
436
	      ;;
438
	      ;;
437
	      --disklabel)
439
	      --disklabel)
438
		      CMD_DISKLABEL=1
440
		      CMD_DISKLABEL=1
439
		      print_info 2 "CMD_DISKLABEL: $CMD_DISKLABEL"
441
		      print_info 2 "CMD_DISKLABEL: $CMD_DISKLABEL"
440
	      ;;
442
	      ;;
443
	      --luks)
444
		      CMD_LUKS=1
445
		      print_info 2 "CMD_LUKS: $CMD_LUKS"
446
	      ;;
441
	      all)
447
	      all)
442
		      BUILD_KERNEL=1
448
		      BUILD_KERNEL=1
443
		      BUILD_MODULES=1
449
		      BUILD_MODULES=1
444
		      BUILD_INITRD=1
450
		      BUILD_INITRD=1
445
	      ;;
451
	      ;;
446
	      initrd)
452
	      initrd)
447
		      BUILD_INITRD=1
453
		      BUILD_INITRD=1
448
	      ;;
454
	      ;;
449
	      kernel)
455
	      kernel)
450
		      BUILD_KERNEL=1
456
		      BUILD_KERNEL=1
451
		      BUILD_MODULES=1
457
		      BUILD_MODULES=1
452
		      BUILD_INITRD=0
458
		      BUILD_INITRD=0
453
	      ;;
459
	      ;;
454
	      bzImage)
460
	      bzImage)
455
		      BUILD_KERNEL=1
461
		      BUILD_KERNEL=1
456
		      BUILD_MODULES=0
462
		      BUILD_MODULES=0
457
		      BUILD_INITRD=1
463
		      BUILD_INITRD=1
458
		      CMD_NOINITRDMODULES=1
464
		      CMD_NOINITRDMODULES=1
459
		      print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
465
		      print_info 2 "CMD_NOINITRDMODULES: $CMD_NOINITRDMODULES"
460
	      ;;
466
	      ;;
(-)genkernel-3.3.10/gen_determineargs.sh (+5 lines)
Lines 43-82 Link Here
43
				UTS_RELEASE=`grep UTS_RELEASE ${KERNEL_DIR}/include/linux/version.h | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
43
				UTS_RELEASE=`grep UTS_RELEASE ${KERNEL_DIR}/include/linux/version.h | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
44
				LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
44
				LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
45
				KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
45
				KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
46
			else
46
			else
47
				LCV=`grep ^CONFIG_LOCALVERSION= ${KERNEL_DIR}/.config | sed -r -e "s/.*=\"(.*)\"/\1/"`
47
				LCV=`grep ^CONFIG_LOCALVERSION= ${KERNEL_DIR}/.config | sed -r -e "s/.*=\"(.*)\"/\1/"`
48
				KV=${VER}.${PAT}.${SUB}${EXV}${LCV}
48
				KV=${VER}.${PAT}.${SUB}${EXV}${LCV}
49
			fi
49
			fi
50
		else
50
		else
51
			KERN_24=1
51
			KERN_24=1
52
			KV=${VER}.${PAT}.${SUB}${EXV}
52
			KV=${VER}.${PAT}.${SUB}${EXV}
53
		fi
53
		fi
54
54
55
	fi
55
	fi
56
56
57
	if isTrue "${CMD_DISKLABEL}"
57
	if isTrue "${CMD_DISKLABEL}"
58
	then
58
	then
59
		DISKLABEL=1
59
		DISKLABEL=1
60
	else
60
	else
61
		DISKLABEL=0
61
		DISKLABEL=0
62
	fi
62
	fi
63
64
	if isTrue "${CMD_LUKS}"
65
	then
66
		LUKS=1
67
	fi
63
}
68
}
64
69
65
determine_real_args() {
70
determine_real_args() {
66
	if [ "${CMD_DEBUGFILE}" != '' ]
71
	if [ "${CMD_DEBUGFILE}" != '' ]
67
	then
72
	then
68
		DEBUGFILE="${CMD_DEBUGFILE}"
73
		DEBUGFILE="${CMD_DEBUGFILE}"
69
	fi
74
	fi
70
75
71
	if [ "${CMD_MAKEOPTS}" != '' ]
76
	if [ "${CMD_MAKEOPTS}" != '' ]
72
	then
77
	then
73
		MAKEOPTS="${CMD_MAKEOPTS}"
78
		MAKEOPTS="${CMD_MAKEOPTS}"
74
	fi
79
	fi
75
80
76
	if [ "${CMD_KERNELDIR}" != '' ]
81
	if [ "${CMD_KERNELDIR}" != '' ]
77
	then
82
	then
78
		KERNEL_DIR=${CMD_KERNELDIR}
83
		KERNEL_DIR=${CMD_KERNELDIR}
79
	else
84
	else
80
		KERNEL_DIR=${DEFAULT_KERNEL_SOURCE}
85
		KERNEL_DIR=${DEFAULT_KERNEL_SOURCE}
81
	fi
86
	fi
82
	
87
	
(-)genkernel-3.3.10/gen_initramfs.sh (+12 lines)
Lines 406-445 Link Here
406
		echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
406
		echo -n "${group} " >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
407
	done
407
	done
408
	echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"	
408
	echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"	
409
409
410
	if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
410
	if [ -f "${GK_SHARE}/${ARCH}/modprobe" ]
411
	then
411
	then
412
		cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
412
		cp "${GK_SHARE}/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
413
	else
413
	else
414
		cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
414
		cp "${GK_SHARE}/generic/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe"
415
	fi
415
	fi
416
	if isTrue $CMD_DOKEYMAPAUTO
416
	if isTrue $CMD_DOKEYMAPAUTO
417
	then
417
	then
418
		echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
418
		echo 'MY_HWOPTS="${MY_HWOPTS} keymap"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
419
	fi
419
	fi
420
	mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps"
420
	mkdir -p "${TEMP}/initramfs-aux-temp/lib/keymaps"
421
	/bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz"
421
	/bin/tar -C "${TEMP}/initramfs-aux-temp/lib/keymaps" -zxf "${GK_SHARE}/generic/keymaps.tar.gz"
422
	if isTrue $CMD_BLADECENTER
422
	if isTrue $CMD_BLADECENTER
423
	then
423
	then
424
		echo 'MY_HWOPTS="${MY_HWOPTS} bladecenter"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
424
		echo 'MY_HWOPTS="${MY_HWOPTS} bladecenter"' >> ${TEMP}/initramfs-aux-temp/etc/initrd.defaults
425
	fi
425
	fi
426
	
427
	#LUKS support by cvalente
428
	if isTrue ${LUKS}
429
	then 
430
	    print_info "Including LUKS support"
431
	    [ -e /bin/cryptsetup ] || gen_die "LUKS support requires static cryptsetup at /bin/cryptsetup"
432
	    rm -f ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
433
	    cp /bin/cryptsetup ${TEMP}/initramfs-aux-temp/sbin/cryptsetup
434
	    chmod +x "${TEMP}/initramfs-aux-temp/sbin/cryptsetup"
435
	else
436
	    print_info "Not including LUKS support"
437
	fi
426
438
427
	cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
439
	cd ${TEMP}/initramfs-aux-temp/sbin && ln -s ../init init
428
	cd ${TEMP}
440
	cd ${TEMP}
429
	chmod +x "${TEMP}/initramfs-aux-temp/init"
441
	chmod +x "${TEMP}/initramfs-aux-temp/init"
430
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
442
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts"
431
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
443
	chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults"
432
	chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
444
	chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe"
433
	cd "${TEMP}/initramfs-aux-temp/"
445
	cd "${TEMP}/initramfs-aux-temp/"
434
	find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz
446
	find . -print | cpio --quiet -o -H newc | gzip -9 > ${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz
435
	rm -r "${TEMP}/initramfs-aux-temp/"	
447
	rm -r "${TEMP}/initramfs-aux-temp/"	
436
}
448
}
437
449
438
merge_initramfs_cpio_archives(){
450
merge_initramfs_cpio_archives(){
439
	cd "${CACHE_CPIO_DIR}"
451
	cd "${CACHE_CPIO_DIR}"
440
	MERGE_LIST="initramfs-base-layout.cpio.gz initramfs-aux.cpio.gz"	
452
	MERGE_LIST="initramfs-base-layout.cpio.gz initramfs-aux.cpio.gz"	
441
	if [ ! -e "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz" ]
453
	if [ ! -e "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz" ]
442
	then
454
	then
443
		gen_die "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz is missing."
455
		gen_die "${CACHE_CPIO_DIR}/initramfs-base-layout.cpio.gz is missing."
444
	fi
456
	fi
445
	if [ ! -e "${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz" ]
457
	if [ ! -e "${CACHE_CPIO_DIR}/initramfs-aux.cpio.gz" ]
(-)genkernel-3.3.10/gen_initrd.sh (+12 lines)
Lines 195-234 Link Here
195
			cp -a /lib/evms/* "${TEMP}/initrd-temp/lib/evms" || gen_die 'Could not copy files for EVMS2!'
195
			cp -a /lib/evms/* "${TEMP}/initrd-temp/lib/evms" || gen_die 'Could not copy files for EVMS2!'
196
			cp -a /etc/evms.conf "${TEMP}/initrd-temp/etc" || gen_die 'Could not copy files for EVMS2!'
196
			cp -a /etc/evms.conf "${TEMP}/initrd-temp/etc" || gen_die 'Could not copy files for EVMS2!'
197
			cp /sbin/evms_activate "${TEMP}/initrd-temp/sbin/evms_activate" || gen_die 'Could not copy over evms_activate!'
197
			cp /sbin/evms_activate "${TEMP}/initrd-temp/sbin/evms_activate" || gen_die 'Could not copy over evms_activate!'
198
			# Fix EVMS2 complaining that it cant find the swap utilities.
198
			# Fix EVMS2 complaining that it cant find the swap utilities.
199
			# These are not required in the initrd
199
			# These are not required in the initrd
200
			for swap_libs in "${TEMP}/initrd-temp/lib/evms/*/swap*.so"
200
			for swap_libs in "${TEMP}/initrd-temp/lib/evms/*/swap*.so"
201
			do
201
			do
202
				rm ${swap_libs}
202
				rm ${swap_libs}
203
			done
203
			done
204
		fi
204
		fi
205
	fi	
205
	fi	
206
206
207
	for i in '[' ash basename cat chroot clear cp dirname echo env false find \
207
	for i in '[' ash basename cat chroot clear cp dirname echo env false find \
208
	grep gunzip gzip ln ls loadkmap losetup lsmod mkdir mknod more mount mv \
208
	grep gunzip gzip ln ls loadkmap losetup lsmod mkdir mknod more mount mv \
209
	pivot_root ps awk pwd rm rmdir rmmod sed sh sleep tar test touch true umount uname \
209
	pivot_root ps awk pwd rm rmdir rmmod sed sh sleep tar test touch true umount uname \
210
	xargs yes zcat chmod chown cut kill killall; do
210
	xargs yes zcat chmod chown cut kill killall; do
211
		rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null
211
		rm -f ${TEMP}/initrd-temp/bin/$i > /dev/null
212
		ln  ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i ||
212
		ln  ${TEMP}/initrd-temp/bin/busybox ${TEMP}/initrd-temp/bin/$i ||
213
			gen_die "Busybox error: could not link ${i}!"
213
			gen_die "Busybox error: could not link ${i}!"
214
	done
214
	done
215
216
	if [ isTrue "${LUKS}" ]
217
	then 
218
	    print_info "Including LUKS support"
219
	    local luks_file="/bin/cryptsetup"
220
	    local luks_ifile="sbin/cryptsetup"
221
	    [ -e $luks_file ] || gen_die "LUKS support requires static cryptsetup at $luks_file"
222
	    rm -f ${TEMP}/initrd-temp/$luks_ifile
223
	    cp $luks_file ${TEMP}/initrd-temp/$luks_ifile
224
	else
225
	    print_info "Not including LUKS support"
226
	fi
215
}
227
}
216
228
217
print_list()
229
print_list()
218
{
230
{
219
	local x
231
	local x
220
	for x in ${*}
232
	for x in ${*}
221
	do
233
	do
222
		echo ${x}
234
		echo ${x}
223
	done
235
	done
224
}
236
}
225
237
226
create_initrd_modules() {
238
create_initrd_modules() {
227
	local group
239
	local group
228
	local group_modules
240
	local group_modules
229
	
241
	
230
	if [ "${PAT}" -gt "4" ]
242
	if [ "${PAT}" -gt "4" ]
231
	then
243
	then
232
		MOD_EXT=".ko"
244
		MOD_EXT=".ko"
233
	else
245
	else
234
		MOD_EXT=".o"
246
		MOD_EXT=".o"
(-)genkernel-3.3.10/generic/linuxrc (+23 lines)
Lines 1-22 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# Daniel Robbins <drobbins@gentoo.org>
2
# Daniel Robbins <drobbins@gentoo.org>
3
# Clemens Fruhwirth <clemens@endorphin.org>
4
# Cláudio Valente
3
# Copyright 2003 Gentoo Technologies, Inc.
5
# Copyright 2003 Gentoo Technologies, Inc.
4
# Distributed under the GPL
6
# Distributed under the GPL
5
7
6
. /etc/initrd.defaults
8
. /etc/initrd.defaults
7
. /etc/initrd.scripts
9
. /etc/initrd.scripts
8
10
9
splash() {
11
splash() {
10
	return 0
12
	return 0
11
}
13
}
12
[ -e /etc/initrd.splash ] && . /etc/initrd.splash
14
[ -e /etc/initrd.splash ] && . /etc/initrd.splash
13
15
14
# Clean input/output
16
# Clean input/output
15
exec >${CONSOLE} <${CONSOLE} 2>&1
17
exec >${CONSOLE} <${CONSOLE} 2>&1
16
18
17
if [ "$$" != '1' ]
19
if [ "$$" != '1' ]
18
then
20
then
19
	echo '/linuxrc has to be run as the init process as the one'
21
	echo '/linuxrc has to be run as the init process as the one'
20
	echo 'with a PID of 1. Try adding init="/linuxrc" to the'
22
	echo 'with a PID of 1. Try adding init="/linuxrc" to the'
21
	echo 'kernel command line or running "exec /linuxrc".'
23
	echo 'kernel command line or running "exec /linuxrc".'
22
	exit 1
24
	exit 1
Lines 368-407 Link Here
368
		then
370
		then
369
			run_shell
371
			run_shell
370
372
371
			REAL_ROOT=''
373
			REAL_ROOT=''
372
			got_good_root=0
374
			got_good_root=0
373
			continue
375
			continue
374
		
376
		
375
		elif [ "${REAL_ROOT}" = '' ]
377
		elif [ "${REAL_ROOT}" = '' ]
376
		then
378
		then
377
			# No REAL_ROOT determined/specified. Prompt user for root block device.
379
			# No REAL_ROOT determined/specified. Prompt user for root block device.
378
			bad_msg "The root block device is unspecified or not detected."
380
			bad_msg "The root block device is unspecified or not detected."
379
			echo '   Please specify a device to boot, or "shell" for a shell...'
381
			echo '   Please specify a device to boot, or "shell" for a shell...'
380
			echo -n 'boot() :: '
382
			echo -n 'boot() :: '
381
			read REAL_ROOT
383
			read REAL_ROOT
382
			got_good_root=0
384
			got_good_root=0
383
385
384
		# Check for a block device or /dev/nfs
386
		# Check for a block device or /dev/nfs
385
		elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
387
		elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
386
		then
388
		then
387
			got_good_root=1
389
			got_good_root=1
390
391
		#check if LUKS setup is needed
392
		elif [ `echo ${REAL_ROOT} | sed -e "s/\([^:]*\):.*/\1/"` = "luks" ]
393
		then
394
			LUKSdev=`echo ${REAL_ROOT} | sed -e "s/luks:\(.*\)/\1/"`
395
			if [ -e /sbin/cryptsetup ]
396
			then
397
				if cryptsetup isLuks ${LUKSdev}
398
				then
399
					good_msg "LUKS partition - opening $LUKSdev"
400
					cryptsetup luksOpen ${LUKSdev} root &&
401
						REAL_ROOT=/dev/mapper/root &&
402
						got_good_root=1
403
				else
404
					bad_msg "${LUKSDEV} is not a LUKS partition"
405
					REAL_ROOT=""
406
				fi
407
			else
408
				bad_msg "This initrd does not support LUKS"
409
				REAL_ROOT=""
410
			fi
388
		else
411
		else
389
			bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
412
			bad_msg "Block device ${REAL_ROOT} is not a valid root device..."
390
			REAL_ROOT=""
413
			REAL_ROOT=""
391
			got_good_root=0
414
			got_good_root=0
392
		fi
415
		fi
393
	done
416
	done
394
417
395
418
396
	if [ "${CDROOT}" -eq '1' -a "${got_good_root}" = '1' -a "${REAL_ROOT}" != "/dev/nfs" ]
419
	if [ "${CDROOT}" -eq '1' -a "${got_good_root}" = '1' -a "${REAL_ROOT}" != "/dev/nfs" ]
397
	then
420
	then
398
		# CD already mounted; no further checks necessary
421
		# CD already mounted; no further checks necessary
399
		break
422
		break
400
	elif [ "${LOOPTYPE}" = "sgimips" ]
423
	elif [ "${LOOPTYPE}" = "sgimips" ]
401
	then
424
	then
402
		# sgimips mounts the livecd root partition directly
425
		# sgimips mounts the livecd root partition directly
403
		# there is no isofs filesystem to worry about
426
		# there is no isofs filesystem to worry about
404
		break
427
		break
405
	else
428
	else
406
		good_msg "Mounting root..."
429
		good_msg "Mounting root..."
407
430

Return to bug 122421