Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 /etc/os-release with duplicated arguments when customizing disk image #1365

Closed
mauromorales opened this issue Apr 28, 2023 · 1 comment · Fixed by #1406
Closed

🐛 /etc/os-release with duplicated arguments when customizing disk image #1365

mauromorales opened this issue Apr 28, 2023 · 1 comment · Fixed by #1406
Assignees
Labels
bug Something isn't working

Comments

@mauromorales
Copy link
Member

mauromorales commented Apr 28, 2023

When customizing a disk image for the RPi, the /etc/os-release file gets appended with the new info of the OS but it never cleans the previous arguments

wrong:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.17.3
PRETTY_NAME="Alpine Linux v3.17"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
KAIROS_NAME="kairos-core-alpine-arm-rpi"
KAIROS_VERSION="v2.0.2"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-core-alpine-arm-rpi"
KAIROS_VERSION_ID="v2.0.2"
KAIROS_PRETTY_NAME="kairos-core-alpine-arm-rpi v2.0.2"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_IMAGE_REPO="quay.io/kairos/core-alpine-arm-rpi"
KAIROS_IMAGE_LABEL="latest"
KAIROS_GITHUB_REPO="kairos-io/kairos"
KAIROS_VARIANT="core"
KAIROS_FLAVOR="alpine-arm-rpi"KAIROS_NAME="kairos-alpine-arm-rpi"
KAIROS_VERSION="v2.0.2-k3sv1.26.4+k3s1"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-alpine-arm-rpi"
KAIROS_VERSION_ID="v2.0.2-k3sv1.26.4+k3s1"
KAIROS_PRETTY_NAME="kairos-alpine-arm-rpi v2.0.2-k3sv1.26.4+k3s1"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues/new/choose"
KAIROS_HOME_URL="https://github.com/kairos-io/provider-kairos"
KAIROS_IMAGE_REPO="quay.io/kairos/kairos-alpine-arm-rpi"
KAIROS_IMAGE_LABEL="latest"
KAIROS_GITHUB_REPO="kairos-io/provider-kairos"
KAIROS_VARIANT="core"

Expected:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.17.3
PRETTY_NAME="Alpine Linux v3.17"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
KAIROS_NAME="kairos-alpine-arm-rpi"
KAIROS_VERSION="v2.0.2-k3sv1.26.4+k3s1"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-alpine-arm-rpi"
KAIROS_VERSION_ID="v2.0.2-k3sv1.26.4+k3s1"
KAIROS_PRETTY_NAME="kairos-alpine-arm-rpi v2.0.2-k3sv1.26.4+k3s1"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues/new/choose"
KAIROS_HOME_URL="https://github.com/kairos-io/provider-kairos"
KAIROS_IMAGE_REPO="quay.io/kairos/kairos-alpine-arm-rpi"
KAIROS_IMAGE_LABEL="latest"
KAIROS_GITHUB_REPO="kairos-io/provider-kairos"
KAIROS_VARIANT="core"
@mauromorales mauromorales added the bug Something isn't working label Apr 28, 2023
@mauromorales mauromorales assigned mudler and unassigned mudler Apr 28, 2023
@mauromorales mauromorales changed the title 🐛 /etc/os-release with duplicated argumetns when 🐛 /etc/os-release with duplicated arguments when customizing disk image Apr 28, 2023
@jimmykarily jimmykarily moved this to Todo 🖊 in 🧙Issue tracking board May 2, 2023
@mauromorales mauromorales self-assigned this May 2, 2023
@jimmykarily
Copy link
Contributor

There is more. Booting a release ubuntu provider image (https://github.com/kairos-io/provider-kairos/releases/download/v2.0.3/kairos-ubuntu-20-lts-v2.0.3-k3sv1.22.17+k3s1.iso) I get this:

root@localhost:~# cat /etc/os-release | grep opensuse
KAIROS_FLAVOR="opensuse-leap"

and this:

root@localhost:~# cat /etc/os-release | grep core
KAIROS_NAME="kairos-core-ubuntu-20-lts"
KAIROS_ID_LIKE="kairos-core-ubuntu-20-lts"
KAIROS_PRETTY_NAME="kairos-core-ubuntu-20-lts v2.0.3"
KAIROS_IMAGE_REPO="quay.io/kairos/core-ubuntu-20-lts"
KAIROS_VARIANT="core"
KAIROS_VARIANT="core"

This "append" bug could explain some of this but having opensuse in an ubuntu image is probably a different bug. I think when we call OSRELEASE target here: https://github.com/kairos-io/provider-kairos/blob/99b8b7c53c19779007790400e14ee2de57be6132/Earthfile#LL178C2-L178C2 we are not setting all the required env vars for this envsubst command:

RUN envsubst >>/etc/os-release </usr/lib/os-release.tmpl
thus some defaults are being used and they are set to opensuse. We need to fix that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants