commit bbc0a7710d08d1ca71d2525c603ef2300d589b24 Author: Gwenhael Le Moine Date: Tue Jul 12 18:12:07 2016 +0200 initial commit, working microSD card generated Signed-off-by: Gwenhael Le Moine diff --git a/make_usd_card.sh b/make_usd_card.sh new file mode 100755 index 0000000..01b9a41 --- /dev/null +++ b/make_usd_card.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# inspired by https://github.com/umiddelb/z2d/tree/master/pine64 + +display_usage() { + echo "$0 " +} + +SD_DEV=$1 +SD_MOUNT_POINT=$2 + +[ "x$1" == "x" ] && display_usage && exit +[ "x$2" == "x" ] && display_usage && exit + +wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/simpleimage-pine64-latest.img.xz +unxz simpleimage-pine64-latest.img.xz +dd if=simpleimage-pine64-latest.img of=$SD_DEV bs=1024 + +/bin/echo -e "d\n2\nn\np\n2\n143360\n\nw\n" | sudo fdisk $SD_DEV + +sudo mkfs.ext4 -O ^has_journal -b 4096 -L rootfs -U deadbeef-dead-beef-dead-beefdeadbeef ${SD_DEV}p2 + +mount ${SD_DEV}p2 $SD_MOUNT_POINT + +mkdir -p $SD_MOUNT_POINT/bootenv +mount ${SD_DEV}p1 $SD_MOUNT_POINT/bootenv + +wget -c http://slackware.uk/slackwarearm/slackwarearm-devtools/minirootfs/roots/slack-14.2-miniroot_01Jul16.tar.xz +tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf slack-14.2-miniroot_01Jul16.tar.xz + +wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-latest.tar.xz +tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf linux-pine64-latest.tar.xz +cp -R $SD_MOUNT_POINT/boot/* $SD_MOUNT_POINT/bootenv/ + +cat < $SD_MOUNT_POINT/root/update_kernel.sh +#!/bin/sh +wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-latest.tar.xz + +tar --numeric-owner -C / -xpJf linux-pine64-latest.tar.xz +rm linux-pine64-latest.tar.xz + +cp -R /boot/* /bootenv/ +EOF + +# ( cd $SD_MOUNT_POINT/boot/conf.d/default/ +# rm kernel && sudo ln -s ../../kernel.d/linux-3.10.101-p64 kernel ) + +umount $SD_MOUNT_POINT/bootenv +umount $SD_MOUNT_POINT + +sync