| @@ -285,29 +285,28 @@ GCP*) · 284 unmodified lines |
| 285 | 285 | |
| 286 | 286 | # Setup GRUB |
| 287 | 287 | mount_pseudofs |
| 288 | | − chroot "${ROOTFS}" grub-install "${LOOPDEV}" |
| 288 | + run_cmd_chroot "${ROOTFS}" "grub-install ${LOOPDEV}" |
| 289 | 289 | sed -i "s:page_poison=1:page_poison=1 console=ttyS0,38400n8d:" "${ROOTFS}/etc/default/grub" |
| 290 | | − chroot "${ROOTFS}" update-grub |
| 291 | | − umount_pseudofs |
| 290 | + run_cmd_chroot "${ROOTFS}" update-grub |
| 292 | 291 | |
| 293 | 292 | # Setup the GCP Guest services |
| 294 | 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 | 295 | done |
| 297 | 296 | |
| 298 | 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 | 300 | # Disable root login over ssh and lock account |
| 302 | 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 | 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 | 307 | # Generate glibc-locales if necessary (this is a noop on musl) |
| 309 | 308 | if [ "$PLATFORM" = GCP ] ; then |
| 310 | | − chroot "${ROOTFS}" xbps-reconfigure -f glibc-locales |
| 309 | + run_cmd_chroot "${ROOTFS}" "xbps-reconfigure -f glibc-locales" |
| 311 | 310 | fi |
| 312 | 311 | |
| 313 | 312 | # Remove SSH host keys (these will get rebuilt on first boot) |
| @@ -316,6 +315,10 @@ GCP*) · 2 unmodified lines |
| 316 | 315 | |
| 317 | 316 | # Force the hostname since this isn't read from DHCP |
| 318 | 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 | 323 | esac |
| 321 | 324 | |