2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2026-01-25 19:15:04 +00:00

4 Commits

Author SHA1 Message Date
2af13ef626 sysconfig: fix paths for ubuntu versions before 20.04 (fix #3)
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2022-08-04 17:06:27 +02:00
Adphi
0d4379946b Merge pull request #1 from cyrinux/fix/archlinux-mbr-path
fix: add archlinux mbr.bin path
2022-07-21 19:50:04 +02:00
Cyril Levis
e9f3ac9193 fix: add archlinux mbr.bin path 2022-07-20 20:31:36 +02:00
a40b7d3c07 d2vm: fix CentOS install
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2022-04-26 14:59:33 +02:00
3 changed files with 15 additions and 9 deletions

View File

@@ -32,16 +32,13 @@ Working and tested:
- [x] Ubuntu
- [x] Debian
- [x] Alpine
Need fix:
- [ ] CentOS
- [x] CentOS
Unsupported:
- [ ] RHEL
The program use the `/etc/os-release` file to discover the Linux distribution and install the Kernel,
The program uses the `/etc/os-release` file to discover the Linux distribution and install the Kernel,
if the file is missing, the build cannot succeed.
Obviously, **Distroless** images are not supported.

View File

@@ -56,13 +56,13 @@ ff02::3 ip6-allhosts
SAY Now booting the kernel from SYSLINUX...
LABEL linux
KERNEL /boot/vmlinuz-virt
APPEND ro root=UUID=%s rootfstype=ext4 initrd=/boot/initramfs-virt console=ttyS0,115200
APPEND ro root=UUID=%s rootfstype=ext4 initrd=/boot/initramfs-virt console=ttyS0,115200
`
syslinuxCfgCentOS = `DEFAULT linux
SAY Now booting the kernel from SYSLINUX...
LABEL linux
KERNEL /boot/vmlinuz
APPEND ro root=UUID=%s initrd=/boot/initrd.img net.ifnames=0 console=tty0 console=ttyS0,115200n8
APPEND ro root=UUID=%s initrd=/boot/initrd.img net.ifnames=0 console=tty0 console=ttyS0,115200n8
`
)
@@ -78,6 +78,8 @@ var (
"/usr/share/syslinux/mbr.bin",
// centos path
"/usr/share/syslinux/mbr.bin",
// archlinux path
"/usr/lib/syslinux/bios/mbr.bin",
}
)
@@ -322,7 +324,11 @@ func (b *builder) installKernel(ctx context.Context) error {
var sysconfig string
switch b.osRelease.ID {
case ReleaseUbuntu:
sysconfig = syslinuxCfgUbuntu
if b.osRelease.VersionID < "20.04" {
sysconfig = syslinuxCfgDebian
} else {
sysconfig = syslinuxCfgUbuntu
}
case ReleaseDebian:
sysconfig = syslinuxCfgDebian
case ReleaseAlpine:

View File

@@ -7,7 +7,10 @@ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
RUN yum update -y
RUN yum install -y kernel systemd sudo
RUN yum install -y kernel systemd NetworkManager e2fsprogs sudo && \
systemctl enable NetworkManager && \
systemctl unmask systemd-remount-fs.service && \
systemctl unmask getty.target
RUN dracut --no-hostonly --regenerate-all --force && \
cd /boot && \