Skip to content

Commit

Permalink
DLPX-86523 CIS: /home filesystem and mount options
Browse files Browse the repository at this point in the history
  • Loading branch information
ShibasishDelphix committed Aug 9, 2023
1 parent c30d05d commit d81810e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions live-build/config/hooks/vm-artifacts/90-raw-disk-image.binary
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ zfs create \
# contents. During normal boot up, we'll rely on "/etc/fstab" to handle
# these mounts.
#
mkdir -p "$DIRECTORY/export/home"
mount -t zfs "$FSNAME/ROOT/$FSNAME/home" "$DIRECTORY/export/home"
mkdir -p "$DIRECTORY/home"
mount -t zfs "$FSNAME/ROOT/$FSNAME/home" "$DIRECTORY/home"

mkdir -p "$DIRECTORY/var/delphix"
mount -t zfs "$FSNAME/ROOT/$FSNAME/data" "$DIRECTORY/var/delphix"
Expand Down Expand Up @@ -292,7 +292,7 @@ rsync --info=stats3 -Wa binary/* "$DIRECTORY/"
# automatically whenever we boot into the crash kernel.
#
cat <<-EOF >"$DIRECTORY/etc/fstab"
rpool/ROOT/$FSNAME/home /export/home zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
rpool/ROOT/$FSNAME/home /home zfs defaults,x-systemd.before=zfs-import-cache.service nodev 0 0
rpool/ROOT/$FSNAME/data /var/delphix zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
rpool/ROOT/$FSNAME/log /var/log zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
rpool/crashdump /var/crash zfs defaults,x-systemd.before=zfs-import-cache.service,x-systemd.before=kdump-tools.service 0 0
Expand Down Expand Up @@ -335,8 +335,10 @@ done

umount "$DIRECTORY/var/log"
umount "$DIRECTORY/var/delphix"
umount "$DIRECTORY/export/home"
umount "$DIRECTORY/home"
umount "/var/crash"
retry 5 10 zfs umount "$FSNAME/ROOT/$FSNAME/root"
retry 5 10 zpool export "$FSNAME"
kpartx -d "$ARTIFACT_NAME.img"

ln -s /export/home /home

0 comments on commit d81810e

Please sign in to comment.