Bump clsetup and rename to cloudsetup
This commit is contained in:
parent
2a0b713a78
commit
2b71524438
|
@ -16,14 +16,14 @@ IMAGE_PATH_UFS=freebsd-ufs-$RELEASE-$(date -I).img.qcow2
|
||||||
IMAGE_SIZE=10G
|
IMAGE_SIZE=10G
|
||||||
|
|
||||||
DIST_BASE="https://download.freebsd.org/ftp/releases/$ARCH/$RELEASE"
|
DIST_BASE="https://download.freebsd.org/ftp/releases/$ARCH/$RELEASE"
|
||||||
CLSETUP_COMMIT=82d7d16ff14e1893f06f39788bb7cd8604284583
|
CLOUDSETUP_COMMIT=4ac15b8647d5525048c5faa5fd4b28491905d000
|
||||||
CLSETUP_URL="https://git.sr.ht/~jornane/clsetup/archive/$CLSETUP_COMMIT.tar.gz"
|
CLOUDSETUP_URL="https://git.sr.ht/~jornane/cloudsetup/archive/$CLOUDSETUP_COMMIT.tar.gz"
|
||||||
ZPOOL=zroot
|
ZPOOL=zroot
|
||||||
ZPOOL_TMP="zinstalling"
|
ZPOOL_TMP="zinstalling"
|
||||||
|
|
||||||
ZFSTARGET="$(mktemp -d /var/tmp/zfsbuild.XXXXX)"
|
ZFSTARGET="$(mktemp -d /var/tmp/zfsbuild.XXXXX)"
|
||||||
UFSTARGET="$(mktemp -d /var/tmp/ufsbuild.XXXXX)"
|
UFSTARGET="$(mktemp -d /var/tmp/ufsbuild.XXXXX)"
|
||||||
CLSETUP_WORK="$(mktemp -d /var/tmp/clsetup.XXXXX)"
|
CLOUDSETUP_WORK="$(mktemp -d /var/tmp/cloudsetup.XXXXX)"
|
||||||
|
|
||||||
if zpool list -Ho name $ZPOOL_TMP 2>/dev/null; then
|
if zpool list -Ho name $ZPOOL_TMP 2>/dev/null; then
|
||||||
echo "The pool $ZPOOL_TMP is already imported." >&2
|
echo "The pool $ZPOOL_TMP is already imported." >&2
|
||||||
|
@ -39,7 +39,7 @@ cleanup() {
|
||||||
zpool export $ZPOOL_TMP ||:
|
zpool export $ZPOOL_TMP ||:
|
||||||
mdconfig -du md0 ||:
|
mdconfig -du md0 ||:
|
||||||
mdconfig -du md1 ||:
|
mdconfig -du md1 ||:
|
||||||
rm -rf "$CLSETUP_WORK"
|
rm -rf "$CLOUDSETUP_WORK"
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ then
|
||||||
env ASSUME_ALWAYS_YES=YES pkg install -y qemu-tools
|
env ASSUME_ALWAYS_YES=YES pkg install -y qemu-tools
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch -qo- "$CLSETUP_URL" | tar -C "$CLSETUP_WORK" --strip-components 1 -xzf-
|
fetch -qo- "$CLOUDSETUP_URL" | tar -C "$CLOUDSETUP_WORK" --strip-components 1 -xzf-
|
||||||
|
|
||||||
ufsdisk=$(mktemp /var/tmp/ufsdisk.XXXXX)
|
ufsdisk=$(mktemp /var/tmp/ufsdisk.XXXXX)
|
||||||
truncate -s 6G $ufsdisk
|
truncate -s 6G $ufsdisk
|
||||||
|
@ -128,7 +128,7 @@ mount_nullfs /tmp "$UFSTARGET/tmp"
|
||||||
mount_nullfs /var/tmp "$UFSTARGET/var/tmp"
|
mount_nullfs /var/tmp "$UFSTARGET/var/tmp"
|
||||||
|
|
||||||
# Install the first-boot script that configures the network and ssh key
|
# Install the first-boot script that configures the network and ssh key
|
||||||
make -C "$CLSETUP_WORK/" PREFIX="$UFSTARGET/usr/local" install
|
make -C "$CLOUDSETUP_WORK/" PREFIX="$UFSTARGET/usr/local" install
|
||||||
|
|
||||||
# Configure new system.
|
# Configure new system.
|
||||||
printf '# Device\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n' >"$UFSTARGET/etc/fstab"
|
printf '# Device\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n' >"$UFSTARGET/etc/fstab"
|
||||||
|
@ -142,9 +142,9 @@ sysrc -f "$UFSTARGET/etc/rc.conf" \
|
||||||
sshd_enable=YES \
|
sshd_enable=YES \
|
||||||
growfs_enable=YES \
|
growfs_enable=YES \
|
||||||
hostname=freebsd \
|
hostname=freebsd \
|
||||||
firstboot_clsetup_enable=YES \
|
firstboot_cloudsetup_enable=YES \
|
||||||
|
|
||||||
# The resolv.conf file is written by firstboot_clsetup
|
# The resolv.conf file is written by firstboot_cloudsetup
|
||||||
#cp /etc/resolv.conf "$UFSTARGET/etc/resolv.conf"
|
#cp /etc/resolv.conf "$UFSTARGET/etc/resolv.conf"
|
||||||
|
|
||||||
tzsetup -s -C "$UFSTARGET" UTC
|
tzsetup -s -C "$UFSTARGET" UTC
|
||||||
|
|
Loading…
Reference in New Issue