#!/bin/sh PREREQ="" prereqs() { echo "$PREREQ" } case $1 in # get pre-requisites prereqs) prereqs exit 0 ;; esac . /usr/share/initramfs-tools/scripts/functions # First check if a location is set and is a valid swap partition. # If so, the config file will be copied in and there is nothing to do. if [ -n "$RESUME" ] && [ "$RESUME" != auto ]; then if [ "$RESUME" = none ]; then exit 0 fi if resume_dev_node="$(resolve_device "$RESUME")" && \ blkid -p -n swap "$resume_dev_node" >/dev/null 2>&1; then exit 0 fi echo >&2 "W: initramfs-tools configuration sets RESUME=$RESUME" echo >&2 "W: but no matching swap device is available." fi # If we were not explicitly requested to select a device, report that we # are doing so report_auto() { test "$RESUME" = auto || echo >&2 "I: $*" } # We need to be able to read the listed swap partitions if ischroot || [ ! -r /proc/swaps ]; then resume_auto= else # Try to autodetect the RESUME partition, using biggest swap? resume_auto=$(grep ^/dev/ /proc/swaps | sort -rnk3 | head -n 1 | cut -d " " -f 1) if [ -n "$resume_auto" ]; then dm_name="$(dmsetup info -c --noheadings -o name "$resume_auto" 2>/dev/null)" fi if [ -n "$dm_name" ] && [ -e /etc/crypttab ]; then while read cryptdev srcdev keyfile junk; do if [ "$cryptdev" = "$dm_name" ] && [ "$keyfile" = /dev/urandom ]; then resume_auto= fi done < /etc/crypttab fi if [ -n "$resume_auto" ]; then if [ -n "$dm_name" ]; then resume_auto_canon="/dev/mapper/$dm_name" elif UUID=$(blkid -s UUID -o value "$resume_auto"); then resume_auto_canon="UUID=$UUID" else resume_auto_canon= fi report_auto "The initramfs will attempt to resume from $resume_auto" if [ -n "$resume_auto_canon" ]; then report_auto "($resume_auto_canon)" resume_auto="$resume_auto_canon" fi report_auto "Set the RESUME variable to override this." fi fi # Write selected resume device to intramfs conf.d if [ "$RESUME" = auto ] || [ -n "$resume_auto" ]; then # If we were explicitly requested to select a device, and we failed, # report that if [ -z "$resume_auto" ]; then echo >&2 "W: initramfs-tools failed to select a resume device" fi echo "RESUME=${resume_auto}" > ${DESTDIR}/conf/conf.d/zz-resume-auto fi
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
bcache | File | 543 B | 0755 |
|
btrfs | File | 597 B | 0755 |
|
cloud-initramfs-dyn-netconf | File | 118 B | 0755 |
|
compcache | File | 3.52 KB | 0755 |
|
console_setup | File | 3.07 KB | 0755 |
|
copymods | File | 280 B | 0755 |
|
cryptgnupg | File | 979 B | 0755 |
|
cryptkeyctl | File | 451 B | 0755 |
|
cryptopenct | File | 1.53 KB | 0755 |
|
cryptopensc | File | 1.81 KB | 0755 |
|
cryptpassdev | File | 913 B | 0755 |
|
cryptroot | File | 24.48 KB | 0755 |
|
cryptroot-unlock | File | 425 B | 0755 |
|
dmsetup | File | 506 B | 0755 |
|
fixrtc | File | 412 B | 0755 |
|
framebuffer | File | 528 B | 0755 |
|
fsck | File | 2.1 KB | 0755 |
|
fuse | File | 230 B | 0755 |
|
iscsi | File | 724 B | 0755 |
|
kbd | File | 301 B | 0755 |
|
klibc-utils | File | 843 B | 0755 |
|
kmod | File | 424 B | 0755 |
|
lvm2 | File | 670 B | 0755 |
|
mdadm | File | 2.83 KB | 0755 |
|
ntfs_3g | File | 304 B | 0755 |
|
overlayroot | File | 732 B | 0755 |
|
plymouth | File | 5.15 KB | 0755 |
|
resume | File | 2.21 KB | 0755 |
|
thermal | File | 1.25 KB | 0755 |
|
udev | File | 1.67 KB | 0755 |
|
zz-busybox-initramfs | File | 1.33 KB | 0755 |
|
zz-dhclient | File | 411 B | 0755 |
|