Skip to content

Commit

Permalink
CentOS Stream ISOs updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
ladar committed Sep 20, 2023
1 parent 62b8eea commit e8f7a17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion generic-libvirt.json
Original file line number Diff line number Diff line change
Expand Up @@ -5914,7 +5914,7 @@
"/bin/sh<enter><wait10>",
"dhclient -l /tmp/dhclient.lease.vtnet0 vtnet0<enter><wait5>",
"fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/generic.dragonflybsd6.vagrant.cfg<enter><wait10>",
"sh -ex /tmp/installerconfig<enter><wait>"
"sh -ex /tmp/installerconfig && reboot<enter><wait>"
],
"format": "qcow2",
"disk_size": "131072",
Expand Down
24 changes: 14 additions & 10 deletions http/generic.dragonflybsd6.vagrant.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,32 @@ nameserver 4.2.2.2
nameserver 208.67.220.220
EOF

ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install sed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install curl
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install sudo
# The pkg command requires a valid /dev/null path, so we fake it with an
# empty file.
touch /mnt/dev/null
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg update
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install gsed
ASSUME_ALWAYS_YES=yes FETCH_RETRY=5 chroot /mnt pkg install bash
rm -f /mnt/dev/null

# Setup bash a valid login shell.
chroot /mnt ln /usr/local/bin/bash /usr/bin/bash
chroot /mnt ln /usr/local/bin/bash /bin/bash
# Setup bash as a valid login shell. If this step fails, it will prevent the
# the root user from being able to login. So we abort the install instead.
chroot /mnt ln /usr/local/bin/bash /usr/bin/bash || exit 1
chroot /mnt ln /usr/local/bin/bash /bin/bash || exit 1

cat <<-EOF >> /mnt/etc/shells
/usr/bin/bash
/bin/bash
EOF

echo 'vagrant' | chroot /mnt pw user mod root -h 0 -n root
chroot /mnt chsh -s /usr/bin/bash root
chroot /mnt pwd_mkdb /etc/master.passwd
echo 'vagrant' | chroot /mnt pw user mod root -h 0 -n root || exit 1
chroot /mnt chsh -s /usr/bin/bash root || exit 1
chroot /mnt pwd_mkdb /etc/master.passwd || exit 1

# Modify OpenSSH to allow root logins.
sed -i -e "s/^[# ]*UseDNS.*/UseDNS no/g" /mnt/etc/ssh/sshd_config
sed -i -e "s/^[# ]*UsePAM.*/UsePAM yes/g" /mnt/etc/ssh/sshd_config
sed -i -e "s/^[# ]*PermitRootLogin.*/PermitRootLogin yes/g" /mnt/etc/ssh/sshd_config
sed -i -e "s/^[# ]*PasswordAuthentication.*/PasswordAuthentication yes/g" /mnt/etc/ssh/sshd_config

#reboot
reboot

0 comments on commit e8f7a17

Please sign in to comment.