Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 827281
Collapse All | Expand All

(-)genkernel-4.2.5/defaults/initrd.scripts.orig (-29 / +40 lines)
Lines 2320-2356 Link Here
2320
}
2320
}
2321
2321
2322
start_LUKS() {
2322
start_LUKS() {
2323
	# if key is set but neither ssh enabled or key device is given, find
2324
	# the key device
2325
2323
2326
	[ -n "${CRYPT_ROOT_KEY}" ] && [ -z "${CRYPT_ROOT_KEYDEV}" ] \
2324
    [ -z "$1" -o "$1" == "root" ] && decrypt_root="1"
2327
		&& sleep 6 && bootstrapKey "ROOT"
2325
    [ -z "$1" -o "$1" == "swap" ] && decrypt_swap="1"
2328
2326
2329
	if [ -n "${CRYPT_ROOT}" ]
2327
    # if key is set but neither ssh enabled or key device is given, find
2330
	then
2328
    # the key device
2331
		openLUKS "root"
2329
    if [ -n "$decrypt_root" ]
2332
		if [ -n "${REAL_ROOT}" ]
2330
    then
2333
		then
2331
2334
			# Rescan volumes
2332
      [ -n "${CRYPT_ROOT_KEY}" ] && [ -z "${CRYPT_ROOT_KEYDEV}" ] \
2335
			start_volumes
2333
          && sleep 6 && bootstrapKey "ROOT"
2336
		else
2334
2337
			REAL_ROOT="/dev/mapper/root"
2335
      if [ -n "${CRYPT_ROOT}" ]
2338
		fi
2336
      then
2339
	fi
2337
          openLUKS "root"
2340
2338
          if [ -n "${REAL_ROOT}" ]
2341
	# same for swap, but no need to sleep if root was unencrypted
2339
          then
2342
	[ -n "${CRYPT_SWAP_KEY}" ] && [ -z "${CRYPT_SWAP_KEYDEV}" ] \
2340
              # Rescan volumes
2343
		&& { [ -z "${CRYPT_ROOT}" ] && sleep 6; bootstrapKey "SWAP"; }
2341
              start_volumes
2344
2342
          else
2345
	if [ -n "${CRYPT_SWAP}" ]
2343
              REAL_ROOT="/dev/mapper/root"
2346
	then
2344
          fi
2347
		openLUKS "swap"
2345
      fi
2348
		if [ -z "${REAL_RESUME}" ]
2346
2349
		then
2347
    fi
2350
			# Resume from swap as default
2348
2351
			REAL_RESUME="/dev/mapper/swap"
2349
    if [ -n "$decrypt_swap" ]
2352
		fi
2350
    then
2353
	fi
2351
      # same for swap, but no need to sleep if root was unencrypted
2352
      [ -n "${CRYPT_SWAP_KEY}" ] && [ -z "${CRYPT_SWAP_KEYDEV}" ] \
2353
          && { [ -z "${CRYPT_ROOT}" ] && sleep 6; bootstrapKey "SWAP"; }
2354
2355
      if [ -n "${CRYPT_SWAP}" ]
2356
      then
2357
          openLUKS "swap"
2358
          if [ -z "${REAL_RESUME}" ]
2359
          then
2360
              # Resume from swap as default
2361
              REAL_RESUME="/dev/mapper/swap"
2362
          fi
2363
      fi
2364
    fi
2354
}
2365
}
2355
2366
2356
start_sshd() {
2367
start_sshd() {
(-)genkernel-4.2.5/defaults/linuxrc.orig (-1 / +8 lines)
Lines 641-649 Link Here
641
# Initialize LUKS root device except for livecd's
641
# Initialize LUKS root device except for livecd's
642
if [ "${CDROOT}" != '1' ]
642
if [ "${CDROOT}" != '1' ]
643
then
643
then
644
	start_LUKS
645
	if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
644
	if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
646
	then
645
	then
646
647
	  # Skip decrypting root which invoked start_volumes which will import
648
	  # zpools that might already be imported in the resumed system.
649
	  start_LUKS swap
650
647
		case "${REAL_RESUME}" in
651
		case "${REAL_RESUME}" in
648
			LABEL=*|UUID=*|PARTLABEL=*|PARTUUID=*)
652
			LABEL=*|UUID=*|PARTLABEL=*|PARTUUID=*)
649
				RESUME_DEV=""
653
				RESUME_DEV=""
Lines 673-678 Link Here
673
677
674
		do_resume
678
		do_resume
675
	fi
679
	fi
680
681
	# If resume did not success, properly decrypt root.
682
	start_LUKS root
676
fi
683
fi
677
684
678
run mkdir -p "${NEW_ROOT}"
685
run mkdir -p "${NEW_ROOT}"

Return to bug 827281