Split off ZFS-relatesd tasks into 'zfs.sh'
This commit is contained in:
12
pre-inst.sh
12
pre-inst.sh
@@ -48,9 +48,7 @@ fi
|
|||||||
timedatectl
|
timedatectl
|
||||||
|
|
||||||
if [[ ! "$(hostname)" == "debian-live" ]]; then
|
if [[ ! "$(hostname)" == "debian-live" ]]; then
|
||||||
zgenhostid \
|
"${baseDir}/zfs.sh" --host-id
|
||||||
-f \
|
|
||||||
0x00bab10c
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -98,9 +96,7 @@ fi
|
|||||||
|
|
||||||
# if [[ ! "${*}" = *--no-part* ]]; then
|
# if [[ ! "${*}" = *--no-part* ]]; then
|
||||||
if [[ -f "/etc/zfs/keys/${hostname,,}.key" ]]; then
|
if [[ -f "/etc/zfs/keys/${hostname,,}.key" ]]; then
|
||||||
cp \
|
"${baseDir}/zfs.sh" --key
|
||||||
/etc/zfs/keys/${hostname,,}.key \
|
|
||||||
/mnt/etc/zfs/keys/
|
|
||||||
fi
|
fi
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
@@ -110,9 +106,7 @@ fi
|
|||||||
|
|
||||||
"${baseDir}/chroot.sh" --continue
|
"${baseDir}/chroot.sh" --continue
|
||||||
|
|
||||||
zpool \
|
"${baseDir}/zfs.sh" --unmount
|
||||||
export \
|
|
||||||
-a
|
|
||||||
|
|
||||||
printf \
|
printf \
|
||||||
'\033[?47h\033[2J\033[H'
|
'\033[?47h\033[2J\033[H'
|
||||||
|
|||||||
22
zfs.sh
22
zfs.sh
@@ -272,3 +272,25 @@ fi
|
|||||||
# zfs mount \
|
# zfs mount \
|
||||||
# ${hostname,,}/var/mail
|
# ${hostname,,}/var/mail
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
|
if [[ "${1}" == '--key' ]]; then
|
||||||
|
cp \
|
||||||
|
/etc/zfs/keys/${hostname,,}.key \
|
||||||
|
/mnt/etc/zfs/keys/
|
||||||
|
elif [[ "${1}" == '--unmount' ]]; then
|
||||||
|
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -I {} umount -Rlf {}
|
||||||
|
|
||||||
|
if [[ "${ID}" == 'fedora' ]]; then
|
||||||
|
umount \
|
||||||
|
-nR \
|
||||||
|
/mnt
|
||||||
|
fi
|
||||||
|
|
||||||
|
zpool \
|
||||||
|
export \
|
||||||
|
-a
|
||||||
|
elif [[ "${1}" == '--host-id' ]]; then
|
||||||
|
zgenhostid \
|
||||||
|
-f \
|
||||||
|
0x00bab10c
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user