Bug 238301 - [PATCH] handle encrypted swap in dumpon rc.d script
Summary: [PATCH] handle encrypted swap in dumpon rc.d script
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-rc (Nobody)
Keywords: patch
Depends on:
Reported: 2019-06-02 23:02 UTC by rozhuk.im
Modified: 2020-04-16 07:53 UTC (History)
1 user (show)

See Also:
rozhuk.im: maintainer-feedback-

Handle encrypted swap. (429 bytes, patch)
2019-06-02 23:02 UTC, rozhuk.im
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rozhuk.im 2019-06-02 23:02:20 UTC
Created attachment 204791 [details]
Handle encrypted swap.

Then dumpdev="AUTO" then rc.d/dumpon looks for first avail swap file in etc/fstab and if it exist - try to make them as dumpdev.

Typical encrypted swap:
/dev/SOME_DEV.eli none	swap	sw,late,ealgo=AES-XTS,keylen=256,sectorsize=4096 0	0

Then rc.d/dumpon check this - /dev/SOME_DEV.eli does not exist.
Even if it exist it can not be used as dumpdev die to encrypt key will be destroyed on reboot.

Patch simple strip ".eli" from end of devname before check existence.

1. Probably savecore should have some flag to able to write zeros/random on dumpdev after read dump.
2. Feature req: run "trim" for swap before "swapon".
Comment 1 rozhuk.im 2020-04-16 07:53:57 UTC
maintainer timeout