Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 02456a6

Browse files
authored
#298: Allow resize on non rootfs partitions
1 parent fd3ccb0 commit 02456a6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/etc/one-context.d/loc-05-grow-rootfs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,19 @@ esac
186186

187187
export DEBUG
188188
_exit_result=0
189-
for _FS in ${GROW_FS} ; do
190189

191-
# avoid resizing FS on FreeBSD
192-
# https://github.com/OpenNebula/addon-context-linux/issues/298
193-
[ "${OS}" = 'freebsd' ] && continue
190+
# TODO: Check OS first, then iterate FS
191+
for _FS in ${GROW_FS} ; do
194192

195193
# FreeBSD
194+
# only non rootfs resize is supported
196195
if [ "${OS}" = 'freebsd' ]; then
197196
case "$_FS" in
198197
/)
198+
# avoid resizing rootFS on FreeBSD
199+
# https://github.com/OpenNebula/addon-context-linux/issues/298
200+
continue
201+
199202
# This breaks the image unless executed manually
200203
/etc/rc.d/growfs onestart || _exit_result=$?
201204
;;
@@ -207,7 +210,6 @@ for _FS in ${GROW_FS} ; do
207210
fi
208211

209212
# Linux
210-
211213
# try /proc/mounts first otherwise fallback to /etc/mtab
212214
MOUNT_LINE=$(\
213215
if [ -e /proc/mounts ] ; then \

0 commit comments

Comments
 (0)