Merge ~mwhudson/curtin:lp-1918990-dd-ext2 into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: 26ae9cf78c6875f83a197d468eddfe9b3458fb2e
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:lp-1918990-dd-ext2
Merge into: curtin:master
Diff against target: 18 lines (+4/-3)
1 file modified
curtin/swap.py (+4/-3)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+400074@code.launchpad.net

Commit message

swap: use dd to allocate swapfiles on ext2 and ext3

LP: #1918990

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

LGTM, one nit if you're so inclined.

review: Approve
~mwhudson/curtin:lp-1918990-dd-ext2 updated
26ae9cf... by Michael Hudson-Doyle

sort list

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Thanks, may as well do that. Now I guess I should go and figure out why jenkins isn't running CI jobs...

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/swap.py b/curtin/swap.py
2index 11e95c4..7a0128d 100644
3--- a/curtin/swap.py
4+++ b/curtin/swap.py
5@@ -135,9 +135,10 @@ def setup_swapfile(target, fstab=None, swapfile=None, size=None, maxsize=None,
6
7 allocate_cmd = 'fallocate -l "${2}M" "$1"'
8 # fallocate uses IOCTLs to allocate space in a filesystem, however it's not
9- # clear (from curtin's POV) that it creates non-sparse files as required by
10- # mkswap so we'll skip fallocate for now and use dd.
11- if fstype in ['btrfs', 'xfs']:
12+ # clear (from curtin's POV) that it creates non-sparse files on btrfs or
13+ # xfs as required by mkswap so we'll skip fallocate for now and use dd. It
14+ # is also plain not supported on ext2 and ext3.
15+ if fstype in ['btrfs', 'ext2', 'ext3', 'xfs']:
16 allocate_cmd = 'dd if=/dev/zero "of=$1" bs=1M "count=$2"'
17
18 mbsize = str(int(size / (2 ** 20)))

Subscribers

People subscribed via source and target branches