...
 
Commits (3)
pyra-install (0.3) stretch; urgency=medium
pyra-install (0.4) unstable; urgency=medium
[ aTc ]
* Update changelog for 0.3 release
* add support for image file creation
[ Pyra Dev ]
-- Pyra Dev <pyra-dev@pyra-handheld.com> Mon, 28 Oct 2019 23:49:51 +0100
pyra-install (0.3) unstable; urgency=medium
[ aTc ]
* make gta uboot the default
-- Pyra Dev <pyra-dev@pyra-handheld.com> Wed, 03 Jul 2019 00:19:41 +0200
-- Pyra Dev <pyra-dev@pyra-handheld.com> Fri, 11 Oct 2019 01:41:47 +0200
pyra-install (0.2) stretch; urgency=medium
......
......@@ -13,7 +13,12 @@ check_exists mkfs.f2fs
check_exists lsblk
if [ "$#" -ne 3 ] ; then echo "Usage: $0 : rootfs.tgz u-boot /dev/mmcblk1" ; exit 1 ; fi
if [ "$#" -ne 3 ] ; then
echo "Usage: Write to device : $0 rootfs.tgz u-boot /dev/mmcblk1"
echo " Create image file : $0 rootfs.tgz u-boot rootfs.img"
exit 1
fi
if [ $(id -u) -ne 0 ] ; then echo "Must be run as root"; exit 0; fi
UBOOT=$2
......@@ -22,23 +27,28 @@ DISK=$3
echo Image:$IMAGE Disk:$DISK U-Boot:$UBOOT
#if [ ! -d $UBOOT ] ; then echo "u-boot files not found"; exit 1; fi
if [ ! -f "${UBOOT}/MLO" ] || [ ! -f "${UBOOT}/u-boot.img" ] ; then echo "u-boot files not found"; exit 1; fi
if [ ! -f $IMAGE ] ; then echo "rootfs image $IMAGE not found."; exit 1; fi
lsblk $DISK
#if [[ $? != 0 ]] ; then echo Failed; exit 1; fi
echo "Installing to $DISK , make sure all partitions are unmounted"
if [[ "$INITHWTEST" -ne 1 ]] ; then
read -p "Are you sure you want to continue? <y/N> " prompt
if ! [[ $prompt =~ [yY](es)* ]] ; then echo "Exiting.." ; exit 1 ; fi
if [[ $DISK != /dev/* ]] ; then
echo Creating disk image
DISKIMAGE=$DISK
dd if=/dev/zero bs=1 count=0 seek=8G of="$DISKIMAGE"
DISK=$(losetup -f -P --show "${DISKIMAGE}")
else
lsblk $DISK
#if [[ $? != 0 ]] ; then echo Failed; exit 1; fi
echo "Installing to $DISK , make sure all partitions are unmounted"
if [[ "$INITHWTEST" -ne 1 ]] ; then
read -p "Are you sure you want to continue? <y/N> " prompt
if ! [[ $prompt =~ [yY](es)* ]] ; then echo "Exiting.." ; exit 1 ; fi
fi
fi
#exit 0
if [[ $DISK == /dev/mmcblk* ]] ; then
if [[ $DISK == /dev/mmcblk* ]] || [[ $DISK == /dev/loop* ]] ; then
PART=${DISK}p2
BOOTPART=${DISK}p1
......@@ -47,6 +57,9 @@ else
BOOTPART=${DISK}1
fi
echo $PART $BOOTPART
#exit
echo "Clearing partition table"
dd if=/dev/zero of=${DISK} bs=1M count=10
if [[ $? != 0 ]] ; then echo Partitioning failed.; exit 1; fi
......@@ -144,6 +157,6 @@ echo "Syncing"
sync
umount rootfs/boot
umount rootfs
if [[ -n "$DISKIMAGE" ]] ; then losetup -d $DISKIMAGE
rm rootfs -rf
echo "Done"