mirror of
https://github.com/linka-cloud/d2vm.git
synced 2025-06-23 13:52:26 +00:00
luks: fix ubuntu <22.04 support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
@ -6,9 +6,6 @@ RUN apk update --no-cache && \
|
||||
apk add \
|
||||
util-linux \
|
||||
linux-virt \
|
||||
{{- if .Luks }}
|
||||
cryptsetup \
|
||||
{{- end }}
|
||||
{{- if ge .Release.VersionID "3.17" }}
|
||||
busybox-openrc \
|
||||
busybox-mdev-openrc \
|
||||
@ -34,7 +31,8 @@ iface eth0 inet dhcp\n\
|
||||
{{ end }}
|
||||
|
||||
{{- if .Luks }}
|
||||
RUN source /etc/mkinitfs/mkinitfs.conf && \
|
||||
RUN apk add --no-cache cryptsetup && \
|
||||
source /etc/mkinitfs/mkinitfs.conf && \
|
||||
echo "features=\"${features} cryptsetup\"" > /etc/mkinitfs/mkinitfs.conf && \
|
||||
mkinitfs $(ls /lib/modules)
|
||||
{{- end }}
|
||||
|
@ -12,17 +12,19 @@ RUN yum install -y \
|
||||
systemd \
|
||||
NetworkManager \
|
||||
e2fsprogs \
|
||||
{{- if .Luks }}
|
||||
cryptsetup \
|
||||
{{- end }}
|
||||
sudo && \
|
||||
systemctl enable NetworkManager && \
|
||||
systemctl unmask systemd-remount-fs.service && \
|
||||
systemctl unmask getty.target
|
||||
|
||||
RUN dracut --no-hostonly --regenerate-all --force {{ if .Luks }}--install="/usr/sbin/cryptsetup"{{ end }}&& \
|
||||
systemctl unmask getty.target && \
|
||||
cd /boot && \
|
||||
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
|
||||
ln -s $(find . -name 'initramfs-*.img') initrd.img
|
||||
|
||||
{{ if .Luks }}
|
||||
RUN yum install -y cryptsetup && \
|
||||
dracut --no-hostonly --regenerate-all --force --install="/usr/sbin/cryptsetup" && \
|
||||
{{ else }}
|
||||
RUN dracut --no-hostonly --regenerate-all --force
|
||||
{{ end }}
|
||||
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
@ -4,9 +4,6 @@ USER root
|
||||
|
||||
RUN apt-get -y update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
||||
{{- if .Luks }}
|
||||
cryptsetup-initramfs \
|
||||
{{- end }}
|
||||
linux-image-amd64
|
||||
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
@ -47,5 +44,6 @@ iface eth0 inet dhcp\n\
|
||||
|
||||
|
||||
{{- if .Luks }}
|
||||
RUN update-initramfs -u -v
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cryptsetup-initramfs && \
|
||||
update-initramfs -u -v
|
||||
{{- end }}
|
||||
|
@ -6,9 +6,6 @@ RUN apt-get update -y && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
||||
linux-image-virtual \
|
||||
initramfs-tools \
|
||||
{{- if .Luks }}
|
||||
cryptsetup-initramfs \
|
||||
{{- end }}
|
||||
systemd-sysv \
|
||||
systemd \
|
||||
dbus \
|
||||
@ -45,5 +42,6 @@ iface eth0 inet dhcp\n\
|
||||
{{ end }}
|
||||
|
||||
{{- if .Luks }}
|
||||
RUN update-initramfs -u -v
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cryptsetup-initramfs && \
|
||||
update-initramfs -u -v
|
||||
{{- end }}
|
||||
|
Reference in New Issue
Block a user