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

Collapse All | Expand All

(-)b/defaults/initrd.scripts (-42 / +98 lines)
Lines 75-81 modules_scan() { Link Here
75
	elif [ "${USE_MDADM}" = '1' ] \
75
	elif [ "${USE_MDADM}" = '1' ] \
76
		|| [ "${USE_LVM_NORMAL}" = '1' ] \
76
		|| [ "${USE_LVM_NORMAL}" = '1' ] \
77
		|| [ "${USE_CRYPTSETUP}" = '1' ] \
77
		|| [ "${USE_CRYPTSETUP}" = '1' ] \
78
		|| [ "${USE_BTRFS}" = '1' ] \
79
		|| [ "${USE_ZFS}" = '1' ] \
78
		|| [ "${USE_ZFS}" = '1' ] \
80
		|| [ "${USE_DMRAID_NORMAL}" = '1' ]
79
		|| [ "${USE_DMRAID_NORMAL}" = '1' ]
81
	then
80
	then
Lines 561-568 conf_rc_no_umounts() { Link Here
561
	if nomount=$(grep -n '^[[:blank:]]*no_umounts=' ${conf})
560
	if nomount=$(grep -n '^[[:blank:]]*no_umounts=' ${conf})
562
	then
561
	then
563
		local i n data cmd IFS
562
		local i n data cmd IFS
564
		IFS='
563
		IFS=''
565
'
566
		set -- ${nomount}
564
		set -- ${nomount}
567
		unset IFS
565
		unset IFS
568
566
Lines 1010-1015 run_emergency_shell() { Link Here
1010
}
1008
}
1011
1009
1012
run_shell() {
1010
run_shell() {
1011
	splashCmd 'verbose' >/dev/null &
1012
1013
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
1013
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
1014
	then
1014
	then
1015
		bad_msg "gk.userinteraction.disabled is set; Spawning a shell is disabled!"
1015
		bad_msg "gk.userinteraction.disabled is set; Spawning a shell is disabled!"
Lines 1161-1167 bad_msg() { Link Here
1161
1161
1162
	if [ "$2" != '1' ]
1162
	if [ "$2" != '1' ]
1163
	then
1163
	then
1164
		splash 'verbose' >/dev/null &
1164
		splashCmd 'verbose' >/dev/null &
1165
		printf "%b\n" "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
1165
		printf "%b\n" "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
1166
	fi
1166
	fi
1167
}
1167
}
Lines 1202-1214 crypt_filter() { Link Here
1202
	if [ "${CRYPT_SILENT}" = '1' ]
1202
	if [ "${CRYPT_SILENT}" = '1' ]
1203
	then
1203
	then
1204
		eval run ${1} >/dev/null 2>&1
1204
		eval run ${1} >/dev/null 2>&1
1205
	elif [ "${PLYMOUTH}" = '1' ] && plymouth_running
1206
	then
1207
		run plymouth ask-for-password --prompt "Enter LUKS passphrase" \
1208
			--number-of-tries=3 --command="${2}"
1209
		res=$?
1210
		return ${res}
1205
	else
1211
	else
1206
		splash 'verbose' >/dev/null &
1212
		splashCmd 'verbose' >/dev/null &
1207
		eval run ${1}
1213
		eval run ${1}
1208
		res=$?
1214
		res=$?
1209
		if [ ${res} -eq 0 ]
1215
		if [ ${res} -eq 0 ]
1210
		then
1216
		then
1211
			splash set_msg 'Disk unlocked.'
1217
			splashCmd set_msg 'Disk unlocked.'
1212
		fi
1218
		fi
1213
		return ${res}
1219
		return ${res}
1214
	fi
1220
	fi
Lines 1279-1284 prompt_user() { Link Here
1279
	fi
1285
	fi
1280
	[ -n "${3}" ] && local explnt=" or : ${3}" || local explnt="."
1286
	[ -n "${3}" ] && local explnt=" or : ${3}" || local explnt="."
1281
1287
1288
	splashCmd 'verbose' >/dev/null &
1282
	bad_msg "Could not find the ${2} in ${oldvalue}${explnt}"
1289
	bad_msg "Could not find the ${2} in ${oldvalue}${explnt}"
1283
1290
1284
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
1291
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
Lines 1361-1366 prompt_user() { Link Here
1361
			eval ${1}'='${oldvalue}
1368
			eval ${1}'='${oldvalue}
1362
			;;
1369
			;;
1363
	esac
1370
	esac
1371
1372
	splashCmd 'quiet' >/dev/null &
1364
}
1373
}
1365
1374
1366
cmdline_hwopts() {
1375
cmdline_hwopts() {
Lines 1433-1439 chooseKeymap() { Link Here
1433
	good_msg "Loading keymaps"
1442
	good_msg "Loading keymaps"
1434
	if [ -z "${keymap}" ]
1443
	if [ -z "${keymap}" ]
1435
	then
1444
	then
1436
		splash 'verbose' >/dev/null &
1445
		splashCmd 'verbose' >/dev/null &
1437
		run cat /lib/keymaps/keymapList
1446
		run cat /lib/keymaps/keymapList
1438
		read -t 10 -p '<< Load keymap (Enter for default): ' keymap
1447
		read -t 10 -p '<< Load keymap (Enter for default): ' keymap
1439
		case ${keymap} in
1448
		case ${keymap} in
Lines 1491-1502 chooseKeymap() { Link Here
1491
1500
1492
		run mkdir -p /etc/sysconfig
1501
		run mkdir -p /etc/sysconfig
1493
		echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
1502
		echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
1494
		splash set_msg "Set keymap to '${keymap}'"
1503
		splashCmd set_msg "Set keymap to '${keymap}'"
1495
	elif [ -z "${keymap}" ]
1504
	elif [ -z "${keymap}" ]
1496
	then
1505
	then
1497
		good_msg
1506
		good_msg
1498
		good_msg "Keeping default keymap"
1507
		good_msg "Keeping default keymap"
1499
		splash set_msg "Keeping default keymap"
1508
		splashCmd set_msg "Keeping default keymap"
1500
	else
1509
	else
1501
		bad_msg "Sorry, but keymap '${keymap}' is invalid!"
1510
		bad_msg "Sorry, but keymap '${keymap}' is invalid!"
1502
		unset keymap
1511
		unset keymap
Lines 1519-1524 splash() { Link Here
1519
	return 0
1528
	return 0
1520
}
1529
}
1521
1530
1531
splashCmd() {
1532
	case "${1}" in
1533
		init)
1534
		if [ "${FBSPLASH}" = '1' ]
1535
		then
1536
			splash 'init'
1537
		elif [ "${PLYMOUTH}" = '1' ]
1538
		then
1539
			plymouthInit
1540
		fi
1541
		;;
1542
1543
		verbose)
1544
		if [ "${FBSPLASH}" = '1' ]
1545
		then
1546
			splash 'verbose'
1547
		elif [ "${PLYMOUTH}" = '1' ]
1548
		then
1549
			plymouth_running && run plymouth --hide-splash
1550
		fi
1551
		;;
1552
1553
		set_msg)
1554
		if [ "${FBSPLASH}" = '1' ]
1555
		then
1556
			splash 'set_msg' "${2}"
1557
		elif [ "${PLYMOUTH}" = '1' ]
1558
		then
1559
			plymouth_running && run plymouth --update="${2}"
1560
		fi
1561
		;;
1562
1563
		quiet)
1564
		plymouth_running && run plymouth --show-splash
1565
		;;
1566
1567
		hasroot)
1568
		plymouth_running && run plymouth --newroot="${2}"
1569
		;;
1570
	esac
1571
}
1572
1573
plymouth_running() {
1574
	[ -n "${PLYMOUTH_FAIL}" ] && return 1
1575
	run plymouth --ping 2>/dev/null
1576
	return $?
1577
}
1578
1579
plymouthInit() {
1580
	good_msg "Starting Plymouth..."
1581
	run mkdir -p -m 0755 /run/plymouth || return 1
1582
1583
	# Make sure that udev is done loading tty and drm
1584
	run udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
1585
	run udevadm trigger --action=add --subsystem-match=graphics \
1586
		--subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
1587
	udevsettle
1588
1589
	run plymouthd --mode=boot --attach-to-session \
1590
		--pid-file=/run/plymouth/pid || { PLYMOUTH_FAIL=1; return 1; }
1591
1592
	plymouth_running && run plymouth --show-splash
1593
	good_msg "Plymouth initialized"
1594
}
1595
1522
start_volumes() {
1596
start_volumes() {
1523
	# Here, we check for /dev/device-mapper, and if it exists, we setup a
1597
	# Here, we check for /dev/device-mapper, and if it exists, we setup a
1524
	# a symlink, which should hopefully fix bug #142775 and bug #147015
1598
	# a symlink, which should hopefully fix bug #142775 and bug #147015
Lines 1612-1636 start_volumes() { Link Here
1612
		fi
1686
		fi
1613
	fi
1687
	fi
1614
1688
1615
	if [ "${USE_BTRFS}" = '1' ]
1616
	then
1617
		if ! hash btrfs >/dev/null 2>&1
1618
		then
1619
			bad_msg "dobtrfs invoked but 'btrfs' not found; Skipping btrfs device scanning ..."
1620
		else
1621
			good_msg "Scanning for BTRFS devices ..."
1622
1623
			local btrfs_cmd="run btrfs device scan 2>&1"
1624
			is_log_enabled && btrfs_cmd="${btrfs_cmd} | tee -a '${GK_INIT_LOG}'"
1625
1626
			eval "${btrfs_cmd}"
1627
			if [ $? -ne 0 ]
1628
			then
1629
				bad_msg "Scanning for BTRFS devices failed!"
1630
			fi
1631
		fi
1632
	fi
1633
1634
	if [ "${USE_ZFS}" = '1' ]
1689
	if [ "${USE_ZFS}" = '1' ]
1635
	then
1690
	then
1636
		# Avoid race involving asynchronous module loading
1691
		# Avoid race involving asynchronous module loading
Lines 1804-1809 openLUKS() { Link Here
1804
		local cryptsetup_options=''
1859
		local cryptsetup_options=''
1805
1860
1806
		local gpg_cmd=""
1861
		local gpg_cmd=""
1862
		local ply_cmd=""
1807
		if [ -e "${OPENED_LOCKFILE}" ]
1863
		if [ -e "${OPENED_LOCKFILE}" ]
1808
		then
1864
		then
1809
			good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
1865
			good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
Lines 1925-1939 openLUKS() { Link Here
1925
							[ -e /dev/tty ] && run mv /dev/tty /dev/tty.org
1981
							[ -e /dev/tty ] && run mv /dev/tty /dev/tty.org
1926
							run mknod /dev/tty c 5 1
1982
							run mknod /dev/tty c 5 1
1927
							cryptsetup_options="${cryptsetup_options} -d -"
1983
							cryptsetup_options="${cryptsetup_options} -d -"
1928
							gpg_cmd="gpg --logger-file /dev/null --quiet --decrypt ${mntkey}${LUKS_KEY} |"
1984
							gpg_cmd="gpg --logger-file /dev/null --quiet --decrypt ${mntkey}${LUKS_KEY} | "
1985
							ply_cmd="gpg --logger-file /dev/null --quiet --passphrase-fd 0 --batch --no-tty --decrypt ${mntkey}${LUKS_KEY} | "
1929
						fi
1986
						fi
1930
					else
1987
					else
1931
						cryptsetup_options="${cryptsetup_options} -d ${mntkey}${LUKS_KEY}"
1988
						cryptsetup_options="${cryptsetup_options} -d ${mntkey}${LUKS_KEY}"
1932
					fi
1989
					fi
1933
				fi
1990
				fi
1934
				# At this point, keyfile or not, we're ready!
1991
				# At this point, keyfile or not, we're ready!
1935
				crypt_filter "${gpg_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}"
1992
				if [ "${PLYMOUTH}" = '1' ]
1993
				then
1994
					ply_cmd="${ply_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}"
1995
					local ply_cmd_file="$(mktemp -t "ply_cmd.XXXXXX")"
1996
					printf '#!/bin/sh\n%s\n' "${ply_cmd}" > "${ply_cmd_file}"
1997
					run chmod 500 "${ply_cmd_file}"
1998
				fi
1999
				crypt_filter "${gpg_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}" "${ply_cmd_file}"
1936
				crypt_filter_ret=$?
2000
				crypt_filter_ret=$?
2001
				if [ "${PLYMOUTH}" = '1' ]
2002
				then
2003
					run rm -f "${ply_cmd_file}"
2004
				fi
1937
2005
1938
				[ -e /dev/tty.org ] \
2006
				[ -e /dev/tty.org ] \
1939
					&& run rm -f /dev/tty \
2007
					&& run rm -f /dev/tty \
Lines 2510-2527 cdupdate() { Link Here
2510
	fi
2578
	fi
2511
}
2579
}
2512
2580
2513
setup_btrfsctl() {
2514
	# start BTRFS volume detection, if available
2515
	if hash btrfsctl >/dev/null 2>&1
2516
	then
2517
		local btrfs_cmd="run btrfsctl -a 2>&1"
2518
		is_log_enabled && btrfs_cmd="${btrfs_cmd} | tee -a '${GK_INIT_LOG}'"
2519
2520
		eval "${btrfs_cmd}"
2521
		udevsettle
2522
	fi
2523
}
2524
2525
rundebugshell() {
2581
rundebugshell() {
2526
	if is_debug
2582
	if is_debug
2527
	then
2583
	then
(-)b/defaults/linuxrc (-9 / +18 lines)
Lines 151-159 do Link Here
151
				;;
151
				;;
152
			esac
152
			esac
153
		;;
153
		;;
154
		dobtrfs)
155
			USE_BTRFS=1
156
		;;
157
		quiet|quiet_genkernel)
154
		quiet|quiet_genkernel)
158
			QUIET=1
155
			QUIET=1
159
		;;
156
		;;
Lines 191-196 do Link Here
191
			NEW_CONSOLE=$(basename ${NEW_CONSOLE})
188
			NEW_CONSOLE=$(basename ${NEW_CONSOLE})
192
			NEW_CONSOLE=${NEW_CONSOLE%%,*}
189
			NEW_CONSOLE=${NEW_CONSOLE%%,*}
193
		;;
190
		;;
191
		splash)
192
			if [ -x /usr/bin/plymouth -a -x /usr/sbin/plymouthd ]
193
			then
194
				PLYMOUTH=1
195
			fi
196
		;;
197
		splash=*)
198
			if [ -e /etc/initrd.splash ]
199
			then
200
				FBSPLASH=1
201
			fi
202
		;;
194
		# /dev/md
203
		# /dev/md
195
		lvmraid=*)
204
		lvmraid=*)
196
			RAID_DEVICES="${x#*=}"
205
			RAID_DEVICES="${x#*=}"
Lines 518-525 then Link Here
518
	FIRSTMODS="${FIRSTMODS} crc32_generic"
527
	FIRSTMODS="${FIRSTMODS} crc32_generic"
519
fi
528
fi
520
529
521
splash 'init'
522
523
cmdline_hwopts
530
cmdline_hwopts
524
531
525
# Mount devfs
532
# Mount devfs
Lines 597-602 fi Link Here
597
604
598
cd /
605
cd /
599
606
607
# start splash; plymouth must start after udev
608
splashCmd 'init'
609
600
# Start iSCSI
610
# Start iSCSI
601
if hash iscsistart >/dev/null 2>&1
611
if hash iscsistart >/dev/null 2>&1
602
then
612
then
Lines 615-623 fi Link Here
615
# Apply scan delay if specified
625
# Apply scan delay if specified
616
sdelay
626
sdelay
617
627
618
# Setup btrfs, see bug 303529
619
setup_btrfsctl
620
621
# Scan volumes
628
# Scan volumes
622
start_volumes
629
start_volumes
623
630
Lines 1276-1281 fi # if [ "${CDROOT}" = '1' ] Link Here
1276
# Re-run to ensure $NEWROOT/etc/initramfs.mounts was processed at least once
1283
# Re-run to ensure $NEWROOT/etc/initramfs.mounts was processed at least once
1277
process_initramfs_mounts
1284
process_initramfs_mounts
1278
1285
1286
splashCmd 'hasroot' "${NEW_ROOT}"
1287
1279
# Execute script on the cdrom just before boot to update things if necessary
1288
# Execute script on the cdrom just before boot to update things if necessary
1280
cdupdate
1289
cdupdate
1281
1290
Lines 1348-1354 else Link Here
1348
fi
1357
fi
1349
1358
1350
# If we get here, something bad has happened
1359
# If we get here, something bad has happened
1351
splash 'verbose'
1360
splashCmd 'verbose'
1352
1361
1353
bad_msg "A fatal error has occured since ${init} did not"
1362
bad_msg "A fatal error has occured since ${init} did not"
1354
bad_msg "boot correctly. Trying to open a shell ..."
1363
bad_msg "boot correctly. Trying to open a shell ..."
(-)b/doc/genkernel.8.txt (-3 / +7 lines)
Lines 317-322 INITIALIZATION Link Here
317
    <theme>  rather than the default theme specified in your splash
317
    <theme>  rather than the default theme specified in your splash
318
    configuration. If *--no-splash* is specified, then splash is disabled.
318
    configuration. If *--no-splash* is specified, then splash is disabled.
319
319
320
*--*[*no-*]*plymouth*::
321
    Includes or excludes Plymouth from the initramfs. If "splash" is
322
    passed at boot, Plymouth will be activated.
323
324
*--plymouth-theme*=<theme>::
325
    Embeds the given Plymouth theme into the initramfs.
326
320
*--do-keymap-auto*::
327
*--do-keymap-auto*::
321
    Force keymap selection at boot.
328
    Force keymap selection at boot.
322
329
Lines 775-783 when not set. This will allow remote user to provide answer through Link Here
775
    Scan for bootable ZFS pools on bootup. Optionally use cachefile or force import if
782
    Scan for bootable ZFS pools on bootup. Optionally use cachefile or force import if
776
    necessary or perform both actions.
783
    necessary or perform both actions.
777
784
778
*dobtrfs*::
779
    Scan for attached Btrfs devices on bootup.
780
781
*domultipath*::
785
*domultipath*::
782
    Activate Multipath on bootup.
786
    Activate Multipath on bootup.
783
787
(-)b/gen_cmdline.sh (+14 lines)
Lines 53-58 longusage() { Link Here
53
  echo "	--no-mrproper		Do not run 'make mrproper' before compilation"
53
  echo "	--no-mrproper		Do not run 'make mrproper' before compilation"
54
  echo "	--splash		Install framebuffer splash support into initramfs"
54
  echo "	--splash		Install framebuffer splash support into initramfs"
55
  echo "	--no-splash		Do not install framebuffer splash"
55
  echo "	--no-splash		Do not install framebuffer splash"
56
  echo "	--plymouth		Enable Plymouth support"
57
  echo "	--no-plymouth		Do not enable Plymouth support"
56
  echo "	--install		Install the kernel after building"
58
  echo "	--install		Install the kernel after building"
57
  echo "	--no-install		Do not install the kernel after building"
59
  echo "	--no-install		Do not install the kernel after building"
58
  echo "	--symlink		Manage symlinks in /boot for installed images"
60
  echo "	--symlink		Manage symlinks in /boot for installed images"
Lines 113-118 longusage() { Link Here
113
  echo "	--splash-res=<res>	Select splash theme resolutions to install"
115
  echo "	--splash-res=<res>	Select splash theme resolutions to install"
114
  echo "	--splash=<theme>	Enable framebuffer splash using <theme>"
116
  echo "	--splash=<theme>	Enable framebuffer splash using <theme>"
115
  echo "	--splash-res=<res>	Select splash theme resolutions to install"
117
  echo "	--splash-res=<res>	Select splash theme resolutions to install"
118
  echo "	--plymouth-theme=<theme>    Embed the given Plymouth theme"
116
  echo "	--do-keymap-auto	Forces keymap selection at boot"
119
  echo "	--do-keymap-auto	Forces keymap selection at boot"
117
  echo "	--keymap		Enables keymap selection support"
120
  echo "	--keymap		Enables keymap selection support"
118
  echo "	--no-keymap		Disables keymap selection support"
121
  echo "	--no-keymap		Disables keymap selection support"
Lines 600-605 parse_cmdline() { Link Here
600
			SPLASH_RES="${*#*=}"
603
			SPLASH_RES="${*#*=}"
601
			print_info 3 "SPLASH_RES: ${SPLASH_RES}"
604
			print_info 3 "SPLASH_RES: ${SPLASH_RES}"
602
			;;
605
			;;
606
		--plymouth)
607
			CMD_PLYMOUTH="yes"
608
			PLYMOUTH_THEME='text'
609
			print_info 3 "CMD_PLYMOUTH: ${CMD_PLYMOUTH}"
610
			;;
611
		--plymouth-theme=*)
612
			CMD_PLYMOUTH="yes"
613
			PLYMOUTH_THEME="${*#*=}"
614
			print_info 3 "CMD_PLYMOUTH: ${CMD_PLYMOUTH}"
615
			print_info 3 "PLYMOUTH_THEME: ${PLYMOUTH_THEME}"
616
			;;
603
		--install|--no-install)
617
		--install|--no-install)
604
			CMD_INSTALL=$(parse_optbool "$*")
618
			CMD_INSTALL=$(parse_optbool "$*")
605
			print_info 3 "CMD_INSTALL: ${CMD_INSTALL}"
619
			print_info 3 "CMD_INSTALL: ${CMD_INSTALL}"
(-)b/gen_determineargs.sh (+6 lines)
Lines 352-357 determine_real_args() { Link Here
352
	set_config_with_override STRING MODPROBEDIR                           CMD_MODPROBEDIR                           "/etc/modprobe.d"
352
	set_config_with_override STRING MODPROBEDIR                           CMD_MODPROBEDIR                           "/etc/modprobe.d"
353
353
354
	set_config_with_override BOOL   SPLASH                                CMD_SPLASH                                "no"
354
	set_config_with_override BOOL   SPLASH                                CMD_SPLASH                                "no"
355
	set_config_with_override BOOL   PLYMOUTH                              CMD_PLYMOUTH                              "no"
355
	set_config_with_override BOOL   CLEAR_CACHEDIR                        CMD_CLEAR_CACHEDIR                        "no"
356
	set_config_with_override BOOL   CLEAR_CACHEDIR                        CMD_CLEAR_CACHEDIR                        "no"
356
	set_config_with_override BOOL   POSTCLEAR                             CMD_POSTCLEAR                             "no"
357
	set_config_with_override BOOL   POSTCLEAR                             CMD_POSTCLEAR                             "no"
357
	set_config_with_override BOOL   MRPROPER                              CMD_MRPROPER                              "yes"
358
	set_config_with_override BOOL   MRPROPER                              CMD_MRPROPER                              "yes"
Lines 984-989 determine_real_args() { Link Here
984
			fi
985
			fi
985
		fi
986
		fi
986
987
988
		if isTrue "${PLYMOUTH}" && isTrue "${SPLASH}"
989
		then
990
			gen_die "--plymouth and --splash are mutually exclusive!"
991
		fi
992
987
		if isTrue "${SSH}"
993
		if isTrue "${SSH}"
988
		then
994
		then
989
			local ssh_authorized_keys_file=$(expand_file "${SSH_AUTHORIZED_KEYS_FILE}")
995
			local ssh_authorized_keys_file=$(expand_file "${SSH_AUTHORIZED_KEYS_FILE}")
(-)b/gen_initramfs.sh (+137 lines)
Lines 483-488 append_base_layout() { Link Here
483
	isTrue "${UNIONFS}" && build_parameters+=( --unionfs ) || build_parameters+=( --no-unionfs )
483
	isTrue "${UNIONFS}" && build_parameters+=( --unionfs ) || build_parameters+=( --no-unionfs )
484
	isTrue "${ZFS}" && build_parameters+=( --zfs ) || build_parameters+=( --no-zfs )
484
	isTrue "${ZFS}" && build_parameters+=( --zfs ) || build_parameters+=( --no-zfs )
485
	isTrue "${SPLASH}" && build_parameters+=( --splash ) || build_parameters+=( --no-splash )
485
	isTrue "${SPLASH}" && build_parameters+=( --splash ) || build_parameters+=( --no-splash )
486
	isTrue "${PLYMOUTH}" && build_parameters+=( --plymouth ) || build_parameters+=( --no-plymouth )
486
	isTrue "${STRACE}" && build_parameters+=( --strace ) || build_parameters+=( --no-strace )
487
	isTrue "${STRACE}" && build_parameters+=( --strace ) || build_parameters+=( --no-strace )
487
	isTrue "${GPG}" && build_parameters+=( --gpg ) || build_parameters+=( --no-gpg )
488
	isTrue "${GPG}" && build_parameters+=( --gpg ) || build_parameters+=( --no-gpg )
488
	isTrue "${LUKS}" && build_parameters+=( --luks ) || build_parameters+=( --no-luks )
489
	isTrue "${LUKS}" && build_parameters+=( --luks ) || build_parameters+=( --no-luks )
Lines 1283-1288 append_splash() { Link Here
1283
	fi
1284
	fi
1284
}
1285
}
1285
1286
1287
append_plymouth() {
1288
	local PN=plymouth
1289
	local TDIR="${TEMP}/initramfs-${PN}-temp"
1290
	if [ -d "${TDIR}" ]
1291
	then
1292
		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
1293
	fi
1294
1295
	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
1296
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1297
1298
	# set plymouth theme
1299
	if [ -n "${PLYMOUTH_THEME}" ]
1300
	then
1301
		plymouth-set-default-theme ${PLYMOUTH_THEME} || gen_die "Failed to set default plymouth theme!"
1302
	fi
1303
	if [ -z "${PLYMOUTH_THEME}" -a -e /etc/plymouth/plymouthd.conf ]
1304
	then
1305
		PLYMOUTH_THEME=$(plymouth-set-default-theme) || gen_die "Failed to set default plymouth theme!"
1306
	fi
1307
	if [ -z "${PLYMOUTH_THEME}" ]
1308
	then
1309
		PLYMOUTH_THEME=text
1310
	fi
1311
1312
	print_info 1 "$(get_indent 1)>> Installing plymouth [ using the '${PLYMOUTH_THEME}' theme ]..."
1313
1314
	/usr/libexec/plymouth/plymouth-populate-initrd -t "${TDIR}" \
1315
		|| gen_die "Failed to build plymouth cpio archive!"
1316
1317
	# can probably get rid of this; depends if plymouth was built with static libs
1318
	# rm -f "${TDIR}"/lib*/{ld*,libc*,libz*} \
1319
		# || gen_die "Failed to clean up plymouth cpio archive!"
1320
1321
	ln -sf "${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" "${TDIR}/usr/share/plymouth/themes/default.plymouth" \
1322
		|| gen_die "Failed to set the default plymouth theme!"
1323
1324
	# this might be better located in append_drm (?)
1325
	mkdir -p "${TDIR}"/usr/lib/udev/rules.d || gen_die "Failed to create '${TDIR}/usr/lib/udev/rules.d'!"
1326
	cp -aL /lib/udev/rules.d/71-seat.rules "${TDIR}/usr/lib/udev/rules.d" || gen_die "Failed to copy '71-seat.rules'!"
1327
1328
	# clean up
1329
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1330
	log_future_cpio_content
1331
	find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
1332
		|| gen_die "Failed to append ${PN} to cpio!"
1333
1334
	cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!"
1335
	if isTrue "${CLEANUP}"
1336
	then
1337
		rm -rf "${TDIR}"
1338
	fi
1339
}
1340
1341
append_drm() {
1342
	local PN=drm
1343
	local TDIR="${TEMP}/initramfs-${PN}-${KV}-temp"
1344
	if [ -d "${TDIR}" ]
1345
	then
1346
		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
1347
	fi
1348
1349
	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
1350
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1351
1352
	print_info 1 "$(get_indent 1)>> Appending drm drivers..."
1353
1354
	# mkdir -p "${TDIR}/lib/modules/${KV}"
1355
1356
	local drm_path="/lib/modules/${KV}/kernel/drivers/gpu/drm"
1357
	local modules
1358
	if [ -d "${drm_path}" ]
1359
	then
1360
		modules=$(strip_mod_paths $(find "${drm_path}" -name "*.ko"))
1361
	else
1362
		print_info 1 "$(get_indent 2)Warning :: no drm modules in drivers/gpu/drm..."
1363
	fi
1364
1365
	rm -f "${TEMP}/moddeps" || gen_die "Failed to clear old moddeps!"
1366
	gen_deps ${modules}
1367
	if [ -f "${TEMP}/moddeps" ]
1368
	then
1369
		modules=$(cat "${TEMP}/moddeps" | sort | uniq)
1370
	else
1371
		print_info 1 "$(get_indent 2)Warning :: module dependencies not generated..."
1372
	fi
1373
1374
	local mod i fws fw
1375
	for i in ${modules}
1376
	do
1377
		mod=$(find "/lib/modules/${KV}" -name "${i}.ko" 2>/dev/null| head -n 1)
1378
		if [ -z "${mod}" ]
1379
		then
1380
			print_info 1 "$(get_indent 2)Warning :: ${i}.ko not found; skipping..."
1381
			continue
1382
		fi
1383
1384
		print_info 1 "$(get_indent 2)>> Copying ${mod}..."
1385
		cp -ax --parents "${mod}" "${TDIR}" || gen_die "Failed to copy '${mod}'!"
1386
1387
		# check that firmware files exist, then copy them (modinfo may list deprecated firmware)
1388
		fws=( $(get_firmware_files "${mod}") )
1389
		for fw in "${fws[@]}"
1390
		do
1391
			if [ -e "/lib/firmware/${fw}" ]
1392
			then
1393
				print_info 1 "$(get_indent 2)>> Copying firmware ${fw}..."
1394
				cp -ax --parents "/lib/firmware/${fw}" "${TDIR}" \
1395
					|| gen_die "Failed to copy ${fw}!"
1396
			fi
1397
		done
1398
	done
1399
1400
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1401
	log_future_cpio_content
1402
	find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
1403
		|| gen_die "Failed to append ${PN} to cpio!"
1404
1405
	cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!"
1406
	if isTrue "${CLEANUP}"
1407
	then
1408
		rm -rf "${TDIR}"
1409
	fi
1410
}
1411
1412
get_firmware_files() {
1413
	local kmod="${1}"
1414
	modinfo --set-version="${KV}" -F firmware "${kmod}" || gen_die "Failed to get modinfo for ${kmod}!"
1415
}
1416
1286
append_strace() {
1417
append_strace() {
1287
	local PN=strace
1418
	local PN=strace
1288
	local TDIR="${TEMP}/initramfs-${PN}-temp"
1419
	local TDIR="${TEMP}/initramfs-${PN}-temp"
Lines 2003-2013 create_initramfs() { Link Here
2003
	append_data 'modprobed'
2134
	append_data 'modprobed'
2004
	append_data 'multipath' "${MULTIPATH}"
2135
	append_data 'multipath' "${MULTIPATH}"
2005
	append_data 'splash' "${SPLASH}"
2136
	append_data 'splash' "${SPLASH}"
2137
	append_data 'plymouth' "${PLYMOUTH}"
2006
	append_data 'strace' "${STRACE}"
2138
	append_data 'strace' "${STRACE}"
2007
	append_data 'unionfs_fuse' "${UNIONFS}"
2139
	append_data 'unionfs_fuse' "${UNIONFS}"
2008
	append_data 'xfsprogs' "${XFSPROGS}"
2140
	append_data 'xfsprogs' "${XFSPROGS}"
2009
	append_data 'zfs' "${ZFS}"
2141
	append_data 'zfs' "${ZFS}"
2010
2142
2143
	if isTrue "${PLYMOUTH}"
2144
	then
2145
		append_data 'drm'
2146
	fi
2147
2011
	if isTrue "${ZFS}"
2148
	if isTrue "${ZFS}"
2012
	then
2149
	then
2013
		append_data 'libgcc_s'
2150
		append_data 'libgcc_s'
(-)b/genkernel (-1 lines)
Lines 485-491 then Link Here
485
	print_warning 1 "${BOLD}WARNING... WARNING... WARNING...${NORMAL}"
485
	print_warning 1 "${BOLD}WARNING... WARNING... WARNING...${NORMAL}"
486
	print_warning 1 'Additional kernel parameters that *may* be required to boot properly:'
486
	print_warning 1 'Additional kernel parameters that *may* be required to boot properly:'
487
	isTrue "${SPLASH}"    && print_warning 1 "- Add \"vga=791 splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer ]"
487
	isTrue "${SPLASH}"    && print_warning 1 "- Add \"vga=791 splash=silent,theme:${SPLASH_THEME} console=tty1 quiet\" if you use a splash framebuffer ]"
488
	isTrue "${BTRFS}"     && print_warning 1 '- Add "dobtrfs" for Btrfs device scanning support'
489
	isTrue "${MULTIPATH}" && print_warning 1 '- Add "domultipath" for multipath support'
488
	isTrue "${MULTIPATH}" && print_warning 1 '- Add "domultipath" for multipath support'
490
	isTrue "${ISCSI}"     && print_warning 1 '- For iSCSI support, add at least:'
489
	isTrue "${ISCSI}"     && print_warning 1 '- For iSCSI support, add at least:'
491
	isTrue "${ISCSI}"     && print_warning 1 '	- "iscsi_initiatorname=<initiator name>"'
490
	isTrue "${ISCSI}"     && print_warning 1 '	- "iscsi_initiatorname=<initiator name>"'
(-)b/genkernel.conf (+7 lines)
Lines 171-176 NOCOLOR="false" Link Here
171
# This supersedes the "SPLASH_THEME" option in '/etc/conf.d/splash'.
171
# This supersedes the "SPLASH_THEME" option in '/etc/conf.d/splash'.
172
#SPLASH_THEME="gentoo"
172
#SPLASH_THEME="gentoo"
173
173
174
# Includes or excludes Plymouth from the initramfs. If "splash" is
175
# passed at boot, Plymouth will be activated.
176
#PLYMOUTH="no"
177
178
# Embeds the given plymouth theme in the initramfs.
179
#PLYMOUTH_THEME="text"
180
174
# Run "emerge @module-rebuild" automatically when possible and necessary
181
# Run "emerge @module-rebuild" automatically when possible and necessary
175
# after kernel and modules have been compiled
182
# after kernel and modules have been compiled
176
#MODULEREBUILD="yes"
183
#MODULEREBUILD="yes"

Return to bug 753617