iankelling.org
/
git
/
automated-distro-installer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cef9b6e
)
minor nowipe fix
author
Ian Kelling
<iank@fsf.org>
Thu, 14 May 2020 23:35:36 +0000
(19:35 -0400)
committer
Ian Kelling
<iank@fsf.org>
Thu, 14 May 2020 23:35:36 +0000
(19:35 -0400)
fai/config/hooks/partition.DEFAULT
patch
|
blob
|
history
diff --git
a/fai/config/hooks/partition.DEFAULT
b/fai/config/hooks/partition.DEFAULT
index 0a0c2ad69946535a624c74d0ce3f7443ad69671c..afd88a007fc3d503e33f39a65e0dfbbe772b66b0 100755
(executable)
--- a/
fai/config/hooks/partition.DEFAULT
+++ b/
fai/config/hooks/partition.DEFAULT
@@
-15,9
+15,15
@@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+PS4='+ $LINENO '
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
+if [[ $EUID != 0 ]]; then
+ echo "$0: error: need to run as root" >&2
+ exit 1
+fi
+
# for calling outside of FAI:
# # need to redep and set that location so that we get luks keys
# export FAI=/srv/fai/config
# for calling outside of FAI:
# # need to redep and set that location so that we get luks keys
# export FAI=/srv/fai/config
@@
-549,10
+555,10
@@
if [[ $DISTRO == debianstretch_bootstrap ]]; then
else
boot_vol=boot_$DISTRO
fi
else
boot_vol=boot_$DISTRO
fi
-if $wipe; then
- if [[ -e /mnt/$boot_vol ]]; then
- btrfs subvolume delete /mnt/$boot_vol
- fi
+if $wipe
&& [[ -e /mnt/$boot_vol ]]
; then
+ btrfs subvolume delete /mnt/$boot_vol
+fi
+if [[ ! -e /mnt/$boot_vol ]]; then
btrfs subvolume create $boot_vol
fi
cd /
btrfs subvolume create $boot_vol
fi
cd /