DragonFlyBSD Kernel Audit
DF-2629 / setup.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2629 matrix setup (run as root on the guest).
set -e
dd if=/dev/zero of=/tmp/ufs2629.img bs=1m count=64 status=none
vnconfig -c /dev/vn0 /tmp/ufs2629.img
newfs /dev/vn0 >/dev/null 2>&1
mkdir -p /mnt/ufs2629
mount -t ufs /dev/vn0 /mnt/ufs2629
# matrix files on UFS
: > /mnt/ufs2629/q1_owner644;  chown maxx /mnt/ufs2629/q1_owner644; chmod 644 /mnt/ufs2629/q1_owner644
: > /mnt/ufs2629/q2_root666;   chmod 666 /mnt/ufs2629/q2_root666
: > /mnt/ufs2629/q3_root644;   chmod 644 /mnt/ufs2629/q3_root644
: > /mnt/ufs2629/q4_root666n;  chmod 666 /mnt/ufs2629/q4_root666n
: > /mnt/ufs2629/q5_root444n;  chmod 444 /mnt/ufs2629/q5_root444n
# matrix files on the hammer2 ROOT filesystem (guest root fs is hammer2)
mkdir -p /home/maxx/df2629h2
: > /home/maxx/df2629h2/q1_owner644;  chown maxx /home/maxx/df2629h2/q1_owner644; chmod 644 /home/maxx/df2629h2/q1_owner644
: > /home/maxx/df2629h2/q2_root666;   chmod 666 /home/maxx/df2629h2/q2_root666
: > /home/maxx/df2629h2/q3_root644;   chmod 644 /home/maxx/df2629h2/q3_root644
: > /home/maxx/df2629h2/q4_root666n;  chmod 666 /home/maxx/df2629h2/q4_root666n
: > /home/maxx/df2629h2/q5_root444n;  chmod 444 /home/maxx/df2629h2/q5_root444n
ls -ln /mnt/ufs2629 /home/maxx/df2629h2
echo SETUP_OK