mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
35 lines
1.1 KiB
Text
35 lines
1.1 KiB
Text
flash_uboot() {
|
|
if mountpoint -d /boot > /dev/null 2>&1; then
|
|
base=/boot
|
|
else
|
|
base=/
|
|
fi
|
|
major=$(mountpoint -d $base | cut -f 1 -d ':')
|
|
minor=$(expr $(mountpoint -d $base | cut -f 2 -d ':') - 1)
|
|
device=/dev/$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
|
|
|
|
echo "A new U-Boot version needs to be flashed onto ${device}."
|
|
echo "Do you want to do this now? [y|N]"
|
|
read -r shouldwe
|
|
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
|
dd if=/boot/SPL of=${device} bs=1K seek=1
|
|
dd if=/boot/u-boot.img of=${device} bs=1K seek=69
|
|
sync
|
|
else
|
|
echo "You can do this later by running:"
|
|
echo "# dd if=/boot/SPL of=${device} bs=1K seek=1"
|
|
echo "# dd if=/boot/u-boot.img of=${device} bs=1K seek=69"
|
|
fi
|
|
}
|
|
|
|
post_install() {
|
|
flash_uboot
|
|
}
|
|
|
|
post_upgrade() {
|
|
flash_uboot
|
|
if (( $(vercmp $2 2017.01-1) < 0 )); then
|
|
echo ' >>> Note: uEnv.txt is no longer sourced. Make any customizations within /boot/boot.txt'
|
|
echo ' and run ./mkscr within /boot to convert it to the boot.scr file.'
|
|
fi
|
|
}
|