#!/bin/bash

set -x

diskname=$1

#==========================================
# install MLO as raw
#------------------------------------------
if [ -f "boot/MLO" ];then
    opt="count=1 seek=1 conv=notrunc"
    if ! dd if=boot/MLO of=$diskname bs=128k $opt; then
        echo "Couldn't install MLO on $diskname"
        exit 1
    fi
    # /.../
    # To avoid any issues when parted leaves x86 boot code
    # in the MBR we better clear that part of the image
    # ----
    dd if=/dev/zero of=$diskname bs=440 count=1 conv=notrunc
fi

