mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
36 lines
775 B
Text
36 lines
775 B
Text
|
sd_fuse() {
|
||
|
if [ ! -b /dev/mmcblk0 ]; then
|
||
|
echo "No MMC device to flash, exiting."
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
# Flash U-Boot
|
||
|
dd if=/boot/u-boot-clearfog.mmc of=/dev/mmcblk0 bs=512 seek=1
|
||
|
|
||
|
# Zero out old U-Boot environment
|
||
|
dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=1920 count=128
|
||
|
|
||
|
#Flash new U-Boot environemnt
|
||
|
dd if=/boot/clearfog.env of=/dev/mmcblk0 bs=512 seek=1920
|
||
|
}
|
||
|
|
||
|
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
|
||
|
}
|