summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-12-08 23:48:45 (EST)
committer P. J. McDermott <pj@pehjota.net>2014-12-09 00:12:50 (EST)
commit1305a2f8e8ed575e57fc1e3e7353f9a50f48171e (patch)
tree0ad609edda89b1adb0a4af63656d61a2dc76a239
parent69c72f4579645599f1cff47b0b50dd3b5154f5e7 (diff)
Install Debian and the MLO and u-boot.img loaders
-rw-r--r--debeagle.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/debeagle.sh b/debeagle.sh
index 1a35986..ffe4b82 100644
--- a/debeagle.sh
+++ b/debeagle.sh
@@ -53,6 +53,7 @@ main()
esac
make_parts_and_fs "${target}"
+ install_debian "${mirror}" "${suite}" "${target}"
}
print_usage()
@@ -221,4 +222,37 @@ make_parts_and_fs()
mke2fs -t ext2 "${target}${part_prefix}2"
}
+install_debian()
+{
+ local mirror="${1}"
+ local suite="${2}"
+ local target="${3}"
+ local part_prefix=''
+ local boot_mp=''
+ local root_mp=''
+
+ case "${target}" in
+ /dev/mmcblk*) part_prefix='p';;
+ esac
+ boot_mp="$(mktemp -d)"
+ root_mp="$(mktemp -d)"
+ mount -o 'iocharset=iso8859-1' "${target}${part_prefix}1" "${boot_mp}"
+ mount "${target}${part_prefix}2" "${root_mp}"
+
+ debootstrap --arch=armhf --foreign "${suite}" "${root_mp}" ${mirror}
+
+ cp "${root_mp}/usr/lib/u-boot/omap3_beagle/MLO" \
+ "${boot_mp}/MLO"
+ cp "${root_mp}/usr/lib/u-boot/omap3_beagle/u-boot.bin" \
+ "${boot_mp}/u-boot.img"
+ cat >"${boot_mp}/uEnv.txt" <<-EOF
+ mpurate=1000
+
+ dvimode="hd720 omapfb.vram=0:8M,1:4M,2:4M"
+ vram=16M
+ optargs="consoleblank=0"
+ console="tty0 console=ttyS2,115200n8"
+ EOF
+}
+
main "${@}"