Skip to content

Commit 7c5bcea

Browse files
committed
DLPX-86523 CIS: /home filesystem and mount options
PR URL: https://www.github.com/delphix/appliance-build/pull/756
1 parent e36e0a6 commit 7c5bcea

File tree

9 files changed

+21
-20
lines changed

9 files changed

+21
-20
lines changed

live-build/config/hooks/vm-artifacts/90-raw-disk-image.binary

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ zfs mount "$FSNAME/ROOT/$FSNAME/root"
218218
mount --make-slave "$DIRECTORY"
219219

220220
zfs create \
221+
-o devices=off \
221222
-o mountpoint=legacy \
222223
"$FSNAME/ROOT/$FSNAME/home"
223224

@@ -275,8 +276,8 @@ zfs create \
275276
# contents. During normal boot up, we'll rely on "/etc/fstab" to handle
276277
# these mounts.
277278
#
278-
mkdir -p "$DIRECTORY/export/home"
279-
mount -t zfs "$FSNAME/ROOT/$FSNAME/home" "$DIRECTORY/export/home"
279+
mkdir -p "$DIRECTORY/home"
280+
mount -t zfs -o nodev "$FSNAME/ROOT/$FSNAME/home" "$DIRECTORY/home"
280281

281282
mkdir -p "$DIRECTORY/var/delphix"
282283
mount -t zfs "$FSNAME/ROOT/$FSNAME/data" "$DIRECTORY/var/delphix"
@@ -312,7 +313,7 @@ rsync --info=stats3 -Wa binary/* "$DIRECTORY/"
312313
# automatically whenever we boot into the crash kernel.
313314
#
314315
cat <<-EOF >"$DIRECTORY/etc/fstab"
315-
rpool/ROOT/$FSNAME/home /export/home zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
316+
rpool/ROOT/$FSNAME/home /home zfs defaults,nodev,x-systemd.before=zfs-import-cache.service 0 0
316317
rpool/ROOT/$FSNAME/data /var/delphix zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
317318
rpool/ROOT/$FSNAME/log /var/log zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
318319
rpool/ROOT/$FSNAME/tmp /tmp zfs defaults,nosuid,nodev,exec,x-systemd.before=zfs-import-cache.service 0 0
@@ -357,7 +358,7 @@ done
357358

358359
umount "$DIRECTORY/var/log"
359360
umount "$DIRECTORY/var/delphix"
360-
umount "$DIRECTORY/export/home"
361+
umount "$DIRECTORY/home"
361362
umount "$DIRECTORY/tmp"
362363
umount "$DIRECTORY/var/tmp"
363364
umount "/var/crash"

live-build/misc/ansible-roles/appliance-build.masking-development/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
- git:
2727
repo: "https://{{ lookup('env', 'GITHUB_TOKEN') }}@github.com/delphix/dms-core-gate.git"
2828
dest:
29-
"/export/home/delphix/dms-core-gate"
29+
"/home/delphix/dms-core-gate"
3030
version: "develop"
3131
accept_hostkey: yes
3232
update: no
3333
when: lookup('env', 'GITHUB_TOKEN') != ''
3434

3535
- file:
36-
path: "/export/home/delphix/{{ item }}"
36+
path: "/home/delphix/{{ item }}"
3737
owner: delphix
3838
group: staff
3939
mode: "g+w"

live-build/misc/ansible-roles/appliance-build.minimal-common/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
no_log: true
2727

2828
- file:
29-
path: /export/home
29+
path: /home
3030
state: directory
3131
mode: 0755
3232

@@ -39,7 +39,7 @@
3939
shell: /bin/bash
4040
create_home: yes
4141
comment: Delphix User
42-
home: /export/home/delphix
42+
home: /home/delphix
4343
password:
4444
"{{ lookup('env', 'APPLIANCE_PASSWORD') | password_hash('sha512') }}"
4545

live-build/misc/ansible-roles/appliance-build.unittest-internal/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
- user:
8989
name: testrunner
9090
comment: "Delphix"
91-
home: /export/home/testrunner
91+
home: /home/testrunner
9292
groups: docker
9393
password:
9494
"$6$pWQE0MPZWgue7fNC$8RvR0u04Mt67792b.x4ao0G2Z/H/hrYPWezOqCkz59MIA\

live-build/misc/ansible-roles/appliance-build.virtualization-development/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@
7373
7474
- git:
7575
repo: "https://{{ lookup('env', 'GITHUB_TOKEN') }}@github.com/delphix/dlpx-app-gate.git"
76-
dest: "/export/home/delphix/dlpx-app-gate"
76+
dest: "/home/delphix/dlpx-app-gate"
7777
version: "develop"
7878
accept_hostkey: yes
7979
update: no
8080
when: lookup('env', 'GITHUB_TOKEN') != ''
8181

8282
- file:
83-
path: "/export/home/delphix/{{ item }}"
83+
path: "/home/delphix/{{ item }}"
8484
owner: delphix
8585
group: staff
8686
mode: "g+w"

live-build/misc/ansible-roles/appliance-build.zfsonlinux-development/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,26 @@
6666
- git:
6767
repo: "https://{{ lookup('env', 'GITHUB_TOKEN') }}@github.com/delphix/zfs.git"
6868
dest:
69-
"/export/home/delphix/zfs"
69+
"/home/delphix/zfs"
7070
version: develop
7171
accept_hostkey: yes
7272
update: no
7373
when: lookup('env', 'GITHUB_TOKEN') != ''
7474

7575
- file:
76-
path: "/export/home/delphix/zfs"
76+
path: "/home/delphix/zfs"
7777
owner: delphix
7878
group: staff
7979
state: directory
8080
recurse: yes
8181

8282
- file:
83-
path: "/export/home/delphix/.cargo/"
83+
path: "/home/delphix/.cargo/"
8484
state: directory
8585
owner: delphix
8686
group: staff
8787
- copy:
88-
dest: "/export/home/delphix/.cargo/config.toml"
88+
dest: "/home/delphix/.cargo/config.toml"
8989
content: |
9090
[target.x86_64-unknown-linux-gnu]
9191
rustflags = ["-C", "link-arg=-B/usr/libexec/mold"]

scripts/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function resolve_s3_uri() {
3636
# mirror is used.
3737
#
3838
UPSTREAM_BRANCH=$(get_upstream_or_fail_if_unset) || exit 1
39-
echo "Running with UPSTREAM_BRANCH set to ${UPSTREAM_BRANCH}"
39+
# echo "Running with UPSTREAM_BRANCH set to ${UPSTREAM_BRANCH}"
4040
local latest_subprefix="linux-pkg/${UPSTREAM_BRANCH}/combine-packages/post-push/latest"
4141
local bucket="snapshot-de-images"
4242
local jenkinsid="jenkins-ops"

upgrade/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ resemble the following:
8989

9090
A "rootfs container" is a collection of ZFS datasets that can be used as
9191
the "root filesytsem" of the appliance. This includes a dataset for "/"
92-
of the appliance, but also seperate datasets for "/export/home" and
92+
of the appliance, but also seperate datasets for "/home" and
9393
"/var/delphix".
9494

9595
Here's an example of the datasets for a rootfs container:

upgrade/upgrade-scripts/upgrade-container

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function create_upgrade_container() {
212212
-o mountpoint=legacy \
213213
"$ROOTFS_DATASET/home@$SNAPSHOT_NAME" \
214214
"rpool/ROOT/$CONTAINER/home" ||
215-
die "failed to create upgrade /export/home clone"
215+
die "failed to create upgrade /home clone"
216216

217217
zfs clone \
218218
-o mountpoint=legacy \
@@ -251,7 +251,7 @@ function create_upgrade_container() {
251251
# dataset.
252252
#
253253
mount_upgrade_container_dataset \
254-
"rpool/ROOT/$CONTAINER/home" "$DIRECTORY/export/home"
254+
"rpool/ROOT/$CONTAINER/home" "$DIRECTORY/home"
255255
mount_upgrade_container_dataset \
256256
"rpool/ROOT/$CONTAINER/data" "$DIRECTORY/var/delphix"
257257
mount_upgrade_container_dataset \
@@ -332,7 +332,7 @@ function create_upgrade_container() {
332332
# before the zfs-import service is run.
333333
#
334334
cat <<-EOF >"$DIRECTORY/etc/fstab"
335-
rpool/ROOT/$CONTAINER/home /export/home zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
335+
rpool/ROOT/$CONTAINER/home /home zfs defaults,nodev,x-systemd.before=zfs-import-cache.service 0 0
336336
rpool/ROOT/$CONTAINER/data /var/delphix zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
337337
rpool/ROOT/$CONTAINER/log /var/log zfs defaults,x-systemd.before=zfs-import-cache.service 0 0
338338
rpool/crashdump /var/crash zfs defaults,x-systemd.before=zfs-import-cache.service,x-systemd.before=kdump-tools.service 0 0

0 commit comments

Comments
 (0)