From d322e8d5c54e09d2c3a498f01171e2a1fde8f145 Mon Sep 17 00:00:00 2001 From: Suikan <26223147+suikan4github@users.noreply.github.com> Date: Sat, 7 May 2022 21:35:29 +0900 Subject: [PATCH] Unquoted first parameter of lvcreate. This is to use the IFS ( Internal Field Separator ). Without IFS the string "-L 8G" will be wrapped by single quote like '-L 8G', while we need -L 8G. --- script/lib/common.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/lib/common.sh b/script/lib/common.sh index 91a8d3f..a1bd2f5 100644 --- a/script/lib/common.sh +++ b/script/lib/common.sh @@ -257,7 +257,8 @@ function pre_install() { echo "...Swap volume already exist. Skipped to create. No problem." else echo "...Creating logical volume \"${LVSWAPNAME}\" on \"${VGNAME}\"." - lvcreate "${LVSWAPSIZE}" -n "${LVSWAPNAME}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVSWAPSIZE} -n "${LVSWAPNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; fi # if /dev/mapper/swap volume already exit. @@ -290,7 +291,8 @@ function pre_install() { return 1 # with error status else # not exist and not overwrite install echo "...Creating logical volume \"${LVROOTNAME}\" on \"${VGNAME}\"." - lvcreate "${LVROOTSIZE}" -n "${LVROOTNAME}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVROOTSIZE} -n "${LVROOTNAME}" "${VGNAME}" if [ $? -ne 0 ] ; then deactivate_and_close; return 1 ; fi; IS_ROOT_CREATED=1 @@ -492,7 +494,8 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT1SUFFIX}\" on \"${VGNAME}\"." - lvcreate "${LVEXT1SIZE}" -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVEXT1SIZE} -n "${LVROOTNAME}${LVEXT1SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ; @@ -507,7 +510,8 @@ function create_ext_lv() { echo "...Logical volume \"${VGNAME}-${LVROOTNAME}${LVEXT2SUFFIX}\" already exists. OK." else echo "...Creating logical volume \"${LVROOTNAME}${LVEXT2SUFFIX}\" on \"${VGNAME}\"." - lvcreate "${LVEXT2SIZE}" -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" + # Too use the bash IFS, first parameter is not quoted. + lvcreate ${LVEXT2SIZE} -n "${LVROOTNAME}${LVEXT2SUFFIX}" "${VGNAME}" if [ $? -ne 0 ] ; then # if fail echo "***** ERROR : failed to create "${VGNAME}-${LVROOTNAME}${LVEXT1SUFFIX}" . *****" return 1 ;