From: ebelcrom Date: Fri, 13 Mar 2020 18:19:31 +0000 (+0100) Subject: rotational check fixed X-Git-Tag: v2.1^0 X-Git-Url: http://www.binomiant.duckdns.org/9wAuyR5S/?a=commitdiff_plain;h=HEAD;p=rescuesys.git rotational check fixed --- diff --git a/build.sh b/build.sh index 3438c67..f90a6c4 100755 --- a/build.sh +++ b/build.sh @@ -74,16 +74,16 @@ create_VM() echo "Creating VM with VDI in ramfs..." - if [ $option_ramfs -eq 1 ]; then - local vdi_file=ramfs/rescuesys.vdi - local iso_file=ramfs/setup.iso - # create ramfs - sudo mount -t ramfs ramfs -o mode=1777 ramfs - cp setup.iso ramfs/ - else - local vdi_file=rescuesys.vdi - local iso_file=setup.iso - fi + if [ $option_ramfs -eq 1 ]; then + local vdi_file=ramfs/rescuesys.vdi + local iso_file=ramfs/setup.iso + # create ramfs + sudo mount -t ramfs ramfs -o mode=1777 ramfs + cp setup.iso ramfs/ + else + local vdi_file=rescuesys.vdi + local iso_file=setup.iso + fi # create and configure VM VBoxManage createvm --name rescuesys --register > /dev/null @@ -126,11 +126,12 @@ create_image() echo "Creating image..." rm -f rescuesys.img - if [ $option_ramfs -eq 1 ]; then - local vdi_file=ramfs/rescuesys.vdi - else - local vdi_file=rescuesys.vdi - fi + if [ $option_ramfs -eq 1 ]; then + local vdi_file=ramfs/rescuesys.vdi + else + local vdi_file=rescuesys.vdi + fi + VBoxManage modifymedium disk $vdi_file --compact > /dev/null VBoxManage clonehd $vdi_file rescuesys.img --format RAW > /dev/null adapt_image } diff --git a/rescuesys.sh b/rescuesys.sh index c998eb3..a854df8 100755 --- a/rescuesys.sh +++ b/rescuesys.sh @@ -589,7 +589,8 @@ ext_cleanup() `" $3 läuft..." 8 56 # SSD? - if [ $(cat /sys/block/${3%3}/queue/rotational) ]; then + local part=$(echo $3 | sed 's/[0-9]*$//') + if [ "$(cat /sys/block/${part}/queue/rotational)" == "0" ]; then # mount and use fstrim sudo mount -o ro /dev/$3 $INSP_DIR &>/dev/null sudo fstrim $INSP_DIR &>/dev/null