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
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
}
`" $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