Commit d4422364 authored by Dalton Durst's avatar Dalton Durst

Check a flag file to decide whether to boot into recovery

With these changes, u-boot checks for the existence of
/persist/reboot-recovery to decide when to reboot into recovery (in
addition to holding the volume up key). By including a blank persist
partition in the device tarball, we ensure that the flag file is
deleted when an update completes. Otherwise, we can delete the flag
file early in Jumpdrive's init.

Additionally, disable the framebuffer console on the internal screen
and set 'systempart' and 'devnum' kernel cmdline arguments using
u-boot's devnum variable. This will help us run on either eMMC or SD.

This isn't a good option, but it will do until we find something else.
parent b81994a8
......@@ -24,6 +24,7 @@ $SCRIPT/ ${TMPDOWN}/linux-image-*-pine64_*.deb ${HERE}/initrd.i
$SCRIPT/ ${TMP}/system
$SCRIPT/ ${TMP}/system
$SCRIPT/ uboot ${TMP}/partitions/
$SCRIPT/ uboot ${TMP}/partitions/
cp ${TMPDOWN}/u-boot-sunxi-with-spl-pinephone.bin ${TMP}/partitions/loader.img
cp recovery-pinephone.img ${TMP}/partitions/recovery.img
set -xe
truncate --size 500K persist.img
mkfs.ext2 persist.img
mv persist.img $OUT
echo "done"
cache /cache ext4 defaults
boot_a /boot ext4 defaults
persist /persist ext4 defaults
# White
gpio set 114; gpio set 115; gpio set 116
setenv bootargs console=tty0 console=${console} systempart=/dev/mmcblk0p9
setenv bootargs console=${console} systempart=/dev/mmcblk${devnum}p9 devnum=${devnum}
setenv kernel_addr_z 0x44080000
echo "[UBPORTS] Bootargs are" ${bootargs}
echo "[UBPORTS] Beginning load"
if test "${volume_key}" = "up"; then
if test "${volume_key}" = "up" -o -e ${devtype} ${devnum}:3 reboot-recovery; then
# recovery-a partition
setenv partnum 6
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment