Skip to content
Snippets Groups Projects
Commit 40d78aac authored by minute's avatar minute
Browse files

reform-display-config: add eMMC support

parent 74daec27
No related branches found
No related tags found
1 merge request!25MNT Reform System Image v2
......@@ -9,8 +9,18 @@ fi
DTB="x"
DTB_TARGET="imx8mq-mnt-reform2.dtb"
CHOICE="$1"
BOOTPART="mmcblk1p1"
BOOTDISK="SD card"
case "$1" in
if [[ "--emmc" == "$1" ]]
then
CHOICE="$2"
BOOTPART="mmcblk0p1"
BOOTDISK="eMMC"
fi
case "$CHOICE" in
dual) DTB="imx8mq-mnt-reform2-dual-display.dtb";;
single) DTB="imx8mq-mnt-reform2-single-display.dtb";;
esac
......@@ -18,12 +28,13 @@ esac
if [[ "$DTB" == "x" ]]
then
echo "Usage: "
echo " reform-display-config dual Select dual-display support (internal + HDMI)."
echo " reform-display-config single Select only internal display (turns off HDMI)."
echo " reform-display-config dual Select dual-display support (internal + HDMI)."
echo " reform-display-config single Select only internal display (turns off HDMI)."
echo " reform-display-config --emmc dual|single Record choice on eMMC."
exit
fi
MOUNTED_AT=$(mount | grep mmcblk1p1 | grep "on /" | cut -d ' ' -s -f 3)
MOUNTED_AT=$(mount | grep $BOOTPART | grep "on /" | cut -d ' ' -s -f 3)
if [[ "x$MOUNTED_AT" != "x" ]]
then
if [[ -e "${MOUNTED_AT}/${DTB_TARGET}" ]] && [[ -e "${MOUNTED_AT}/${DTB}" ]]
......@@ -34,17 +45,17 @@ then
exit
fi
echo "Error: the SD card is already mounted at $MOUNTED_AT, but the DTB files ($DTB_TARGET and $DTB) are not there."
echo "Error: the $BOOTDISK is already mounted at $MOUNTED_AT, but the DTB files ($DTB_TARGET and $DTB) are not there."
exit
fi
echo "Assuming boot files are on SD card, but your system is not. Mounting /dev/mmcblk1p1 on /boot."
echo "Assuming boot files are on $BOOTDISK, but your system is not. Mounting /dev/$BOOTPART on /boot."
mount /dev/mmcblk1p1 /boot
mount /dev/$BOOTPART /boot
if [[ -e "/boot/$DTB_TARGET" ]] && [[ -e "/boot/$DTB" ]]
then
echo "Found source and target files in /boot."
echo "Found source and target files in the root directory of $BOOTPART."
cp -v "/boot/$DTB" "/boot/$DTB_TARGET"
echo "Restart MNT Reform (type: reboot) after saving your work to activate the changes."
umount /boot
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment