summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 "${@}"