Heisath Posted September 22, 2018 Share Posted September 22, 2018 Hi, I updated my ClearfogPro today and noticed (that like in the last updates), updating the linux-u-boot-clearfogpro-next package fails, with the error "/dev/mmcblk2" doesn't exist". This happen obviously, because I don't have a SD Card installed, as I am using a M.2 SSD to boot and as root. Quick check inside the .deb file revealed the platform_install.sh which only tries writing the u-boot.mmc version to /dev/mmcblk2. For me this is not a big problem, I know how to get the correct u-boot into place (/usr/lib/linux-u-boot-next-clearfogpro_5.60_armhf/u-boot.sata) but new users might find it difficult. Would it be possible to let the users select the device for writing the u-boot when the mmc variant fails? Just a popup with a text saying: "Could not write u-boot to default location (sdcard/mmc), please specify device" and a textbox below... (Might even look into doing something like this myself and then send a PR) Or does Armbian normally keep track of where the u-boot is and I just did something wrong when moving from sdcard to ssd? Greetings, count-doku EDIT: Just realised this might apply to other boards to, if it would better fit into Development or so, please move. Link to comment Share on other sites More sharing options...
Heisath Posted September 26, 2018 Author Share Posted September 26, 2018 As there were no answers I suspect most people run of the sdcard / mmc anyways, or manually moving u-boot into place after an update does not bother them. So I wrote a small update code for myself (see below), feel free to use it. #!/bin/bash DIR=/usr/lib/linux-u-boot-next-clearfogpro_5.60_armhf VARIANT=u-boot.mmc DEVICE=/dev/mmcblk2 if [ -b $DEVICE ]; then echo "Writing u-boot to default location..." dd if=$DIR/$VARIANT of=$DEVICE bs=512 seek=1 status=noxfer echo "Completed!" exit 1; else echo 'Could not write the default uboot to mmc/sdcard ' read -p 'Please enter uboot variant to install: mmc, sd, sata, flash > ' VARIANT case $VARIANT in mmc|MMC|sd|SD) VARIANT=u-boot.mmc ;; sata|SATA) VARIANT=u-boot.sata ;; flash|FLASH) VARIANT=u-boot.flash ;; *) echo 'Invalid variant, aborting.' exit 0 ;; esac read -p 'Enter boot device (eg. /dev/mmcblk2) > ' DEVICE if [ ! -b $DEVICE ]; then echo "Device not available, aborting!" exit 0; fi echo '' echo 'U-Boot Path: ' $DIR echo 'Will now try to write ' $VARIANT ' to ' $DEVICE read -p 'Start writing? (yes/no)' START if [ $START == "yes" ]; then echo "Writing..." dd if=$DIR/$VARIANT of=$DEVICE bs=512 seek=1 status=noxfer echo "Completed!" exit 1 fi fi Of course things like the U-Boot Directory change and need to be adjusted. It could also be called as a parameter. I am unsure if it is possible to integrate that into Armbian as I could not find out, where the related linux-u-boot-clearfogpro-next.deb Packages gets build / comes from. Greetings, count-doku Link to comment Share on other sites More sharing options...
Recommended Posts