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

(-)a/defaults/initrd.scripts (-8 / +97 lines)
Lines 1033-1038 run_emergency_shell() { Link Here
1033
}
1033
}
1034
1034
1035
run_shell() {
1035
run_shell() {
1036
	splashCmd 'verbose' >/dev/null &
1037
1036
	if ! is_userinteraction_allowed
1038
	if ! is_userinteraction_allowed
1037
	then
1039
	then
1038
		bad_msg "gk.userinteraction.disabled is set; Spawning a shell is disabled!"
1040
		bad_msg "gk.userinteraction.disabled is set; Spawning a shell is disabled!"
Lines 1197-1203 bad_msg() { Link Here
1197
1199
1198
	if [ "$2" != '1' ]
1200
	if [ "$2" != '1' ]
1199
	then
1201
	then
1200
		splash 'verbose' >/dev/null &
1202
		splashCmd 'verbose' >/dev/null &
1201
		printf "%b\n" "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
1203
		printf "%b\n" "${BAD}!!${NORMAL}${BOLD} ${msg_string} ${NORMAL}"
1202
	fi
1204
	fi
1203
}
1205
}
Lines 1238-1250 crypt_filter() { Link Here
1238
	if [ "${CRYPT_SILENT}" = '1' ]
1240
	if [ "${CRYPT_SILENT}" = '1' ]
1239
	then
1241
	then
1240
		eval run ${1} >/dev/null 2>&1
1242
		eval run ${1} >/dev/null 2>&1
1243
	elif [ "${PLYMOUTH}" = '1' ] && plymouth_running
1244
	then
1245
		run plymouth ask-for-password --prompt "Enter LUKS passphrase" \
1246
			--number-of-tries=3 --command="${2}"
1247
		res=$?
1248
		return ${res}
1241
	else
1249
	else
1242
		splash 'verbose' >/dev/null &
1250
		splashCmd 'verbose' >/dev/null &
1243
		eval run ${1}
1251
		eval run ${1}
1244
		res=$?
1252
		res=$?
1245
		if [ ${res} -eq 0 ]
1253
		if [ ${res} -eq 0 ]
1246
		then
1254
		then
1247
			splash set_msg 'Disk unlocked.'
1255
			splashCmd set_msg 'Disk unlocked.'
1248
		fi
1256
		fi
1249
		return ${res}
1257
		return ${res}
1250
	fi
1258
	fi
Lines 1315-1320 prompt_user() { Link Here
1315
	fi
1323
	fi
1316
	[ -n "${3}" ] && local explnt=" or : ${3}" || local explnt="."
1324
	[ -n "${3}" ] && local explnt=" or : ${3}" || local explnt="."
1317
1325
1326
	splashCmd 'verbose' >/dev/null &
1318
	bad_msg "Could not find the ${2} in ${oldvalue}${explnt}"
1327
	bad_msg "Could not find the ${2} in ${oldvalue}${explnt}"
1319
1328
1320
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
1329
	if [ -f "${GK_USERINTERACTION_DISABLED_STATEFILE}" ]
Lines 1397-1402 prompt_user() { Link Here
1397
			eval ${1}'='${oldvalue}
1406
			eval ${1}'='${oldvalue}
1398
			;;
1407
			;;
1399
	esac
1408
	esac
1409
1410
	splashCmd 'quiet' >/dev/null &
1400
}
1411
}
1401
1412
1402
cmdline_hwopts() {
1413
cmdline_hwopts() {
Lines 1476-1482 chooseKeymap() { Link Here
1476
	good_msg "Loading keymaps"
1487
	good_msg "Loading keymaps"
1477
	if [ -z "${keymap}" ]
1488
	if [ -z "${keymap}" ]
1478
	then
1489
	then
1479
		splash 'verbose' >/dev/null &
1490
		splashCmd 'verbose' >/dev/null &
1480
		run cat /lib/keymaps/keymapList
1491
		run cat /lib/keymaps/keymapList
1481
		read -t 10 -p '<< Load keymap (Enter for default): ' keymap
1492
		read -t 10 -p '<< Load keymap (Enter for default): ' keymap
1482
		case ${keymap} in
1493
		case ${keymap} in
Lines 1534-1545 chooseKeymap() { Link Here
1534
1545
1535
		run mkdir -p /etc/sysconfig
1546
		run mkdir -p /etc/sysconfig
1536
		echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
1547
		echo "XKEYBOARD=${keymap}" > /etc/sysconfig/keyboard
1537
		splash set_msg "Set keymap to '${keymap}'"
1548
		splashCmd set_msg "Set keymap to '${keymap}'"
1538
	elif [ -z "${keymap}" ]
1549
	elif [ -z "${keymap}" ]
1539
	then
1550
	then
1540
		good_msg
1551
		good_msg
1541
		good_msg "Keeping default keymap"
1552
		good_msg "Keeping default keymap"
1542
		splash set_msg "Keeping default keymap"
1553
		splashCmd set_msg "Keeping default keymap"
1543
	else
1554
	else
1544
		bad_msg "Sorry, but keymap '${keymap}' is invalid!"
1555
		bad_msg "Sorry, but keymap '${keymap}' is invalid!"
1545
		unset keymap
1556
		unset keymap
Lines 1562-1567 splash() { Link Here
1562
	return 0
1573
	return 0
1563
}
1574
}
1564
1575
1576
splashCmd() {
1577
	case "${1}" in
1578
		init)
1579
		if [ "${FBSPLASH}" = '1' ]
1580
		then
1581
			splash 'init'
1582
		elif [ "${PLYMOUTH}" = '1' ]
1583
		then
1584
			plymouthInit
1585
		fi
1586
		;;
1587
1588
		verbose)
1589
		if [ "${FBSPLASH}" = '1' ]
1590
		then
1591
			splash 'verbose'
1592
		elif [ "${PLYMOUTH}" = '1' ]
1593
		then
1594
			plymouth_running && run plymouth --hide-splash
1595
		fi
1596
		;;
1597
1598
		set_msg)
1599
		if [ "${FBSPLASH}" = '1' ]
1600
		then
1601
			splash 'set_msg' "${2}"
1602
		elif [ "${PLYMOUTH}" = '1' ]
1603
		then
1604
			plymouth_running && run plymouth --update="${2}"
1605
		fi
1606
		;;
1607
1608
		quiet)
1609
		plymouth_running && run plymouth --show-splash
1610
		;;
1611
1612
		hasroot)
1613
		plymouth_running && run plymouth --newroot="${2}"
1614
		;;
1615
	esac
1616
}
1617
1618
plymouth_running() {
1619
	[ -n "${PLYMOUTH_FAIL}" ] && return 1
1620
	run plymouth --ping 2>/dev/null
1621
	return $?
1622
}
1623
1624
plymouthInit() {
1625
	good_msg "Starting Plymouth..."
1626
	run mkdir -p -m 0755 /run/plymouth || return 1
1627
1628
	# Make sure that udev is done loading tty and drm
1629
	run udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
1630
	run udevadm trigger --action=add --subsystem-match=graphics \
1631
		--subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
1632
	udevsettle
1633
1634
	run plymouthd --mode=boot --attach-to-session \
1635
		--pid-file=/run/plymouth/pid || { PLYMOUTH_FAIL=1; return 1; }
1636
1637
	plymouth_running && run plymouth --show-splash
1638
	good_msg "Plymouth initialized"
1639
}
1640
1565
start_volumes() {
1641
start_volumes() {
1566
	# Here, we check for /dev/device-mapper, and if it exists, we setup a
1642
	# Here, we check for /dev/device-mapper, and if it exists, we setup a
1567
	# a symlink, which should hopefully fix bug #142775 and bug #147015
1643
	# a symlink, which should hopefully fix bug #142775 and bug #147015
Lines 1837-1842 openLUKS() { Link Here
1837
	while true
1913
	while true
1838
	do
1914
	do
1839
		local gpg_cmd=""
1915
		local gpg_cmd=""
1916
		local ply_cmd=""
1840
		if [ -e "${OPENED_LOCKFILE}" ]
1917
		if [ -e "${OPENED_LOCKFILE}" ]
1841
		then
1918
		then
1842
			good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
1919
			good_msg "The LUKS device ${LUKS_DEVICE} meanwhile was opened by someone else."
Lines 1957-1971 openLUKS() { Link Here
1957
							[ -e /dev/tty ] && run mv /dev/tty /dev/tty.org
2034
							[ -e /dev/tty ] && run mv /dev/tty /dev/tty.org
1958
							run mknod /dev/tty c 5 1
2035
							run mknod /dev/tty c 5 1
1959
							cryptsetup_options="${cryptsetup_options} -d -"
2036
							cryptsetup_options="${cryptsetup_options} -d -"
1960
							gpg_cmd="gpg --logger-file /dev/null --quiet --decrypt ${mntkey}${LUKS_KEY} |"
2037
							gpg_cmd="gpg --logger-file /dev/null --quiet --decrypt ${mntkey}${LUKS_KEY} | "
2038
							ply_cmd="gpg --logger-file /dev/null --quiet --passphrase-fd 0 --batch --no-tty --decrypt ${mntkey}${LUKS_KEY} | "
1961
						fi
2039
						fi
1962
					else
2040
					else
1963
						cryptsetup_options="${cryptsetup_options} -d ${mntkey}${LUKS_KEY}"
2041
						cryptsetup_options="${cryptsetup_options} -d ${mntkey}${LUKS_KEY}"
1964
					fi
2042
					fi
1965
				fi
2043
				fi
1966
				# At this point, keyfile or not, we're ready!
2044
				# At this point, keyfile or not, we're ready!
1967
				crypt_filter "${gpg_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}"
2045
				if [ "${PLYMOUTH}" = '1' ]
2046
				then
2047
					ply_cmd="${ply_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}"
2048
					local ply_cmd_file="$(mktemp -t "ply_cmd.XXXXXX")"
2049
					printf '#!/bin/sh\n%s\n' "${ply_cmd}" > "${ply_cmd_file}"
2050
					run chmod 500 "${ply_cmd_file}"
2051
				fi
2052
				crypt_filter "${gpg_cmd}cryptsetup ${cryptsetup_options} luksOpen ${LUKS_DEVICE} ${LUKS_NAME}" "${ply_cmd_file}"
1968
				crypt_filter_ret=$?
2053
				crypt_filter_ret=$?
2054
				if [ "${PLYMOUTH}" = '1' ]
2055
				then
2056
					run rm -f "${ply_cmd_file}"
2057
				fi
1969
2058
1970
				[ -e /dev/tty.org ] \
2059
				[ -e /dev/tty.org ] \
1971
					&& run rm -f /dev/tty \
2060
					&& run rm -f /dev/tty \
(-)a/defaults/linuxrc (-2 / +17 lines)
Lines 178-183 do Link Here
178
			MLIST=$(echo ${MLIST} ${x#*=} | sed -e 's/^\ *//;s/,/ /g')
178
			MLIST=$(echo ${MLIST} ${x#*=} | sed -e 's/^\ *//;s/,/ /g')
179
			export MLIST
179
			export MLIST
180
		;;
180
		;;
181
		splash)
182
			if [ -x /usr/bin/plymouth -a -x /usr/sbin/plymouthd ]
183
			then
184
				PLYMOUTH=1
185
			fi
186
		;;
187
		splash=*)
188
			if [ -e /etc/initrd.splash ]
189
			then
190
				FBSPLASH=1
191
			fi
192
		;;
181
		# /dev/md
193
		# /dev/md
182
		lvmraid=*)
194
		lvmraid=*)
183
			warn_msg "'${x}' kernel command-line argument is deprecated; Use 'dolvm' instead!"
195
			warn_msg "'${x}' kernel command-line argument is deprecated; Use 'dolvm' instead!"
Lines 541-548 then Link Here
541
	FIRSTMODS="${FIRSTMODS} btrfs"
553
	FIRSTMODS="${FIRSTMODS} btrfs"
542
fi
554
fi
543
555
544
splash 'init'
545
546
cmdline_hwopts
556
cmdline_hwopts
547
557
548
# Mount devfs
558
# Mount devfs
Lines 620-625 fi Link Here
620
630
621
cd /
631
cd /
622
632
633
# start splash; plymouth must start after udev
634
splashCmd 'init'
635
623
# Start iSCSI
636
# Start iSCSI
624
if hash iscsistart >/dev/null 2>&1
637
if hash iscsistart >/dev/null 2>&1
625
then
638
then
Lines 1296-1301 fi # if [ "${CDROOT}" = '1' ] Link Here
1296
# Re-run to ensure $NEWROOT/etc/initramfs.mounts was processed at least once
1309
# Re-run to ensure $NEWROOT/etc/initramfs.mounts was processed at least once
1297
process_initramfs_mounts
1310
process_initramfs_mounts
1298
1311
1312
splashCmd 'hasroot' "${NEW_ROOT}"
1313
1299
# Execute script on the cdrom just before boot to update things if necessary
1314
# Execute script on the cdrom just before boot to update things if necessary
1300
cdupdate
1315
cdupdate
1301
1316
(-)a/doc/genkernel.8.txt (+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
(-)a/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}"
(-)a/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}")
(-)a/gen_initramfs.sh (+138 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 1284-1289 append_splash() { Link Here
1284
	fi
1285
	fi
1285
}
1286
}
1286
1287
1288
append_plymouth() {
1289
	local PN=plymouth
1290
	local TDIR="${TEMP}/initramfs-${PN}-temp"
1291
	if [ -d "${TDIR}" ]
1292
	then
1293
		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
1294
	fi
1295
1296
	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
1297
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1298
1299
	# set plymouth theme
1300
	if [ -n "${PLYMOUTH_THEME}" ]
1301
	then
1302
		plymouth-set-default-theme ${PLYMOUTH_THEME} || gen_die "Failed to set default plymouth theme!"
1303
	fi
1304
	if [ -z "${PLYMOUTH_THEME}" -a -e /etc/plymouth/plymouthd.conf ]
1305
	then
1306
		PLYMOUTH_THEME=$(plymouth-set-default-theme) || gen_die "Failed to set default plymouth theme!"
1307
	fi
1308
	if [ -z "${PLYMOUTH_THEME}" ]
1309
	then
1310
		PLYMOUTH_THEME=text
1311
	fi
1312
1313
	print_info 1 "$(get_indent 1)>> Installing plymouth [ using the '${PLYMOUTH_THEME}' theme ]..."
1314
1315
	/usr/libexec/plymouth/plymouth-populate-initrd -t "${TDIR}" \
1316
		|| gen_die "Failed to build plymouth cpio archive!"
1317
1318
	# can probably get rid of this; depends if plymouth was built with static libs
1319
	# rm -f "${TDIR}"/lib*/{ld*,libc*,libz*} \
1320
		# || gen_die "Failed to clean up plymouth cpio archive!"
1321
1322
	ln -sf "${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" "${TDIR}/usr/share/plymouth/themes/default.plymouth" \
1323
		|| gen_die "Failed to set the default plymouth theme!"
1324
1325
	# this might be better located in append_drm (?)
1326
	mkdir -p "${TDIR}"/usr/lib/udev/rules.d || gen_die "Failed to create '${TDIR}/usr/lib/udev/rules.d'!"
1327
	cp -aL /lib/udev/rules.d/70-uaccess.rules "${TDIR}/usr/lib/udev/rules.d" || gen_die "Failed to copy '70-uaccess.rules'!"
1328
	cp -aL /lib/udev/rules.d/71-seat.rules "${TDIR}/usr/lib/udev/rules.d" || gen_die "Failed to copy '71-seat.rules'!"
1329
1330
	# clean up
1331
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1332
	log_future_cpio_content
1333
	find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
1334
		|| gen_die "Failed to append ${PN} to cpio!"
1335
1336
	cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!"
1337
	if isTrue "${CLEANUP}"
1338
	then
1339
		rm -rf "${TDIR}"
1340
	fi
1341
}
1342
1343
append_drm() {
1344
	local PN=drm
1345
	local TDIR="${TEMP}/initramfs-${PN}-${KV}-temp"
1346
	if [ -d "${TDIR}" ]
1347
	then
1348
		rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
1349
	fi
1350
1351
	mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
1352
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1353
1354
	print_info 1 "$(get_indent 1)>> Appending drm drivers..."
1355
1356
	# mkdir -p "${TDIR}/lib/modules/${KV}"
1357
1358
	local drm_path="/lib/modules/${KV}/kernel/drivers/gpu/drm"
1359
	local modules
1360
	if [ -d "${drm_path}" ]
1361
	then
1362
		modules=$(strip_mod_paths $(find "${drm_path}" -name "*.ko"))
1363
	else
1364
		print_info 1 "$(get_indent 2)Warning :: no drm modules in drivers/gpu/drm..."
1365
	fi
1366
1367
	rm -f "${TEMP}/moddeps" || gen_die "Failed to clear old moddeps!"
1368
	gen_deps ${modules}
1369
	if [ -f "${TEMP}/moddeps" ]
1370
	then
1371
		modules=$(cat "${TEMP}/moddeps" | sort | uniq)
1372
	else
1373
		print_info 1 "$(get_indent 2)Warning :: module dependencies not generated..."
1374
	fi
1375
1376
	local mod i fws fw
1377
	for i in ${modules}
1378
	do
1379
		mod=$(find "/lib/modules/${KV}" -name "${i}.ko" 2>/dev/null| head -n 1)
1380
		if [ -z "${mod}" ]
1381
		then
1382
			print_info 1 "$(get_indent 2)Warning :: ${i}.ko not found; skipping..."
1383
			continue
1384
		fi
1385
1386
		print_info 1 "$(get_indent 2)>> Copying ${mod}..."
1387
		cp -ax --parents "${mod}" "${TDIR}" || gen_die "Failed to copy '${mod}'!"
1388
1389
		# check that firmware files exist, then copy them (modinfo may list deprecated firmware)
1390
		fws=( $(get_firmware_files "${mod}") )
1391
		for fw in "${fws[@]}"
1392
		do
1393
			if [ -e "/lib/firmware/${fw}" ]
1394
			then
1395
				print_info 1 "$(get_indent 2)>> Copying firmware ${fw}..."
1396
				cp -ax --parents "/lib/firmware/${fw}" "${TDIR}" \
1397
					|| gen_die "Failed to copy ${fw}!"
1398
			fi
1399
		done
1400
	done
1401
1402
	cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
1403
	log_future_cpio_content
1404
	find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
1405
		|| gen_die "Failed to append ${PN} to cpio!"
1406
1407
	cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!"
1408
	if isTrue "${CLEANUP}"
1409
	then
1410
		rm -rf "${TDIR}"
1411
	fi
1412
}
1413
1414
get_firmware_files() {
1415
	local kmod="${1}"
1416
	modinfo --set-version="${KV}" -F firmware "${kmod}" || gen_die "Failed to get modinfo for ${kmod}!"
1417
}
1418
1287
append_strace() {
1419
append_strace() {
1288
	local PN=strace
1420
	local PN=strace
1289
	local TDIR="${TEMP}/initramfs-${PN}-temp"
1421
	local TDIR="${TEMP}/initramfs-${PN}-temp"
Lines 1998-2008 create_initramfs() { Link Here
1998
	append_data 'modprobed'
2130
	append_data 'modprobed'
1999
	append_data 'multipath' "${MULTIPATH}"
2131
	append_data 'multipath' "${MULTIPATH}"
2000
	append_data 'splash' "${SPLASH}"
2132
	append_data 'splash' "${SPLASH}"
2133
	append_data 'plymouth' "${PLYMOUTH}"
2001
	append_data 'strace' "${STRACE}"
2134
	append_data 'strace' "${STRACE}"
2002
	append_data 'unionfs_fuse' "${UNIONFS}"
2135
	append_data 'unionfs_fuse' "${UNIONFS}"
2003
	append_data 'xfsprogs' "${XFSPROGS}"
2136
	append_data 'xfsprogs' "${XFSPROGS}"
2004
	append_data 'zfs' "${ZFS}"
2137
	append_data 'zfs' "${ZFS}"
2005
2138
2139
	if isTrue "${PLYMOUTH}"
2140
	then
2141
		append_data 'drm'
2142
	fi
2143
2006
	if isTrue "${ZFS}"
2144
	if isTrue "${ZFS}"
2007
	then
2145
	then
2008
		append_data 'libgcc_s'
2146
		append_data 'libgcc_s'
(-)a/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