aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/base-files
diff options
context:
space:
mode:
authorChris Blake <chrisrblake93@gmail.com>2021-10-01 09:38:56 -0500
committerChristian Lamparter <chunkeey@gmail.com>2021-10-10 16:47:41 +0200
commitfe9e5fbd7527ad4ff4f5b955823216038a80557d (patch)
treefc9bef9e858b4070e0e402a4026c3eac9bc1c924 /target/linux/x86/base-files
parentf536f5ebddd9c532a08ac4a9be3ef0c02f7bfeb8 (diff)
downloadupstream-fe9e5fbd7527ad4ff4f5b955823216038a80557d.tar.gz
upstream-fe9e5fbd7527ad4ff4f5b955823216038a80557d.tar.bz2
upstream-fe9e5fbd7527ad4ff4f5b955823216038a80557d.zip
x86: add support for Meraki MX100
This commit will add support for the Meraki MX100 in OpenWRT. Specs: * CPU: Intel Xeon E3-1200 Series 1.5GHz 2C/4T * Memory: 4GB DDR3 1600 ECC * Storage: 1GB USB NAND, 1TB SATA HDD * Wireless: None * Wired: 10x 1Gb RJ45, 2x 1Gb SFP UART: The UART header is named CONN11 and is found in the center of the mainboard. The pinout from Pin 1 (marked with a black triangle) to pin 4 is below: Pin 1: VCC Pin 2: TX Pin 3: RX Pin 4: GND Note that VCC is not required for UART on this device. Booting: 1. Flash/burn one of the images from this repo to a flash drive. 2. Take the top off the MX100, and unplug the SATA cable from the HDD. 3. Hook up UART to the MX100, plug in the USB drive, and then power up the device. 4. At the BIOS prompt, quickly press F7 and then scroll to the Save & Exit tab. 5. Scroll down to Boot Override, and select the UEFI entry for your jumpdrive. Note: UEFI booting will fail if the SATA cable for the HDD is plugged in. The issue is explained under the Flashing instructions. Flashing: 1. Ensure the MX100 is powered down, and not plugged into power. 2. Take the top off the MX100, and unplug the SATA cable from the HDD. 3. Using the Mini USB female port found by the SATA port on the motherboard, flash one of the images to the system. Example: `dd if=image of=/dev/sdb conv=fdatasync` where sdb is the USB device for the MX100's NAND. 4. Unplug the Mini USB, hook up UART to the MX100, and then power up the device. 5. At the BIOS prompt, quickly press F7 and then scroll to the Boot tab. 6. Change the boot order and set UEFI: USB DISK 2.0 as first, and USB DISK 2.0 as second. Disable the other boot options. 7. Go to Save & Exit, and then select Save Changes and Reset Note that OpenWRT will fail to boot in UEFI mode when the SATA hard drive is plugged in. To fix this, boot with the SATA disk unplugged and then run the following command: `sed -i "s|hd0,gpt1|hd1,gpt1|g" boot/grub/grub.cfg` Once the above is ran, OpenWRT will boot when the HDD is plugged into SATA. The reason this happens is the UEFI implementation for the MX100 will always set anything on SATA to HD0 instead of the onboard USB storage, so we have to accomidate it since OpenWRT's GRUB does not support detecting a boot disk via UUID. Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
Diffstat (limited to 'target/linux/x86/base-files')
-rw-r--r--target/linux/x86/base-files/etc/board.d/01_leds4
-rw-r--r--target/linux/x86/base-files/etc/board.d/02_network3
-rw-r--r--target/linux/x86/base-files/lib/upgrade/platform.sh10
3 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/x86/base-files/etc/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds
index 79e1191080..74ad2d59fe 100644
--- a/target/linux/x86/base-files/etc/board.d/01_leds
+++ b/target/linux/x86/base-files/etc/board.d/01_leds
@@ -7,6 +7,10 @@
board_config_update
case "$(board_name)" in
+cisco-mx100-hw)
+ ucidef_set_led_usbport "usb" "USB" "mx100:green:usb" "1-1-port2"
+ ucidef_set_led_default "diag" "DIAG" "mx100:green:tricolor" "1"
+ ;;
pc-engines-apu1|pc-engines-apu2|pc-engines-apu3)
ucidef_set_led_netdev "wan" "WAN" "apu:green:3" "eth0"
ucidef_set_led_netdev "lan" "LAN" "apu:green:2" "br-lan"
diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network
index 30035dcbe9..2a07518096 100644
--- a/target/linux/x86/base-files/etc/board.d/02_network
+++ b/target/linux/x86/base-files/etc/board.d/02_network
@@ -8,6 +8,9 @@
board_config_update
case "$(board_name)" in
+cisco-mx100-hw)
+ ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4 eth5 eth7 eth8 eth9 eth10 eth11" "eth6"
+ ;;
pc-engines-apu1|pc-engines-apu2|pc-engines-apu3)
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
;;
diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
index d8f2eba97e..94bf80b144 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -65,6 +65,16 @@ platform_do_bootloader_upgrade() {
"/dev/$diskdev" \
&& touch /tmp/boot/boot/grub/upgraded
+ case "$(board_name)" in
+ cisco-mx100-hw)
+ # If the MX100 is booted UEFI AND the SATA HDD exists, we need to change
+ # grub's root= to hd1 for it to boot correctly, otherwise we can keep it hd0.
+ if [ -d /sys/firmware/efi ] && [ "$(ls -a /dev/sd[a-z] | wc -w)" -gt 1 ] ; then
+ sed -i "s|hd0,${parttable}1|hd1,${parttable}1|g" /tmp/boot/boot/grub/grub.cfg
+ fi
+ ;;
+ esac
+
umount /tmp/boot
fi
}