56 lines
1.3 KiB
Bash
Executable File
56 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# LED GPIO Reference
|
|
#
|
|
# gpio [set|clear] 115 # RED
|
|
# gpio [set|clear] 114 # GREEN
|
|
# gpio [set|clear] 116 # BLUE
|
|
|
|
kver=${2}
|
|
. /etc/default/pinephone-uboot-config
|
|
|
|
# Add bootargs for state of volume keys (for extra boot options based on initramfs)
|
|
test $ROCKER_ARGS && ROCKER_TEST=$(cat <<EOF
|
|
if test "\${volume_key}" = "up"; then
|
|
setenv bootargs \${bootargs} pp.volup
|
|
fi
|
|
|
|
if test "\${volume_key}" = "down"; then
|
|
setenv bootargs \${bootargs} pp.voldown
|
|
fi
|
|
EOF
|
|
)
|
|
|
|
cat > /boot/boot.txt <<EOF
|
|
setenv bootargs ${CMDLINE}
|
|
${ROCKER_TEST}
|
|
|
|
gpio clear 115
|
|
gpio clear 114
|
|
gpio clear 116
|
|
|
|
echo "Loading Kernel..."
|
|
if load \${devtype} \${devnum}:\${bootpart} \${kernel_addr_r} /vmlinux-${kver}; then
|
|
gpio set 116
|
|
|
|
echo "Loading Device Tree..."
|
|
if load \${devtype} \${devnum}:\${bootpart} \${fdt_addr_r} /dtbs/dtbs-${kver}/\${fdtfile}; then
|
|
|
|
echo "Device Tree Loaded"
|
|
fdt addr \${fdt_addr_r}
|
|
fdt resize
|
|
|
|
echo "Booting..."
|
|
gpio clear 116
|
|
gpio set 114
|
|
if load \${devtype} \${devnum}:\${bootpart} \${ramdisk_addr_r} /initramfs-${kver}.img; then
|
|
booti \${kernel_addr_r} \${ramdisk_addr_r}:\${filesize} \${fdt_addr_r};
|
|
else
|
|
booti \${kernel_addr_r} - \${fdt_addr_r};
|
|
fi;
|
|
fi;
|
|
fi
|
|
EOF
|
|
|
|
exec mkimage -A arm64 -O linux -T script -C none -n "U-Boot boot script" -d /boot/boot.txt /boot/boot.scr
|