diff --git a/opennebula-images/centos-build-luks-opennebula-image.sh b/opennebula-images/centos-build-luks-opennebula-image.sh index d577e9f..f39d937 100755 --- a/opennebula-images/centos-build-luks-opennebula-image.sh +++ b/opennebula-images/centos-build-luks-opennebula-image.sh @@ -93,6 +93,7 @@ dnf -y \ --disablerepo='*' \ $enabled_repos \ --setopt=install_weak_deps=False install \ + --setopt=reposdir=rpm-repositories \ bash basesystem systemd dnf centos-release cryptsetup $release_specific_packages mount --bind /dev /mnt/dev @@ -144,16 +145,15 @@ run_root systemctl enable chronyd.service # uncompressed but is a direct dependency of kernel-core... run_root dnf -y install kernel grub2 -# Add support for virtio block devices at boot time. +# Add support for virtio block devices at boot time, configure bootloader. cat > /mnt/etc/dracut.conf.d/virtio-blk.conf <> /mnt/etc/default/grub +echo "cryptroot UUID=$luks_uuid luks,timeout=30" >> /mnt/etc/crypttab + +run_root dracut -v --force --kver $kernel_version run_root grub2-install --target=i386-pc "${LOOPBACK_DEVICE}" run_root grub2-mkconfig -o /boot/grub2/grub.cfg diff --git a/opennebula-images/rpm-repositories/centos-7-minus.repo b/opennebula-images/rpm-repositories/centos-7-minus.repo new file mode 100644 index 0000000..53bae51 --- /dev/null +++ b/opennebula-images/rpm-repositories/centos-7-minus.repo @@ -0,0 +1,16 @@ +[base] +name=CentOS-$releasever - Base +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 + +#released updates +[updates] +name=CentOS-$releasever - Updates +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra +#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ +gpgcheck=0 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7