_should_add_swapfile logic not honored during autoinstall

Bug #1883706 reported by Will Brown
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
subiquity
Triaged
Medium
Unassigned

Bug Description

During autoinstall I have both a swap partition and btrfs root partition defined and I still end up with swap.img in my installed fstab. According to the logic in _should_add_swapfile both of these conditions should prevent adding a swapfile.

#cloud-config
autoinstall:
  version: 1
  storage:
    config:
    ### drive
    - id: disk0
      type: disk
      ptable: gpt
      grub_device: true
      preserve: false
      wipe: superblock
      match:
        size: largest
    ### partitions
    - id: efi_partition
      type: partition
      size: 512MB
      device: disk0
      flag: boot
      grub_device: true
      preserve: false
    - id: swap_partition
      type: partition
      size: 8GB
      device: disk0
      flag: swap
      preserve: false
    - id: root_partition
      type: partition
      size: -1
      device: disk0
      preserve: false
    ### format and mount efi partition
    - id: efi_format
      type: format
      fstype: fat32
      volume: efi_partition
      preserve: false
    - id: efi_mount
      type: mount
      path: /boot/efi
      device: efi_format
    ### format and mount swap partition
    - id: swap_format
      type: format
      fstype: swap
      volume: swap_partition
      preserve: false
    - id: swap_mount
      path: none
      type: mount
      device: swap_format
    ### format and mount root partition
    - id: root_format
      type: format
      fstype: btrfs
      volume: root_partition
      preserve: false
    - id: root_mount
      type: mount
      path: /
      device: root_format

Tags: easy
tags: added: easy
Changed in subiquity:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
sascha arthur (sarthur) wrote :

can confirm that it seems that theres no way to get rid of the swap.img file..

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Re: [Bug 1883706] Re: _should_add_swapfile logic not honored during autoinstall

Hm I fixed a bug like this recently, could you try the edge channel?
Instructions here
https://discourse.ubuntu.com/t/how-to-test-the-latest-version-of-subiquity/12428

On Mon, 7 Jun 2021, 03:35 sascha arthur, <email address hidden> wrote:

> can confirm that it seems that theres no way to get rid of the swap.img
> file..
>
> --
> You received this bug notification because you are subscribed to
> subiquity.
> https://bugs.launchpad.net/bugs/1883706
>
> Title:
> _should_add_swapfile logic not honored during autoinstall
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/subiquity/+bug/1883706/+subscriptions
>

Revision history for this message
Jamie Murphy (itjamie) wrote :

I am experiencing this on even the latest 22.04 installer (even tried via netboot.xyz pointing to latest 22.04.1 with an autoinstall url )

Ive tried doing the "swap:swap:0" fix recommended in discource but that also didnt work ( the install completed but it still had swap.img created and a higher priority than the swap partition created inside the config block)

```
  swap:
    swap: 0
  storage:
    swap:
      swap: 0
    config: [redacted]
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.