#!/bin/sh
echo "############### tv-mbr-3parts.post ################"
-cat >> /etc/fstab << EOF
+# overwrite /etc/fstab to execute fsck.
+#
+# The default value of the sixth field(fs_passno) in /etc/fstab
+# created by MIC tool is 0. If the value is 1 or 2, fsck will be executed
+# automatically before mounting. (refer to systemd-fstab-generator)
+cat > /etc/fstab << EOF
+# This file is generated by post script in .ks file.
+#
+# <file system> <mount point> <type> <options> <dump> <pass>
+/dev/root / ext4 defaults,noatime 0 1
+devpts /dev/pts devpts gid=5,mode=620 0 0
+tmpfs /dev/shm tmpfs defaults 0 0
+proc /proc proc defaults 0 0
+sysfs /sys sysfs defaults 0 0
-LABEL=system-data /opt ext4 defaults,noatime 0 0
-LABEL=user /opt/usr ext4 defaults,noatime 0 0
+LABEL=system-data /opt ext4 defaults,noatime 0 2
+LABEL=user /opt/usr ext4 defaults,noatime 0 2
EOF
cat > /usr/lib/systemd/system/resize2fs@.service << EOF
EOF
mkdir -p /usr/lib/systemd/system/local-fs-pre.target.wants
-ln -s ../systemd-fsck@.service /usr/lib/systemd/system/local-fs-pre.target.wants/systemd-fsck@dev-disk-by\\x2dlabel-system\\x2ddata.service
-ln -s ../systemd-fsck@.service /usr/lib/systemd/system/local-fs-pre.target.wants/systemd-fsck@dev-disk-by\\x2dlabel-user.service
-ln -s ../systemd-fsck@.service /usr/lib/systemd/system/local-fs-pre.target.wants/systemd-fsck@dev-disk-by\\x2dlabel-rootfs.service
-
ln -s ../resize2fs@.service /usr/lib/systemd/system/local-fs-pre.target.wants/resize2fs@dev-disk-by\\x2dlabel-system\\x2ddata.service
ln -s ../resize2fs@.service /usr/lib/systemd/system/local-fs-pre.target.wants/resize2fs@dev-disk-by\\x2dlabel-user.service
ln -s ../resize2fs@.service /usr/lib/systemd/system/local-fs-pre.target.wants/resize2fs@dev-disk-by\\x2dlabel-rootfs.service