Skip to content

resolv.conf is not correctly restored after add-autoinstall-config #36

@imolein

Description

@imolein

Today I used this script to add a package and an autoinstall config to the installer. During the installation I noticed that the name resolution was not working and looking into /etc showed me an incorrectly static resolv.conf and a resolv.conf.tmp symlink.

I looked into the source code and tracked it down to the setup_rootfs() function. This function calls the context method add_sys_mounts() which adds a _pre_repack callback, to restore the original resolv.conf. After this setup_rootfs() addes a _pre_repack callback too, which creates the custom squashfs. Since pre_repack hooks are later called in reverse by the repack() method, the custom squashfs is build before the original resolv.conf is restored.
For myself I fixed it by adding the pre_repack hook from setup_rootfs to the front of the list. I don't know if there are any side effects doing it this way if a more complicated action.yaml is used, because mine is very simple:

- name: add-debs-to-pool
  debs:
    - helper/subiquity-speed-up_1_all.deb

- name: add-autoinstall-config
  autoinstall_config: user-data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions