mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
vmware images: fix to match image_to_usb changes
Review URL: http://chromereview.prom.corp.google.com/1181003 git-svn-id: svn://chrome-svn/chromeos/trunk@115 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
parent
a1f68e470a
commit
edabc59e31
@ -33,10 +33,22 @@ set -e
|
||||
FLAGS_from=`eval readlink -f $FLAGS_from`
|
||||
FLAGS_to=`eval readlink -f $FLAGS_to`
|
||||
|
||||
# Make two sparse files. One for an empty partition, another for
|
||||
# stateful partition.
|
||||
PART_SIZE=$(stat -c%s "${FLAGS_from}/rootfs.image")
|
||||
dd if=/dev/zero of="${FLAGS_from}/empty.image" bs=1 count=1 \
|
||||
seek=$(( $PART_SIZE - 1 ))
|
||||
dd if=/dev/zero of="${FLAGS_from}/state.image" bs=1 count=1 \
|
||||
seek=$(( $PART_SIZE - 1 ))
|
||||
mkfs.ext3 -F -L C-STATE "${FLAGS_from}/state.image"
|
||||
|
||||
# Copy MBR and rootfs to output image
|
||||
qemu-img convert -f raw \
|
||||
"${FLAGS_from}/mbr.image" "${FLAGS_from}/rootfs.image" \
|
||||
"${FLAGS_from}/mbr.image" "${FLAGS_from}/state.image" \
|
||||
"${FLAGS_from}/empty.image" "${FLAGS_from}/rootfs.image" \
|
||||
-O vmdk "${FLAGS_to}"
|
||||
|
||||
rm -f "${FLAGS_from}/empty.image" "${FLAGS_from}/state.image"
|
||||
|
||||
echo "Done. Created VMware image ${FLAGS_to}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user