Changeset 2f6d8ec for postlfs


Ignore:
Timestamp:
09/07/2019 01:43:10 PM (5 years ago)
Author:
Pierre Labastie <pieere@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 9.1, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, lazarus, lxqt, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
810c25c
Parents:
57394c4
Message:

Add the possibility for resuming from disk in initramfs. This allows kernel
command lines like this:
linux /boot/vmlinuz-5.2.11-lfs-SVN-20190902 root=UUID=47a81d89-8788-4ec4-99dd-0f3a0943e96b resume=LABEL=MYSWAP ro
initrd /boot/initrd.img-5.2.11-lfs-1

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@22107 af4574ff-66df-0310-9fd7-8a98e5e911e0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postlfs/filesystems/initramfs.xml

    r57394c4 r2f6d8ec  
    223223  cp -a /lib/systemd $WDIR/lib
    224224fi
     225if [ -d /lib/elogind ]; then
     226  cp -a /lib/elogind $WDIR/lib
     227fi
    225228
    226229# Install the kernel modules if requested
     
    306309}
    307310
     311do_try_resume()
     312{
     313   case "$resume" in
     314      UUID=* ) eval $resume; resume="/dev/disk/by-uuid/$UUID"  ;;
     315      LABEL=*) eval $resume; resume="/dev/disk/by-label/$LABEL" ;;
     316   esac
     317
     318   if $noresume || ! [ -b "$resume" ]; then return; fi
     319
     320   ls -lH "$resume" | ( read x x x x maj min x
     321       echo -n ${maj%,}:$min &gt; /sys/power/resume )
     322}
     323
    308324init=/sbin/init
    309325root=
     
    313329rootflags=
    314330device=
     331resume=
     332noresume=false
    315333
    316334mount -n -t devtmpfs devtmpfs /dev
     
    328346    rootfstype=*) rootfstype=${param#rootfstype=} ;;
    329347    rootflags=* ) rootflags=${param#rootflags=}   ;;
     348    resume=*    ) resume=${param#resume=}         ;;
     349    noresume    ) noresume=true                   ;;
    330350    ro          ) ro="ro"                         ;;
    331351    rw          ) ro="rw"                         ;;
     
    353373if [ -n "$rootdelay"    ] ; then sleep "$rootdelay"              ; fi
    354374
     375do_try_resume # This function will not return if resuming from disk
    355376do_mount_root
    356377
Note: See TracChangeset for help on using the changeset viewer.