mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-08 22:45:43 +00:00
33 lines
731 B
Text
33 lines
731 B
Text
|
sd_fuse() {
|
||
|
if [ ! -b /dev/mmcblk0 ]; then
|
||
|
echo "No MMC device to flash, exiting."
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
echo "BL1 fusing"
|
||
|
dd if=/boot/bl1.bin.hardkernel of=/dev/mmcblk0 bs=1 count=442
|
||
|
dd if=/boot/bl1.bin.hardkernel of=/dev/mmcblk0 bs=512 skip=1 seek=1
|
||
|
echo "u-boot fusing"
|
||
|
dd if=/boot/u-boot.bin of=/dev/mmcblk0 bs=512 seek=64
|
||
|
}
|
||
|
|
||
|
flash_uboot() {
|
||
|
echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
|
||
|
echo "Do you want to do this now? [y|N]"
|
||
|
read -r shouldwe
|
||
|
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||
|
sd_fuse
|
||
|
else
|
||
|
echo "You can do this later by running:"
|
||
|
echo "# cd /boot; ./sd_fusing.sh /dev/mmcblk0"
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
post_install() {
|
||
|
flash_uboot
|
||
|
}
|
||
|
|
||
|
post_upgrade() {
|
||
|
flash_uboot
|
||
|
}
|