| @@ -285,29 +285,28 @@ GCP*) · 284 unmodified lines |
| 285 | | 285 | |
| 286 | # Setup GRUB | 286 | # Setup GRUB |
| 287 | mount_pseudofs | 287 | mount_pseudofs |
| 288 | chroot "${ROOTFS}" grub-install "${LOOPDEV}" | 288 | run_cmd_chroot "${ROOTFS}" "grub-install ${LOOPDEV}" |
| 289 | sed -i "s:page_poison=1:page_poison=1 console=ttyS0,38400n8d:" "${ROOTFS}/etc/default/grub" | 289 | sed -i "s:page_poison=1:page_poison=1 console=ttyS0,38400n8d:" "${ROOTFS}/etc/default/grub" |
| 290 | chroot "${ROOTFS}" update-grub | 290 | run_cmd_chroot "${ROOTFS}" update-grub |
| 291 | umount_pseudofs | | |
| 292 | | 291 | |
| 293 | # Setup the GCP Guest services | 292 | # Setup the GCP Guest services |
| 294 | for _service in dhcpcd sshd agetty-console nanoklogd socklog-unix GCP-Guest-Initialization GCP-accounts GCP-clock-skew GCP-ip-forwarding ; do | 293 | for _service in dhcpcd sshd agetty-console nanoklogd socklog-unix GCP-Guest-Initialization GCP-accounts GCP-clock-skew GCP-ip-forwarding ; do |
| 295 | chroot "${ROOTFS}" ln -sv /etc/sv/$_service /etc/runit/runsvdir/default/$_service | 294 | run_cmd_chroot "${ROOTFS}" "ln -sv /etc/sv/$_service /etc/runit/runsvdir/default/$_service" |
| 296 | done | 295 | done |
| 297 | | 296 | |
| 298 | # Turn off the agetty's since we can't use them anyway | 297 | # Turn off the agetty's since we can't use them anyway |
| 299 | rm -v "${ROOTFS}/etc/runit/runsvdir/default/agetty-tty*" | 298 | rm -v "${ROOTFS}/etc/runit/runsvdir/default/agetty-tty"* |
| 300 | | 299 | |
| 301 | # Disable root login over ssh and lock account | 300 | # Disable root login over ssh and lock account |
| 302 | sed -i "s:PermitRootLogin yes:PermitRootLogin no:" "${ROOTFS}/etc/ssh/sshd_config" | 301 | sed -i "s:PermitRootLogin yes:PermitRootLogin no:" "${ROOTFS}/etc/ssh/sshd_config" |
| 303 | chroot "${ROOTFS}" passwd -l root | 302 | run_cmd_chroot "${ROOTFS}" "passwd -l root" |
| 304 | | 303 | |
| 305 | # Set the Timezone | 304 | # Set the Timezone |
| 306 | chroot "${ROOTFS}" ln -svf /usr/share/zoneinfo/UTC /etc/localtime | 305 | run_cmd_chroot "${ROOTFS}" "ln -svf /usr/share/zoneinfo/UTC /etc/localtime" |
| 307 | | 306 | |
| 308 | # Generate glibc-locales if necessary (this is a noop on musl) | 307 | # Generate glibc-locales if necessary (this is a noop on musl) |
| 309 | if [ "$PLATFORM" = GCP ] ; then | 308 | if [ "$PLATFORM" = GCP ] ; then |
| 310 | chroot "${ROOTFS}" xbps-reconfigure -f glibc-locales | 309 | run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f glibc-locales" |
| 311 | fi | 310 | fi |
| 312 | | 311 | |
| 313 | # Remove SSH host keys (these will get rebuilt on first boot) | 312 | # Remove SSH host keys (these will get rebuilt on first boot) |
| @@ -316,6 +315,10 @@ GCP*) · 2 unmodified lines |
| 316 | | 315 | |
| 317 | # Force the hostname since this isn't read from DHCP | 316 | # Force the hostname since this isn't read from DHCP |
| 318 | echo void-GCE > "${ROOTFS}/etc/hostname" | 317 | echo void-GCE > "${ROOTFS}/etc/hostname" |
| | 318 | |
| | 319 | # Cleanup the chroot from anything that was setup for the |
| | 320 | # run_cmd_chroot commands |
| | 321 | cleanup_chroot |
| 319 | ;; | 322 | ;; |
| 320 | esac | 323 | esac |
| 321 | | 324 | |