factored versions, cleaning

This commit is contained in:
Gwenhael Le Moine 2016-07-12 18:32:22 +02:00
parent bbc0a7710d
commit 84400b7d34

View file

@ -11,9 +11,14 @@ SD_MOUNT_POINT=$2
[ "x$1" == "x" ] && display_usage && exit [ "x$1" == "x" ] && display_usage && exit
[ "x$2" == "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 SIMPLEIMAGE_VERSION=${SIMPLEIMAGE_VERSION:-"latest"}
unxz simpleimage-pine64-latest.img.xz LINUX_VERSION=${LINUX_VERSION:-"latest"}
dd if=simpleimage-pine64-latest.img of=$SD_DEV bs=1024 SLACKWARE_VERSION=${SLACKWARE_VERSION:-"14.2"}
SLACKWARE_MINIROOTFS_VERSION=${SLACKWARE_MINIROOTFS_VERSION:-"01Jul16"}
wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/simpleimage-pine64-${SIMPLEIMAGE_VERSION}.img.xz
unxz simpleimage-pine64-${SIMPLEIMAGE_VERSION}.img.xz
dd if=simpleimage-pine64-${SIMPLEIMAGE_VERSION}.img of=$SD_DEV bs=1024
/bin/echo -e "d\n2\nn\np\n2\n143360\n\nw\n" | sudo fdisk $SD_DEV /bin/echo -e "d\n2\nn\np\n2\n143360\n\nw\n" | sudo fdisk $SD_DEV
@ -24,25 +29,23 @@ mount ${SD_DEV}p2 $SD_MOUNT_POINT
mkdir -p $SD_MOUNT_POINT/bootenv mkdir -p $SD_MOUNT_POINT/bootenv
mount ${SD_DEV}p1 $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 wget -c http://slackware.uk/slackwarearm/slackwarearm-devtools/minirootfs/roots/slack-${SLACKWARE_VERSION}-miniroot_${SLACKWARE_MINIROOTFS_VERSION}.tar.xz
tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf slack-14.2-miniroot_01Jul16.tar.xz tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf slack-${SLACKWARE_VERSION}-miniroot_${SLACKWARE_MINIROOTFS_VERSION}.tar.xz
wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-latest.tar.xz wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-${LINUX_VERSION}.tar.xz
tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf linux-pine64-latest.tar.xz tar --numeric-owner -C $SD_MOUNT_POINT/ -xpJf linux-pine64-${LINUX_VERSION}.tar.xz
cp -R $SD_MOUNT_POINT/boot/* $SD_MOUNT_POINT/bootenv/ cp -R $SD_MOUNT_POINT/boot/* $SD_MOUNT_POINT/bootenv/
cat <<EOF > $SD_MOUNT_POINT/root/update_kernel.sh cat <<EOF > $SD_MOUNT_POINT/root/update_kernel.sh
#!/bin/sh #!/bin/sh
wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-latest.tar.xz wget -c https://www.stdin.xyz/downloads/people/longsleep/pine64-images/linux/linux-pine64-${LINUX_VERSION}.tar.xz
tar --numeric-owner -C / -xpJf linux-pine64-latest.tar.xz tar --numeric-owner -C / -xpJf linux-pine64-${LINUX_VERSION}.tar.xz
rm linux-pine64-latest.tar.xz rm linux-pine64-${LINUX_VERSION}.tar.xz
cp -R /boot/* /bootenv/ cp -R /boot/* /bootenv/
EOF EOF
chmod +x $SD_MOUNT_POINT/root/update_kernel.sh
# ( 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/bootenv
umount $SD_MOUNT_POINT umount $SD_MOUNT_POINT