From 02c563a16dbf2be6e7bb2e2706172f59e3f154d9 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:12:39 -0800 Subject: [PATCH 1/7] Add PinePhone Pro to help description --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index d6eb98d..2daaa31 100755 --- a/installer.sh +++ b/installer.sh @@ -26,7 +26,7 @@ case $key in echo "" printf '%s\n' \ "This script will download the latest encrypted image for the" \ - "PinePhone and PineTab. It downloads and create a image for the user" \ + "PinePhone, PinePhone Pro, and PineTab. It downloads and create a image for the user" \ "to flash on their device or SD card." \ "" \ "usage: $0 " \ From e4174ed6fbc2c9734f060380bf21d229170f2c94 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:13:38 -0800 Subject: [PATCH 2/7] Allow user to select PinePhone Pro as option --- installer.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index 2daaa31..b0a8755 100755 --- a/installer.sh +++ b/installer.sh @@ -78,9 +78,10 @@ check_dependency "curl" # Image selection echo -e "\e[1mWhich image do you want to create?\e[0m" -select OPTION in "PinePhone" "PineTab"; do +select OPTION in "PinePhone" "PinePhone Pro" "PineTab"; do case $OPTION in "PinePhone" ) DEVICE="pinephone"; break;; + "PinePhone Pro" ) DEVICE="pinephone-pro"; break;; "PineTab" ) DEVICE="pinetab"; break;; esac done From 5997b6b5b27fb6e364bbc1378d6639b65fda8b86 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:21:07 -0800 Subject: [PATCH 3/7] Change partition table for PinePhone Pro leaving first 32MB empty --- installer.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/installer.sh b/installer.sh index b0a8755..7d14576 100755 --- a/installer.sh +++ b/installer.sh @@ -105,7 +105,7 @@ SQFSROOT="archlinux-$DEVICE-$USR_ENV-$SQFSDATE.sqfs" echo -e "\e[1mWhich filesystem would you like to use?\e[0m" select OPTION in "ext4" "f2fs"; do case $OPTION in - "ext4" ) FILESYSTEM="ext4"; break;; + "ext4" ) FILESYSTEM="ext4"; gbreak;; "f2fs" ) FILESYSTEM="f2fs"; break;; esac done @@ -149,10 +149,13 @@ chmod +x genfstab [ $FILESYSTEM = "ext4" ] && MKFS="mkfs.ext4" [ $FILESYSTEM = "f2fs" ] && MKFS="mkfs.f2fs" -sudo parted -a optimal ${DISK_IMAGE} mklabel msdos --script -sudo parted -a optimal ${DISK_IMAGE} mkpart primary fat32 '0%' 256MB --script -sudo parted -a optimal ${DISK_IMAGE} mkpart primary ext4 256MB 100% --script -sudo parted ${DISK_IMAGE} set 1 boot on --script +if [ $DEVICE == "pinephone-pro" ]; then + sudo parted -a optimal ${DISK_IMAGE} mkpart primary fat32 65536s 589823s --script + sudo parted -a optimal ${DISK_IMAGE} mkpart primary ext4 589824s 100% --script +else + sudo parted -a optimal ${DISK_IMAGE} mkpart primary fat32 '0%' 256MB --script + sudo parted -a optimal ${DISK_IMAGE} mkpart primary ext4 256MB 100% --script +fi # The first partition is the boot partition and the second one the root PARTITIONS=$(lsblk $DISK_IMAGE -l | grep ' part ' | awk '{print $1}') From 56f9532934726d40f23fcef8134ab69f11aefd07 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:21:42 -0800 Subject: [PATCH 4/7] Flash u-boot to PinePhone Pro correctly --- installer.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index 7d14576..c973ab7 100755 --- a/installer.sh +++ b/installer.sh @@ -188,7 +188,12 @@ sudo unsquashfs -f -d $TMPMOUNT $SQFSROOT ./genfstab -U $TMPMOUNT | grep UUID | grep -v "swap" | sudo tee -a $TMPMOUNT/etc/fstab sudo sed -i "s:UUID=[0-9a-f-]*\s*/\s:/dev/mapper/cryptroot / :g" $TMPMOUNT/etc/fstab -sudo dd if=${TMPMOUNT}/boot/u-boot-sunxi-with-spl-${DEVICE}-552.bin of=${DISK_IMAGE} bs=8k seek=1 +if [ $DEVICE == "pinephone-pro" ]; then + sudo dd if=${TMPMOUNT}/boot/idbloader.img of=${DISK_IMAGE} seek=64 conv=notrunc,fsync + sudo dd if=${TMPMOUNT}/boot/u-boot.itb of=${DISK_IMAGE} seek=16384 conv=notrunc,fsync +else + sudo dd if=${TMPMOUNT}/boot/u-boot-sunxi-with-spl-${DEVICE}-552.bin of=${DISK_IMAGE} bs=8k seek=1 +fi sudo umount -R $TMPMOUNT sudo cryptsetup close $ENCRYNAME From b79c81302050fc7dc75cf75d34a2585e2f782eb4 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:41:02 -0800 Subject: [PATCH 5/7] Fixed typo --- installer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh b/installer.sh index c973ab7..d4cc08a 100755 --- a/installer.sh +++ b/installer.sh @@ -105,7 +105,7 @@ SQFSROOT="archlinux-$DEVICE-$USR_ENV-$SQFSDATE.sqfs" echo -e "\e[1mWhich filesystem would you like to use?\e[0m" select OPTION in "ext4" "f2fs"; do case $OPTION in - "ext4" ) FILESYSTEM="ext4"; gbreak;; + "ext4" ) FILESYSTEM="ext4"; break;; "f2fs" ) FILESYSTEM="f2fs"; break;; esac done From f6e4e254020c13298d1b18ab53f7cd6a0d9ab340 Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Sat, 5 Mar 2022 19:42:48 -0800 Subject: [PATCH 6/7] Re-added missing lines --- installer.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/installer.sh b/installer.sh index d4cc08a..535266e 100755 --- a/installer.sh +++ b/installer.sh @@ -149,6 +149,7 @@ chmod +x genfstab [ $FILESYSTEM = "ext4" ] && MKFS="mkfs.ext4" [ $FILESYSTEM = "f2fs" ] && MKFS="mkfs.f2fs" +sudo parted -a optimal ${DISK_IMAGE} mklabel msdos --script if [ $DEVICE == "pinephone-pro" ]; then sudo parted -a optimal ${DISK_IMAGE} mkpart primary fat32 65536s 589823s --script sudo parted -a optimal ${DISK_IMAGE} mkpart primary ext4 589824s 100% --script @@ -156,6 +157,7 @@ else sudo parted -a optimal ${DISK_IMAGE} mkpart primary fat32 '0%' 256MB --script sudo parted -a optimal ${DISK_IMAGE} mkpart primary ext4 256MB 100% --script fi +sudo parted ${DISK_IMAGE} set 1 boot on --script # The first partition is the boot partition and the second one the root PARTITIONS=$(lsblk $DISK_IMAGE -l | grep ' part ' | awk '{print $1}') From dcfeca1fc7b4f503ec3e6815ef08ccae87431cec Mon Sep 17 00:00:00 2001 From: crispy-landslide <48504814+crispy-landslide@users.noreply.github.com> Date: Fri, 6 May 2022 20:36:54 -0700 Subject: [PATCH 7/7] Reflect PinePhone Pro Tow-Boot requirement --- installer.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/installer.sh b/installer.sh index 535266e..8808646 100755 --- a/installer.sh +++ b/installer.sh @@ -190,12 +190,8 @@ sudo unsquashfs -f -d $TMPMOUNT $SQFSROOT ./genfstab -U $TMPMOUNT | grep UUID | grep -v "swap" | sudo tee -a $TMPMOUNT/etc/fstab sudo sed -i "s:UUID=[0-9a-f-]*\s*/\s:/dev/mapper/cryptroot / :g" $TMPMOUNT/etc/fstab -if [ $DEVICE == "pinephone-pro" ]; then - sudo dd if=${TMPMOUNT}/boot/idbloader.img of=${DISK_IMAGE} seek=64 conv=notrunc,fsync - sudo dd if=${TMPMOUNT}/boot/u-boot.itb of=${DISK_IMAGE} seek=16384 conv=notrunc,fsync -else - sudo dd if=${TMPMOUNT}/boot/u-boot-sunxi-with-spl-${DEVICE}-552.bin of=${DISK_IMAGE} bs=8k seek=1 -fi +[ "$DEVICE" != "pinephone-pro" ] && sudo dd if=${TMPMOUNT}/boot/u-boot-sunxi-with-spl-${DEVICE}-552.bin of=${DISK_IMAGE} bs=8k seek=1 + sudo umount -R $TMPMOUNT sudo cryptsetup close $ENCRYNAME