Skip to content

Commit 0bd5575

Browse files
committed
stop hardcoding the emmc, the emmc will always have a boot0 device
1 parent 4a8e0ad commit 0bd5575

File tree

3 files changed

+21
-34
lines changed

3 files changed

+21
-34
lines changed

kernel/resources/shared/FlashKernelPartition.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,27 @@ get_device() {
3333
}
3434

3535
get_emmc_devname() {
36-
local device=$(get_device)
37-
case "$device" in
38-
$device_veyron_speedy) local devname=mmcblk2;;
39-
$device_veyron_minnie) local devname=mmcblk2;;
40-
$device_veyron_mickey) local devname=mmcblk2;;
41-
$device_gru_kevin) local devname=mmcblk0;;
42-
$device_gru_bob) local devname=mmcblk0;;
43-
* ) 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;;
44-
esac
36+
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
37+
if [ -z "$devname" ]
38+
then
39+
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;;
40+
fi
4541
echo $devname
4642
}
4743

48-
4944
get_sd_devname() {
5045
local device=$(get_device)
5146
case "$device" in
5247
$device_veyron_speedy) local devname=mmcblk0;;
5348
$device_veyron_minnie) local devname=mmcblk0;;
54-
$device_veyron_mickey) local devname=mmcblk0;;
55-
$device_gru_kevin) local devname=mmcblk1;;
56-
$device_gru_bob) local devname=mmcblk1;;
49+
$device_veyron_mickey) local devname="";;
50+
$device_gru_kevin) local devname=mmcblk0;;
51+
$device_gru_bob) local devname=mmcblk0;;
5752
* ) 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;;
5853
esac
5954
echo $devname
6055
}
56+
6157
### END SHARED CONST AND VARS
6258

6359
# -----------------------------------------------

scripts/InstallScripts/InstallPackages.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,20 @@ get_device() {
3434
}
3535

3636
get_emmc_devname() {
37-
local device=$(get_device)
38-
case "$device" in
39-
$device_veyron_speedy) local devname=mmcblk2;;
40-
$device_veyron_minnie) local devname=mmcblk2;;
41-
$device_veyron_mickey) local devname=mmcblk1;;
42-
$device_gru_kevin) local devname=mmcblk1;;
43-
$device_gru_bob) local devname=mmcblk1;;
44-
* ) 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;;
45-
esac
37+
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
38+
if [ -z "$devname" ]
39+
then
40+
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;;
41+
fi
4642
echo $devname
4743
}
4844

49-
5045
get_sd_devname() {
5146
local device=$(get_device)
5247
case "$device" in
5348
$device_veyron_speedy) local devname=mmcblk0;;
5449
$device_veyron_minnie) local devname=mmcblk0;;
55-
$device_veyron_mickey) local devname=mmcblk0;;
50+
$device_veyron_mickey) local devname="";;
5651
$device_gru_kevin) local devname=mmcblk0;;
5752
$device_gru_bob) local devname=mmcblk0;;
5853
* ) 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;;

scripts/InstallScripts/InstallPrawnOS.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,11 @@ get_device() {
3737
}
3838

3939
get_emmc_devname() {
40-
local device=$(get_device)
41-
case "$device" in
42-
$device_veyron_speedy) local devname=mmcblk2;;
43-
$device_veyron_minnie) local devname=mmcblk2;;
44-
$device_veyron_mickey) local devname=mmcblk1;;
45-
$device_gru_kevin) local devname=mmcblk1;;
46-
$device_gru_bob) local devname=mmcblk1;;
47-
* ) 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;;
48-
esac
40+
local devname=$(ls /dev/mmcblk* | grep -F boot0 | sed "s/boot0//")
41+
if [ -z "$devname" ]
42+
then
43+
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;;
44+
fi
4945
echo $devname
5046
}
5147

@@ -55,7 +51,7 @@ get_sd_devname() {
5551
case "$device" in
5652
$device_veyron_speedy) local devname=mmcblk0;;
5753
$device_veyron_minnie) local devname=mmcblk0;;
58-
$device_veyron_mickey) local devname=mmcblk0;;
54+
$device_veyron_mickey) local devname="";;
5955
$device_gru_kevin) local devname=mmcblk0;;
6056
$device_gru_bob) local devname=mmcblk0;;
6157
* ) 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;;

0 commit comments

Comments
 (0)