aboutsummaryrefslogtreecommitdiff
blob: 3b7f7c0b400998abe5e4e0a5ff2e86d19b66c0ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

set -e

kernel="$1"
mnt_dir="/tmp/mkbootdisk/mnt"
img_file="/tmp/mkbootdisk/boot.img"

[[ -f "$kernel" ]] || { echo need kernel; exit 1; }

mkdir -p $mnt_dir

[[ -d "$mnt_dir" ]] || { echo mount dir err; exit 1; }

dd < /dev/zero > $img_file bs=1M count=10
mkfs -t vfat $img_file

mount -o loop $img_file $mnt_dir

cp "$kernel" $mnt_dir/kernel

cat <<EOF > $mnt_dir/SYSLINUX.CFG
DEFAULT kernel
APPEND console=ttyS0
EOF

umount $mnt_dir

syslinux $img_file