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

Add ArchLinux support #33

Merged
merged 1 commit into from
Aug 10, 2021
Merged

Add ArchLinux support #33

merged 1 commit into from
Aug 10, 2021

Conversation

erdii
Copy link
Contributor

@erdii erdii commented Aug 9, 2021

sibling PR: k0sproject/k0sctl#183

@erdii erdii force-pushed the add-archlinux-support branch from 420a3ea to 08887aa Compare August 9, 2021 16:43
@erdii erdii marked this pull request as ready for review August 9, 2021 17:03
)

// ArchlinuxARM provides OS support for ArchlinuxARM systems
type ArchlinuxARM struct {
Copy link
Contributor

@kke kke Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should just be ArchLinux as it will be detected as well and things here should work with the non-arm arch as well.


// InstallPackage installs packages via pacman
func (c ArchlinuxARM) InstallPackage(h os.Host, s ...string) error {
return h.Execf("pacman -S --noconfirm %s", strings.Join(s, " "))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs sudo, maybe add --noprogressbar to get a bit cleaner log output.

Suggested change
return h.Execf("pacman -S --noconfirm %s", strings.Join(s, " "))
return h.Execf("sudo pacman -S --noconfirm --noprogressbar %s", strings.Join(s, " "))

resolver.go Outdated
Comment on lines 126 to 131
versionNeeded := true
if os.IDLike == "arch" {
versionNeeded = false
}

if os.ID == "" || (versionNeeded && os.Version == "") {
Copy link
Contributor

@kke kke Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more future proof solution would be to change the switch-case thing above to set the version to something like 0.0.0.

case "ID_LIKE":
		os.IDLike = unquote(fields[1])
		if os.IDLike == "arch" {
				os.Version = "0.0.0"
		}

@kke kke changed the title add archlinux support Add ArchLinux support Aug 10, 2021
@erdii erdii force-pushed the add-archlinux-support branch from 08887aa to f0ba043 Compare August 10, 2021 08:25
@erdii
Copy link
Contributor Author

erdii commented Aug 10, 2021

Heyo @kke 👋
Good catches! I've incorporated all of your suggestions :)

@kke kke merged commit a79e60c into k0sproject:main Aug 10, 2021
@erdii erdii deleted the add-archlinux-support branch August 10, 2021 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants