Skip to content

Commit

Permalink
stop hardcoding the emmc, the emmc will always have a boot0 device
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidHal committed Dec 19, 2020
1 parent 4a8e0ad commit 0bd5575
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
22 changes: 9 additions & 13 deletions kernel/resources/shared/FlashKernelPartition.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,27 @@ get_device() {
}

get_emmc_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk2;;
$device_veyron_minnie) local devname=mmcblk2;;
$device_veyron_mickey) local devname=mmcblk2;;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
if [ -z "$devname" ]
then
echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
fi
echo $devname
}


get_sd_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk0;;
$device_veyron_minnie) local devname=mmcblk0;;
$device_veyron_mickey) local devname=mmcblk0;;
$device_gru_kevin) local devname=mmcblk1;;
$device_gru_bob) local devname=mmcblk1;;
$device_veyron_mickey) local devname="";;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine sd card devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
echo $devname
}

### END SHARED CONST AND VARS

# -----------------------------------------------
Expand Down
17 changes: 6 additions & 11 deletions scripts/InstallScripts/InstallPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,20 @@ get_device() {
}

get_emmc_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk2;;
$device_veyron_minnie) local devname=mmcblk2;;
$device_veyron_mickey) local devname=mmcblk1;;
$device_gru_kevin) local devname=mmcblk1;;
$device_gru_bob) local devname=mmcblk1;;
* ) echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
if [ -z "$devname" ]
then
echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
fi
echo $devname
}


get_sd_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk0;;
$device_veyron_minnie) local devname=mmcblk0;;
$device_veyron_mickey) local devname=mmcblk0;;
$device_veyron_mickey) local devname="";;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine sd card devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
Expand Down
16 changes: 6 additions & 10 deletions scripts/InstallScripts/InstallPrawnOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,11 @@ get_device() {
}

get_emmc_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk2;;
$device_veyron_minnie) local devname=mmcblk2;;
$device_veyron_mickey) local devname=mmcblk1;;
$device_gru_kevin) local devname=mmcblk1;;
$device_gru_bob) local devname=mmcblk1;;
* ) echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
if [ -z "$devname" ]
then
echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
fi
echo $devname
}

Expand All @@ -55,7 +51,7 @@ get_sd_devname() {
case "$device" in
$device_veyron_speedy) local devname=mmcblk0;;
$device_veyron_minnie) local devname=mmcblk0;;
$device_veyron_mickey) local devname=mmcblk0;;
$device_veyron_mickey) local devname="";;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine sd card devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
Expand Down

0 comments on commit 0bd5575

Please sign in to comment.