centos luks image: use local repo dir, crypttab instead of kernel args
This commit is contained in:
parent
310ab5fd7a
commit
79aaff38b8
2 changed files with 21 additions and 5 deletions
|
@ -93,6 +93,7 @@ dnf -y \
|
||||||
--disablerepo='*' \
|
--disablerepo='*' \
|
||||||
$enabled_repos \
|
$enabled_repos \
|
||||||
--setopt=install_weak_deps=False install \
|
--setopt=install_weak_deps=False install \
|
||||||
|
--setopt=reposdir=rpm-repositories \
|
||||||
bash basesystem systemd dnf centos-release cryptsetup $release_specific_packages
|
bash basesystem systemd dnf centos-release cryptsetup $release_specific_packages
|
||||||
|
|
||||||
mount --bind /dev /mnt/dev
|
mount --bind /dev /mnt/dev
|
||||||
|
@ -144,16 +145,15 @@ run_root systemctl enable chronyd.service
|
||||||
# uncompressed but is a direct dependency of kernel-core...
|
# uncompressed but is a direct dependency of kernel-core...
|
||||||
run_root dnf -y install kernel grub2
|
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 <<EOF
|
cat > /mnt/etc/dracut.conf.d/virtio-blk.conf <<EOF
|
||||||
add_drivers="virtio-blk"
|
add_drivers="virtio-blk"
|
||||||
EOF
|
EOF
|
||||||
kernel_version=$(ls /mnt/boot | grep "vmlinuz.*.$ARCH" | cut -d- -f2-)
|
kernel_version=$(ls /mnt/boot | grep "vmlinuz.*.$ARCH" | cut -d- -f2-)
|
||||||
run_root dracut -v --force --kver $kernel_version
|
|
||||||
|
|
||||||
# Configure grub2.
|
|
||||||
luks_uuid=$(blkid --match-tag UUID --output value "${LOOPBACK_DEVICE}p2")
|
luks_uuid=$(blkid --match-tag UUID --output value "${LOOPBACK_DEVICE}p2")
|
||||||
echo "GRUB_CMDLINE_LINUX='rd.luks.uuid=$luks_uuid'" >> /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-install --target=i386-pc "${LOOPBACK_DEVICE}"
|
||||||
run_root grub2-mkconfig -o /boot/grub2/grub.cfg
|
run_root grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
|
|
||||||
|
|
16
opennebula-images/rpm-repositories/centos-7-minus.repo
Normal file
16
opennebula-images/rpm-repositories/centos-7-minus.repo
Normal file
|
@ -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
|
Loading…
Reference in a new issue