summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYaniv Kamay <yaniv@qumranet.com>2006-07-18 10:50:15 +0000
committerYaniv Kamay <yaniv@qumranet.com>2006-07-18 10:50:15 +0000
commit46f64526a28951bf64d69fd63204ffe29fda5b10 (patch)
tree440aa9100cd45894e5f0a04f749b5bbe2c6db900 /scripts
parenta05a1c819b47e0879868f395f094686db3131fc7 (diff)
kvm: change mkbootdisk output file and mount dir
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/mkbootdisk20
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/mkbootdisk b/scripts/mkbootdisk
index f7fd719d..5202c05f 100755
--- a/scripts/mkbootdisk
+++ b/scripts/mkbootdisk
@@ -3,21 +3,27 @@
set -e
kernel="$1"
+mnt_dir="/tmp/mkbootdisk/mnt"
+img_file="/tmp/mkbootdisk/boot.img"
[[ -f "$kernel" ]] || { echo need kernel; exit 1; }
-dd < /dev/zero > /tmp/boot.img bs=1M count=10
-mkfs -t vfat /tmp/boot.img
+mkdir -p $mnt_dir
-mount -o loop /tmp/boot.img /mnt
+[[ -d "$mnt_dir" ]] || { echo mount dir err; exit 1; }
-cp "$kernel" /mnt/kernel
+dd < /dev/zero > $img_file bs=1M count=10
+mkfs -t vfat $img_file
-cat <<EOF > /mnt/SYSLINUX.CFG
+mount -o loop $img_file $mnt_dir
+
+cp "$kernel" $mnt_dir/kernel
+
+cat <<EOF > $mnt_dir/SYSLINUX.CFG
DEFAULT kernel
EOF
-umount /mnt
+umount $mnt_dir
-syslinux /tmp/boot.img
+syslinux $img_file