From fa3a4f6039d305793b8161307e79b93bec6c716e Mon Sep 17 00:00:00 2001 From: Adphi Date: Thu, 21 Apr 2022 21:31:57 +0200 Subject: [PATCH] d2vm: remove non working rhel support Signed-off-by: Adphi --- README.md | 6 +++++- builder.go | 2 +- dockerfile.go | 2 +- os_release.go | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 01e96d4..710197c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,11 @@ Working and tested: Need fix: -- [ ] CentOS / RHEL +- [ ] CentOS + +Unsupported: + +- [ ] RHEL The program use the `/etc/os-release` file to discover the Linux distribution and install the Kernel, if the file is missing, the build cannot succeed. diff --git a/builder.go b/builder.go index 7f0e35e..e86f7d5 100644 --- a/builder.go +++ b/builder.go @@ -333,7 +333,7 @@ func (b *builder) installKernel(ctx context.Context) error { sysconfig = syslinuxCfgDebian case ReleaseAlpine: sysconfig = syslinuxCfgAlpine - case ReleaseCentOS, ReleaseRHEL: + case ReleaseCentOS: sysconfig = syslinuxCfgCentOS default: return fmt.Errorf("%s: distribution not supported", b.osRelease.ID) diff --git a/dockerfile.go b/dockerfile.go index de1511b..cc09d8c 100644 --- a/dockerfile.go +++ b/dockerfile.go @@ -63,7 +63,7 @@ func NewDockerfile(release OSRelease, img, password string) (Dockerfile, error) d.tmpl = ubuntuDockerfileTemplate case ReleaseAlpine: d.tmpl = alpineDockerfileTemplate - case ReleaseCentOS, ReleaseRHEL: + case ReleaseCentOS: d.tmpl = centOSDockerfileTemplate default: return Dockerfile{}, fmt.Errorf("unsupported distribution: %s", release.ID) diff --git a/os_release.go b/os_release.go index d93c526..b82b98a 100644 --- a/os_release.go +++ b/os_release.go @@ -46,8 +46,10 @@ func (r Release) Supported() bool { return true case ReleaseAlpine: return true - case ReleaseCentOS, ReleaseRHEL: + case ReleaseCentOS: return true + case ReleaseRHEL: + return false default: return false }