example-kit/get_rwl_file.sh
#!/bin/bash

# large amounts of code borrowed from https://github.com/MrChromebox/scripts/, licensed under the Unlicense


#UEFI Full ROMs
#SNB/IVB
export coreboot_uefi_butterfly="coreboot_edk2-butterfly-mrchromebox_20230515.rom"
export coreboot_uefi_lumpy="coreboot_edk2-lumpy-mrchromebox_20230515.rom"
export coreboot_uefi_link="coreboot_edk2-link-mrchromebox_20230515.rom"
export coreboot_uefi_parrot="coreboot_edk2-parrot-mrchromebox_20230515.rom"
export coreboot_uefi_stout="coreboot_edk2-stout-mrchromebox_20230515.rom"
export coreboot_uefi_stumpy="coreboot_edk2-stumpy-mrchromebox_20230515.rom"

#Haswell
export coreboot_uefi_falco="coreboot_edk2-falco-mrchromebox_20230515.rom"
export coreboot_uefi_leon="coreboot_edk2-leon-mrchromebox_20230515.rom"
export coreboot_uefi_mccloud="coreboot_edk2-mccloud-mrchromebox_20230515.rom"
export coreboot_uefi_monroe="coreboot_edk2-monroe-mrchromebox_20230515.rom"
export coreboot_uefi_panther="coreboot_edk2-panther-mrchromebox_20230515.rom"
export coreboot_uefi_peppy="coreboot_edk2-peppy-mrchromebox_20230515.rom"
export coreboot_uefi_tricky="coreboot_edk2-tricky-mrchromebox_20230515.rom"
export coreboot_uefi_wolf="coreboot_edk2-wolf-mrchromebox_20230515.rom"
export coreboot_uefi_zako="coreboot_edk2-zako-mrchromebox_20230515.rom"

#Broadwell
export coreboot_uefi_auron_paine="coreboot_edk2-auron_paine-mrchromebox_20230515.rom"
export coreboot_uefi_auron_yuna="coreboot_edk2-auron_yuna-mrchromebox_20230515.rom"
export coreboot_uefi_buddy="coreboot_edk2-buddy-mrchromebox_20230515.rom"
export coreboot_uefi_gandof="coreboot_edk2-gandof-mrchromebox_20230515.rom"
export coreboot_uefi_guado="coreboot_edk2-guado-mrchromebox_20230515.rom"
export coreboot_uefi_lulu="coreboot_edk2-lulu-mrchromebox_20230515.rom"
export coreboot_uefi_rikku="coreboot_edk2-rikku-mrchromebox_20230515.rom"
export coreboot_uefi_samus="coreboot_edk2-samus-mrchromebox_20230515.rom"
export coreboot_uefi_tidus="coreboot_edk2-tidus-mrchromebox_20230515.rom"

#Baytrail
export coreboot_uefi_banjo="coreboot_edk2-banjo-mrchromebox_20230515.rom"
export coreboot_uefi_candy="coreboot_edk2-candy-mrchromebox_20230515.rom"
export coreboot_uefi_clapper="coreboot_edk2-clapper-mrchromebox_20230515.rom"
export coreboot_uefi_enguarde="coreboot_edk2-enguarde-mrchromebox_20230515.rom"
export coreboot_uefi_glimmer="coreboot_edk2-glimmer-mrchromebox_20230515.rom"
export coreboot_uefi_gnawty="coreboot_edk2-gnawty-mrchromebox_20230515.rom"
export coreboot_uefi_heli="coreboot_edk2-heli-mrchromebox_20230515.rom"
export coreboot_uefi_kip="coreboot_edk2-kip-mrchromebox_20230515.rom"
export coreboot_uefi_ninja="coreboot_edk2-ninja-mrchromebox_20230515.rom"
export coreboot_uefi_orco="coreboot_edk2-orco-mrchromebox_20230515.rom"
export coreboot_uefi_quawks="coreboot_edk2-quawks-mrchromebox_20230515.rom"
export coreboot_uefi_squawks="coreboot_edk2-squawks-mrchromebox_20230515.rom"
export coreboot_uefi_sumo="coreboot_edk2-sumo-mrchromebox_20230515.rom"
export coreboot_uefi_swanky="coreboot_edk2-swanky-mrchromebox_20230515.rom"
export coreboot_uefi_winky="coreboot_edk2-winky-mrchromebox_20230515.rom"

#Braswell
export coreboot_uefi_banon="coreboot_edk2-banon-mrchromebox_20230515.rom"
export coreboot_uefi_celes="coreboot_edk2-celes-mrchromebox_20230515.rom"
export coreboot_uefi_cyan="coreboot_edk2-cyan-mrchromebox_20230519.rom"
export coreboot_uefi_edgar="coreboot_edk2-edgar-mrchromebox_20230515.rom"
export coreboot_uefi_kefka="coreboot_edk2-kefka-mrchromebox_20230515.rom"
export coreboot_uefi_reks="coreboot_edk2-reks-mrchromebox_20230515.rom"
export coreboot_uefi_relm="coreboot_edk2-relm-mrchromebox_20230515.rom"
export coreboot_uefi_setzer="coreboot_edk2-setzer-mrchromebox_20230515.rom"
export coreboot_uefi_terra="coreboot_edk2-terra-mrchromebox_20230515.rom"
export coreboot_uefi_ultima="coreboot_edk2-ultima-mrchromebox_20230515.rom"
export coreboot_uefi_wizpig="coreboot_edk2-wizpig-mrchromebox_20230515.rom"

#Skylake
export coreboot_uefi_asuka="coreboot_edk2-asuka-mrchromebox_20230515.rom"
export coreboot_uefi_caroline="coreboot_edk2-caroline-mrchromebox_20230515.rom"
export coreboot_uefi_cave="coreboot_edk2-cave-mrchromebox_20230515.rom"
export coreboot_uefi_chell="coreboot_edk2-chell-mrchromebox_20230515.rom"
export coreboot_uefi_lars="coreboot_edk2-lars-mrchromebox_20230515.rom"
export coreboot_uefi_sentry="coreboot_edk2-sentry-mrchromebox_20230515.rom"

#KabyLake
export coreboot_uefi_atlas="coreboot_edk2-atlas-mrchromebox_20230515.rom"
export coreboot_uefi_eve="coreboot_edk2-eve-mrchromebox_20230515.rom"
export coreboot_uefi_fizz="coreboot_edk2-fizz-mrchromebox_20230515.rom"
export coreboot_uefi_karma="coreboot_edk2-karma-mrchromebox_20230515.rom"
export coreboot_uefi_leona="coreboot_edk2-leona-mrchromebox_20230515.rom"
export coreboot_uefi_nami="coreboot_edk2-nami-mrchromebox_20230515.rom"
export coreboot_uefi_nautilus="coreboot_edk2-nautilus-mrchromebox_20230515.rom"
export coreboot_uefi_nocturne="coreboot_edk2-nocturne-mrchromebox_20230515.rom"
export coreboot_uefi_shyvana="coreboot_edk2-shyvana-mrchromebox_20230515.rom"
export coreboot_uefi_soraka="coreboot_edk2-soraka-mrchromebox_20230515.rom"

#ApolloLake
export coreboot_uefi_astronaut="coreboot_edk2-astronaut-mrchromebox_20230515.rom"
export coreboot_uefi_babymega="coreboot_edk2-babymega-mrchromebox_20230515.rom"
export coreboot_uefi_babytiger="coreboot_edk2-babytiger-mrchromebox_20230515.rom"
export coreboot_uefi_blacktip="coreboot_edk2-blacktip-mrchromebox_20230515.rom"
export coreboot_uefi_blue="coreboot_edk2-blue-mrchromebox_20230515.rom"
export coreboot_uefi_bruce="coreboot_edk2-bruce-mrchromebox_20230515.rom"
export coreboot_uefi_coral="coreboot_edk2-coral-mrchromebox_20230515.rom"
export coreboot_uefi_electro="coreboot_edk2-electro-mrchromebox_20230515.rom"
export coreboot_uefi_epaulette="coreboot_edk2-epaulette-mrchromebox_20230515.rom"
export coreboot_uefi_lava="coreboot_edk2-lava-mrchromebox_20230515.rom"
export coreboot_uefi_nasher="coreboot_edk2-nasher-mrchromebox_20230515.rom"
export coreboot_uefi_nasher360="coreboot_edk2-nasher360-mrchromebox_20230515.rom"
export coreboot_uefi_pyro="coreboot_edk2-pyro-mrchromebox_20230515.rom"
export coreboot_uefi_rabbid="coreboot_edk2-rabbid-mrchromebox_20230515.rom"
export coreboot_uefi_reef="coreboot_edk2-reef-mrchromebox_20230515.rom"
export coreboot_uefi_robo="coreboot_edk2-robo-mrchromebox_20230515.rom"
export coreboot_uefi_robo360="coreboot_edk2-robo360-mrchromebox_20230515.rom"
export coreboot_uefi_sand="coreboot_edk2-sand-mrchromebox_20230515.rom"
export coreboot_uefi_santa="coreboot_edk2-santa-mrchromebox_20230515.rom"
export coreboot_uefi_snappy="coreboot_edk2-snappy-mrchromebox_20230515.rom"
export coreboot_uefi_whitetip="coreboot_edk2-whitetip-mrchromebox_20230515.rom"

#GeminiLake
export coreboot_uefi_ampton="coreboot_edk2-ampton-mrchromebox_20230515.rom"
export coreboot_uefi_apel="coreboot_edk2-apel-mrchromebox_20230515.rom"
export coreboot_uefi_bloog="coreboot_edk2-bloog-mrchromebox_20230515.rom"
export coreboot_uefi_blooglet="coreboot_edk2-blooglet-mrchromebox_20230515.rom"
export coreboot_uefi_blooguard="coreboot_edk2-blooguard-mrchromebox_20230515.rom"
export coreboot_uefi_blorb="coreboot_edk2-blorb-mrchromebox_20230515.rom"
export coreboot_uefi_bluebird="coreboot_edk2-bluebird-mrchromebox_20230515.rom"
export coreboot_uefi_bobba="coreboot_edk2-bobba-mrchromebox_20230515.rom"
export coreboot_uefi_bobba360="coreboot_edk2-bobba360-mrchromebox_20230515.rom"
export coreboot_uefi_casta="coreboot_edk2-casta-mrchromebox_20230515.rom"
export coreboot_uefi_dood="coreboot_edk2-dood-mrchromebox_20230515.rom"
export coreboot_uefi_dorp="coreboot_edk2-dorp-mrchromebox_20230515.rom"
export coreboot_uefi_droid="coreboot_edk2-droid-mrchromebox_20230515.rom"
export coreboot_uefi_fleex="coreboot_edk2-fleex-mrchromebox_20230515.rom"
export coreboot_uefi_foob="coreboot_edk2-foob-mrchromebox_20230515.rom"
export coreboot_uefi_foob360="coreboot_edk2-foob360-mrchromebox_20230515.rom"
export coreboot_uefi_garfour="coreboot_edk2-garfour-mrchromebox_20230515.rom"
export coreboot_uefi_garg="coreboot_edk2-garg-mrchromebox_20230515.rom"
export coreboot_uefi_garg360="coreboot_edk2-garg360-mrchromebox_20230515.rom"
export coreboot_uefi_grabbiter="coreboot_edk2-grabbiter-mrchromebox_20230515.rom"
export coreboot_uefi_laser="coreboot_edk2-laser-mrchromebox_20230515.rom"
export coreboot_uefi_laser14="coreboot_edk2-laser14-mrchromebox_20230515.rom"
export coreboot_uefi_lick="coreboot_edk2-lick-mrchromebox_20230515.rom"
export coreboot_uefi_meep="coreboot_edk2-meep-mrchromebox_20230515.rom"
export coreboot_uefi_mimrock="coreboot_edk2-mimrock-mrchromebox_20230515.rom"
export coreboot_uefi_nospike="coreboot_edk2-nospike-mrchromebox_20230515.rom"
export coreboot_uefi_orbatrix="coreboot_edk2-orbatrix-mrchromebox_20230515.rom"
export coreboot_uefi_phaser="coreboot_edk2-phaser-mrchromebox_20230515.rom"
export coreboot_uefi_phaser360="coreboot_edk2-phaser360-mrchromebox_20230515.rom"
export coreboot_uefi_phaser360s="coreboot_edk2-phaser360s-mrchromebox_20230515.rom"
export coreboot_uefi_sparky="coreboot_edk2-sparky-mrchromebox_20230515.rom"
export coreboot_uefi_sparky360="coreboot_edk2-sparky360-mrchromebox_20230515.rom"
export coreboot_uefi_vorticon="coreboot_edk2-vorticon-mrchromebox_20230515.rom"
export coreboot_uefi_vortininja="coreboot_edk2-vortininja-mrchromebox_20230515.rom"

#Stoneyridge
export coreboot_uefi_aleena="coreboot_edk2-aleena-mrchromebox_20230515.rom"
export coreboot_uefi_barla="coreboot_edk2-barla-mrchromebox_20230515.rom"
export coreboot_uefi_careena="coreboot_edk2-careena-mrchromebox_20230515.rom"
export coreboot_uefi_kasumi="coreboot_edk2-kasumi-mrchromebox_20230515.rom"
export coreboot_uefi_liara="coreboot_edk2-liara-mrchromebox_20230515.rom"
export coreboot_uefi_treeya="coreboot_edk2-treeya-mrchromebox_20230515.rom"

#CometLake
export coreboot_uefi_akemi="coreboot_edk2-akemi-mrchromebox_20230515.rom"
export coreboot_uefi_dragonair="coreboot_edk2-dragonair-mrchromebox_20230515.rom"
export coreboot_uefi_drallion="coreboot_edk2-drallion-mrchromebox_20230515.rom"
export coreboot_uefi_dratini="coreboot_edk2-dratini-mrchromebox_20230515.rom"
export coreboot_uefi_duffy="coreboot_edk2-duffy-mrchromebox_20230515.rom"
export coreboot_uefi_faffy="coreboot_edk2-faffy-mrchromebox_20230515.rom"
export coreboot_uefi_helios="coreboot_edk2-helios-mrchromebox_20230515.rom"
export coreboot_uefi_jinlon="coreboot_edk2-jinlon-mrchromebox_20230515.rom"
export coreboot_uefi_kaisa="coreboot_edk2-kaisa-mrchromebox_20230515.rom"
export coreboot_uefi_kindred="coreboot_edk2-kindred-mrchromebox_20230515.rom"
export coreboot_uefi_kled="coreboot_edk2-kled-mrchromebox_20230515.rom"
export coreboot_uefi_kohaku="coreboot_edk2-kohaku-mrchromebox_20230515.rom"
export coreboot_uefi_nightfury="coreboot_edk2-nightfury-mrchromebox_20230515.rom"
export coreboot_uefi_noibat="coreboot_edk2-noibat-mrchromebox_20230515.rom"
export coreboot_uefi_wyvern="coreboot_edk2-wyvern-mrchromebox_20230515.rom"

#Tigerlake
export coreboot_uefi_chronicler="coreboot_edk2-chronicler-mrchromebox_20230515.rom"
export coreboot_uefi_collis="coreboot_edk2-collis-mrchromebox_20230515.rom"
export coreboot_uefi_copano="coreboot_edk2-copano-mrchromebox_20230515.rom"
export coreboot_uefi_delbin="coreboot_edk2-delbin-mrchromebox_20230515.rom"
export coreboot_uefi_drobit="coreboot_edk2-drobit-mrchromebox_20230515.rom"
export coreboot_uefi_eldrid="coreboot_edk2-eldrid-mrchromebox_20230515.rom"
export coreboot_uefi_elemi="coreboot_edk2-elemi-mrchromebox_20230515.rom"
export coreboot_uefi_lillipup="coreboot_edk2-lillipup-mrchromebox_20230515.rom"
export coreboot_uefi_lindar="coreboot_edk2-lindar-mrchromebox_20230515.rom"
export coreboot_uefi_voema="coreboot_edk2-voema-mrchromebox_20230515.rom"
export coreboot_uefi_volet="coreboot_edk2-volet-mrchromebox_20230515.rom"
export coreboot_uefi_volta="coreboot_edk2-volta-mrchromebox_20230515.rom"
export coreboot_uefi_voxel="coreboot_edk2-voxel-mrchromebox_20230515.rom"

#Jasperlake
export coreboot_uefi_beetley="coreboot_edk2-beetley-mrchromebox_20230515.rom"
export coreboot_uefi_blipper="coreboot_edk2-blipper-mrchromebox_20230515.rom"
export coreboot_uefi_bookem="coreboot_edk2-bookem-mrchromebox_20230515.rom"
export coreboot_uefi_boten="coreboot_edk2-boten-mrchromebox_20230515.rom"
export coreboot_uefi_botenflex="coreboot_edk2-botenflex-mrchromebox_20230515.rom"
export coreboot_uefi_bugzzy="coreboot_edk2-bugzzy-mrchromebox_20230515.rom"
export coreboot_uefi_cret="coreboot_edk2-cret-mrchromebox_20230515.rom"
export coreboot_uefi_cret360="coreboot_edk2-cret360-mrchromebox_20230515.rom"
export coreboot_uefi_drawcia="coreboot_edk2-drawcia-mrchromebox_20230515.rom"
export coreboot_uefi_drawlat="coreboot_edk2-drawlat-mrchromebox_20230515.rom"
export coreboot_uefi_drawman="coreboot_edk2-drawman-mrchromebox_20230515.rom"
export coreboot_uefi_drawper="coreboot_edk2-drawper-mrchromebox_20230515.rom"
export coreboot_uefi_galith="coreboot_edk2-galith-mrchromebox_20230515.rom"
export coreboot_uefi_galith360="coreboot_edk2-galith360-mrchromebox_20230515.rom"
export coreboot_uefi_gallop="coreboot_edk2-gallop-mrchromebox_20230515.rom"
export coreboot_uefi_galnat="coreboot_edk2-galnat-mrchromebox_20230515.rom"
export coreboot_uefi_galnat360="coreboot_edk2-galnat360-mrchromebox_20230515.rom"
export coreboot_uefi_galtic="coreboot_edk2-galtic-mrchromebox_20230515.rom"
export coreboot_uefi_galtic360="coreboot_edk2-galtic360-mrchromebox_20230515.rom"
export coreboot_uefi_kracko="coreboot_edk2-kracko-mrchromebox_20230515.rom"
export coreboot_uefi_kracko360="coreboot_edk2-kracko360-mrchromebox_20230515.rom"
export coreboot_uefi_lantis="coreboot_edk2-lantis-mrchromebox_20230515.rom"
export coreboot_uefi_madoo="coreboot_edk2-madoo-mrchromebox_20230515.rom"
export coreboot_uefi_maglia="coreboot_edk2-maglia-mrchromebox_20230515.rom"
export coreboot_uefi_magolor="coreboot_edk2-magolor-mrchromebox_20230515.rom"
export coreboot_uefi_magpie="coreboot_edk2-magpie-mrchromebox_20230515.rom"
export coreboot_uefi_sasuke="coreboot_edk2-sasuke-mrchromebox_20230515.rom"
export coreboot_uefi_storo="coreboot_edk2-storo-mrchromebox_20230515.rom"
export coreboot_uefi_storo360="coreboot_edk2-storo360-mrchromebox_20230515.rom"

#alderlake
export coreboot_uefi_anahera="coreboot_edk2-anahera-mrchromebox_20230515.rom"
export coreboot_uefi_banshee="coreboot_edk2-banshee-mrchromebox_20230515.rom"
export coreboot_uefi_crota="coreboot_edk2-crota-mrchromebox_20230515.rom"
export coreboot_uefi_crota360="coreboot_edk2-crota360-mrchromebox_20230515.rom"
export coreboot_uefi_felwinter="coreboot_edk2-felwinter-mrchromebox_20230515.rom"
export coreboot_uefi_kano="coreboot_edk2-kano-mrchromebox_20230515.rom"
export coreboot_uefi_mithrax="coreboot_edk2-mithrax-mrchromebox_20230515.rom"
export coreboot_uefi_osiris="coreboot_edk2-osiris-mrchromebox_20230515.rom"
export coreboot_uefi_primus="coreboot_edk2-primus-mrchromebox_20230515.rom"
export coreboot_uefi_redrix="coreboot_edk2-redrix-mrchromebox_20230515.rom"
export coreboot_uefi_taniks="coreboot_edk2-taniks-mrchromebox_20230523.rom"
export coreboot_uefi_volmar="coreboot_edk2-volmar-mrchromebox_20230515.rom"
export coreboot_uefi_zavala="coreboot_edk2-zavala-mrchromebox_20230515.rom"


#RW_LEGACY payloads
export seabios_link="seabios-link-mrchromebox_20180912.bin"
export seabios_hswbdw_box="seabios-hswbdw_box-mrchromebox_20180912.bin"
export seabios_hswbdw_book="seabios-hswbdw_book-mrchromebox_20180912.bin"
export seabios_baytrail="seabios-byt-mrchromebox_20180912.bin"
export seabios_braswell="seabios-bsw-mrchromebox_20180912.bin"
export seabios_skylake="seabios-skl-mrchromebox_20180912.bin"
export seabios_apl="seabios-apl-mrchromebox_20180912.bin"
export seabios_kbl="seabios-kbl-mrchromebox_20200223.bin"
export seabios_kbl_18="seabios-kbl_18-mrchromebox_20200223.bin"
export rwl_altfw_stoney="rwl_altfw_stoney-mrchromebox_20200107.bin"
export rwl_altfw_whl="rwl_altfw_whl-mrchromebox_20201017.bin"
export rwl_altfw_cml="rwl_altfw_cml-mrchromebox_20210415.bin"
export rwl_altfw_drallion="rwl_altfw_drallion-mrchromebox_20221019.bin"
export rwl_altfw_glk="rwl_altfw_glk-mrchromebox_20230110.bin"
export rwl_altfw_jsl="rwl_altfw_jsl-mrchromebox_20211115.bin"
export rwl_altfw_zen2="rwl_altfw_zen2-mrchromebox_20210623.bin"
export rwl_altfw_tgl="rwl_altfw_tgl-mrchromebox_20210827.bin"
export rwl_altfw_adl="rwl_altfw_adl-mrchromebox_20230509.bin"

#hsw/bdw headless VBIOS
export hswbdw_headless_vbios="hswbdw_vgabios_1040_cbox_headless.dat"

#PXE ROM for Chromeboxes w/RTL81xx ethernet
export pxe_optionrom="10ec8168.rom"

#Non-ChromeOS devices
export coreboot_uefi_librem13v1="coreboot_edk2-librem_13v1-mrchromebox_20230515.rom"
export coreboot_uefi_librem13v2="coreboot_edk2-librem_13v2-mrchromebox_20230515.rom"
export coreboot_uefi_librem13v4="coreboot_edk2-librem_13v4-mrchromebox_20230515.rom"
export coreboot_uefi_librem15v2="coreboot_edk2-librem_15v2-mrchromebox_20230515.rom"
export coreboot_uefi_librem15v3="coreboot_edk2-librem_15v3-mrchromebox_20230515.rom"
export coreboot_uefi_librem15v4="coreboot_edk2-librem_15v4-mrchromebox_20230515.rom"
export coreboot_uefi_librem_mini="coreboot_edk2-librem_mini-mrchromebox_20230515.rom"
export coreboot_uefi_librem_mini_v2="coreboot_edk2-librem_mini_v2-mrchromebox_20230515.rom"
export coreboot_uefi_librem_14="coreboot_edk2-librem_14-mrchromebox_20230515.rom"

# other
export touchpad_eve_fw="rose_v1.1.8546-ee1861e9e.bin"
usb_devs=""
num_usb_devs=0
usb_device=""
isChromeOS=true
isChromiumOS=false
isCloudready=false
flashromcmd=""
flashrom_params=""
flashrom_programmer="-p internal"
cbfstoolcmd=""
gbbutilitycmd=""
preferUSB=false
useHeadless=false
addPXE=false
pxeDefault=false
isHswBox=false
isBdwBox=false
isHswBook=false
isBdwBook=false
isHsw=false
isBdw=false
isByt=false
isBsw=false
isSkl=false
isSnbIvb=false
isApl=false
isKbl=false
isGlk=false
isStr=false
isWhl=false
isCml=false
isCmlBox=false
isZen2=false
isJsl=false
isTgl=false
isAdl=false
isUnsupported=false
firmwareType=""
isStock=true
isFullRom=false
isBootStub=false
isUEFI=false
hasRwLegacy=false
unlockMenu=false
hasUEFIoption=false
hasLegacyOption=false
hasShellball=false
wpEnabled=false
hasLAN=false
hasCR50=false
kbl_use_rwl18=false
useAltfwStd=false

hsw_boxes=('mccloud' 'panther' 'tricky' 'zako')
hsw_books=('falco' 'leon' 'monroe' 'peppy' 'wolf')
bdw_boxes=('guado' 'rikku' 'tidus')
bdw_books=('auron_paine' 'auron_yuna' 'buddy' 'gandof' 'lulu' 'samus')
baytrail=('banjo' 'candy' 'clapper' 'enguarde' 'glimmer' 'gnawty' 'heli' \
	'kip' 'ninja' 'orco' 'quawks' 'squawks' 'sumo' 'swanky' 'winky')
braswell=('banon' 'celes' 'cyan' 'edgar' 'kefka' 'reks' 'relm' \
	'setzer' 'terra' 'ultima' 'wizpig')
skylake=('asuka' 'caroline' 'cave' 'chell' 'lars' 'lili' 'sentry')
snb_ivb=('butterfly' 'link' 'lumpy' 'parrot' 'stout' 'stumpy')
apl=('astronaut' 'babymega' 'babytiger' 'blacktip' 'blue' 'bruce' 'coral' \
	'electro' 'epaulette' 'lava' 'nasher' 'nasher360' 'pyro' 'rabbid'  'reef' \
	'robo' 'robo360' 'sand' 'santa' 'snappy' 'whitetip')
kbl_boxes=('bleemo' 'excelsior' 'fizz' 'jax' 'kench' 'sion' 'teemo' 'wukong')
kbl_rwl_20=('akali' 'bard' 'ekko' 'eve' 'nami' 'nautilus' \
	'pantheon' 'sona' 'soraka' 'syndra' 'vayne')
kbl_rwl_18=('atlas' 'karma' 'leona' 'nocturne' 'rammus' 'shyvana')
kbl=($(printf "%s " "${kbl_boxes[@]}" "${kbl_rwl_20[@]}" "${kbl_rwl_18[@]}"))
purism=('librem13v1' 'librem13v2' 'librem13v4' 'librem15v2' 'librem15v3' 'librem15v4' \
		'librem_mini' 'librem_mini_v2' 'librem_14');
glk=('ampton' 'apel' 'bloog' 'blooglet' 'blooguard' 'blorb' 'bluebird' 'bobba' \
	'bobba360' 'casta' 'dood' 'droid' 'dorp' 'fleex' 'foob' 'foob360' 'garg' \
	'garg360' 'garfour' 'glk' 'glk360' 'grabbiter' 'laser' 'laser14' 'lick' \
	'meep' 'mimrock' 'nospike' 'octopus' 'orbatrix' 'phaser' 'phaser360' \
	'phaser360s' 'sparky' 'sparky360' 'vorticon' 'vortininja')
str=('aleena' 'barla' 'careena' 'grunt' 'kasumi' 'liara' 'treeya' 'treeya360')
whl=('arcada' 'sarien')
cml_boxes=('dooly' 'duffy' 'faffy' 'kaisa' 'noibat' 'puff' 'wyvern')
cml_books=('akemi' 'dragonair' 'drallion' 'dratini' 'hatch' 'helios' 'jinlon' 'kindred' 'kled' \
		   'kohaku' 'nightfury')
cml=($(printf "%s " "${cml_boxes[@]}" "${cml_books[@]}"))
zen2=('berknip' 'dirinboz' 'ezkinil' 'morphius' 'woomax' 'vilboz')
jsl=('beetley' 'blipper' 'bookem' 'boten' 'botenflex' 'bugzzy' 'cret' 'cret360' \
	 'drawcia' 'drawlat' 'drawman' 'drawper' 'galith' 'galith360' 'gallop' 'galnat' 'galnat360' \
	 'galtic' 'galtic360' 'kracko' 'kracko360' 'landia' 'landrid' 'lantis' 'madoo' 'magister' \
	 'maglet' 'maglia' 'maglith' 'magma' 'magneto' 'magolor' 'magpie' 'metaknight' 'pasara' \
	 'pirette' 'pirika' 'sasuke' 'storo' 'storo360')
tgl=('chronicler' 'collis' 'copano' 'delbin' 'drobit' 'eldrid' 'elemi' 'lillipup' 'lindar' \
	 'voema' 'volet' 'volta' 'voxel')
adl=('anahera' 'brya' 'banshee' 'kano' 'crota' 'crota360' 'felwinter' 'osiris' 'primus' \
	 'redrix' 'taeko' 'taniks' 'volmar' 'zavala')

UEFI_ROMS=($(printf "%s " "${hsw_boxes[@]}" "${hsw_books[@]}" "${bdw_boxes[@]}" \
	"${bdw_books[@]}" "${baytrail[@]}" "${snb_ivb[@]}" "${braswell[@]}" \
	"${skylake[@]}" "${kbl[@]}" "${purism[@]}" "${str[@]}" "${cml[@]}" \
	"${glk[@]}" "${apl[@]}" "${tgl[@]}" "${jsl[@]}"  "${adl[@]}"))
shellballs=($(printf "%s " \
	"${skylake[@]}" 'atlas' 'eve' 'nautilus' 'nocturne' 'pantheon' 'sona' 'soraka' \
	'teemo' 'sion' 'vayne' 'careena' 'liara' 'akemi' 'kohaku' 'barla' 'babytiger' \
	'dratini' 'rabbid' 'blooglet' 'shyvana' 'leona'))
eol_devices=($(printf "%s " "${hsw_boxes[@]}" "${hsw_books[@]}" "${bdw_boxes[@]}" \
		"${bdw_books[@]}" "${baytrail[@]}" "${snb_ivb[@]}" "${braswell[@]}"))

function get_info()
{


device=$(dmidecode -s system-product-name | tr '[:upper:]' '[:lower:]' | sed 's/ /_/g' | awk 'NR==1{print $1}')


		isChromeOS=true
# firmware date/version
fwVer=$(dmidecode -s bios-version)
fwDate=$(dmidecode -s bios-release-date)

	_hwid=$(crossystem hwid | sed 's/X86//g' | sed 's/ *$//g' | sed 's/ /_/g')
	boardName=$(crossystem hwid | sed 's/X86//g' | sed 's/ *$//g'| awk 'NR==1{print $1}' | cut -f 1 -d'-')
	device=${boardName,,}


case "${_hwid}" in
	AKALI*)                 _x='KBL|Acer Chromebook 13 / Spin 13' ; device="nami";;
	AKEMI*)                 _x='CML|Lenovo Ideapad Flex 5 Chromebook' ;;
	ALEENA*)                _x='STR|Acer Chromebook 315' ;;
	AMPTON*)                _x='GLK|Asus Chromebook Flip C214/C234' ;;
	ANAHERA*)               _x='ADL|HP Elite c640 14 inch G3 Chromebook'; device="anahera" ;;
	APELE*)                 _x='GLK|Asus Chromebook CX1101CMA' ;;
	APEL*)                  _x='GLK|Asus Chromebook Flip C204' ;;
	ARCADA*)                _x='WHL|Dell Latitude 5300' ; device="sarien";;
	ASTRONAUT*)             _x='APL|Acer Chromebook 11 (C732*)' ;;
	ASUKA*)                 _x='SKL|Dell Chromebook 13 (3380)' ;;
	ATLAS*)                 _x='KBL|Google Pixelbook Go' ;;
	AURON_PAINE*)           _x='BDW|Acer Chromebook 11 (C740)' ;;
	AURON_YUNA*)            _x='BDW|Acer Chromebook 15 (CB5-571, C910)' ;;
	BABYMEGA*)              _x='APL|Asus Chromebook C223NA' ;;
	BABYTIGER*)             _x='APL|Asus Chromebook C523NA' ;;
	BANJO*)                 _x='BYT|Acer Chromebook 15 (CB3-531)' ;;
	BANON*)                 _x='BSW|Acer Chromebook 15 (CB3-532)' ;;
	BANSHEE*)               _x='ADL|Framework Chromebook' ;;
	BARD*)                  _x='KBL|Acer Chromebook 715 (CB715)' ; device="nami";;
	BARLA*)                 _x='STR|HP Chromebook 11A G6 EE' ;;
	BERKNIP*)               _x='ZEN2|HP Pro c645 Chromebook Enterprise' ;;
	BLACKTIP*)              _x='APL|White Label Chrombook' ;;
	BLEEMO*)                _x='KBL|Asus Chromebox 3 / CN65 (Core i7)' ; device="fizz";;
	BEETLEY*)               _x='JSL|Lenovo Flex 3i/3i-15 Chromebook' ;;
	BLIPPER*)               _x='JSL|Lenovo 3i-15 Chromebook	';;
	BLOOGLET*)              _x='GLK|HP Chromebook 14a';;
	BLOOGUARD*)             _x='GLK|HP Chromebook x360 14a/14b';;
	BLOOG*)                 _x='GLK|HP Chromebook x360 12b';;
	BLORB*)                 _x='GLK|Acer Chromebook 315';;
	BLUEBIRD*)              _x='GLK|Samsung Chromebook 4' ;;
	BLUE*)                  _x='APL|Acer Chromebook 15 [CB315-1H*]' ;;
	BOBBA360*)              _x='GLK|Acer Chromebook Spin 311/511' ;;
	BOBBA*)                 _x='GLK|Acer Chromebook 311' ;;
	BOOKEM*)                _x='JSL|Lenovo 100e Chromebook Gen 3' ;;
	BOTENFLEX*)             _x='JSL|Lenovo Flex 3i/3i-11 Chromebook' ;;
	BOTEN*)                 _x='JSL|Lenovo 500e Chromebook Gen 3' ;;
	BRUCE*)                 _x='APL|Acer Chromebook Spin 15 [CP315]' ;;
	BUDDY*)                 _x='BDW|Acer Chromebase 24' ;;
	BUGZZY*)                _x='JSL|Samsung Galaxy Chromebook 2 360' ;;
	BUTTERFLY*)             _x='SNB|HP Pavilion Chromebook 14' ;;
	CANDY*)                 _x='BYT|Dell Chromebook 11' ;;
	CAREENA*)               _x='STR|HP Chromebook 14' ;;
	CAROLINE*)              _x='SKL|Samsung Chromebook Pro' ;;
	CASTA*)                 _x='GLK|Samsung Chromebook 4+';;
	CAVE*)                  _x='SKL|ASUS Chromebook Flip C302' ;;
	CELES*)                 _x='BSW|Samsung Chromebook 3' ;;
	CHELL*)                 _x='SKL|HP Chromebook 13 G1' ;;
	CHRONICLER*)            _x='TGL|FMV Chromebook 14F' ;;
	CLAPPER*)               _x='BYT|Lenovo N20/N20P Chromebook' ;;
	COLLIS*)                _x='TGL|AAsus Chromebook Flip CX3' ;;
	COPANO*)                _x='TGL|Asus Chromebook Flip CX5 (CX5400)' ;;
	CORAL*)                 _x='APL|Incorrectly identified APL Chromebook' ;;
	CRET360*)               _x='JSL|Dell Chromebook 3110 2-in-1' ;;
	CRET*)                  _x='JSL|Dell Chromebook 3110' ;;
	CROTA360*)              _x='ADL|Dell Latitude 5430 2-in-1 Chromebook'; device="crota360" ;;
	CROTA*)                 _x='ADL|Dell Latitude 5430 Chromebook'; device="crota" ;;
	CYAN*)                  _x='BSW|Acer Chromebook R11 (C738T)' ;;
	DELBIN*)                _x='TGL|ASUS Chromebook Flip CX55/CX5500/C536' ;;
	DIRINBOZ*)              _x='ZEN2|HP Chromebook 14a' ;;
	DOOD*)                  _x='GLK|NEC Chromebook Y2';;
	DOOLY*)                 _x='CML|HP Chromebase 21.5' ;;
	DORP*)                  _x='GLK|HP Chromebook 14 G6';;
	DRAGONAIR*)             _x='CML|HP Chromebook x360 14c' ;;
	DRALLION*)              _x='CML|Dell Latitude 7410 Chromebook Enterprise' ; device="drallion";;
	DRATINI*)               _x='CML|HP Pro c640 Chromebook' ;;
	DRAWCIA*)               _x='JSL|HP Chromebook x360 11 G4 EE' ;;
	DRAWLAT*)               _x='JSL|HP Chromebook 11 G9 EE' ;;
	DRAWMAN*)               _x='JSL|HP Chromebook 14 G7' ;;
	DRAWPER*)               _x='JSL|HP Fortis 14 G10 Chromebook' ;;
	DROBIT*)                _x='TGL|ASUS Chromebook CX9 (CX9400)' ;;
	DROID*)                 _x='GLK|Acer Chromebook 314';;
	DUFFY*)                 _x='CML|ASUS Chromebox 4' ;;
	EDGAR*)                 _x='BSW|Acer Chromebook 14 (CB3-431)' ;;
	EKKO*)                  _x='KBL|Acer Chromebook 714 (CB714)' ; device="nami";;
	ELDRID*)                _x='TGL|HP Chromebook x360 14c' ;;
	ELECTRO*)               _x='APL|Acer Chromebook Spin 11 (R751T)' ;;
	ELEMI*)                 _x='TGL|HP Pro c640 G2 Chromebook' ;;
	ENGUARDE_???-???-??A*)  _x='BYT|CTL N6 Education Chromebook' ;;
	ENGUARDE_???-???-??B*)  _x='BYT|M&A Chromebook' ;;
	ENGUARDE_???-???-??C*)  _x='BYT|Senkatel C1101 Chromebook' ;;
	ENGUARDE_???-???-??D*)  _x='BYT|Edxis Education Chromebook' ;;
	ENGUARDE_???-???-??E*)  _x='BYT|Lenovo N21 Chromebook' ;;
	ENGUARDE_???-???-??F*)  _x='BYT|RGS Education Chromebook' ;;
	ENGUARDE_???-???-??G*)  _x='BYT|Crambo Chromebook' ;;
	ENGUARDE_???-???-??H*)  _x='BYT|True IDC Chromebook' ;;
	ENGUARDE_???-???-??I*)  _x='BYT|Videonet Chromebook' ;;
	ENGUARDE_???-???-??J*)  _x='BYT|eduGear Chromebook R' ;;
	ENGUARDE_???-???-??K*)  _x='BYT|ASI Chromebook' ;;
	ENGUARDE*)              _x='BYT|(multiple device matches)' ;;
	EPAULETTE*)             _x='APL|UNK Acer Chromebook ' ;;
	EVE*)                   _x='KBL|Google Pixelbook' ;;
	EXCELSIOR-URAR*)        _x='KBL|Asus Google Meet kit (KBL)'; device="fizz" ;;
	EZKINIL*)               _x='ZEN2|Acer Chromebook Spin 514' ;;
	FAFFY*)                 _x='CML|ASUS Fanless Chromebox' ;;
	FALCO*)                 _x='HSW|HP Chromebook 14' ;;
	FELWINTER*)             _x='ADL|ASUS Chromebook Flip CX5(CX5601)'; device="felwinter" ;;
	FIZZ)                   _x='KBL|TBD KBL Chromebox' ;;
	FLEEX*)                 _x='GLK|Dell Chromebook 3100';;
	FOOB*)                  _x='GLK|CTL Chromebook VX11/VT11T';;
	GALITH360*)             _x='JSL|ASUS Chromebook CX1500FKA' ;;
	GALITH*)                _x='JSL|ASUS Chromebook CX1500CKA' ;;
	GALLOP*)                _x='JSL|ASUS Chromebook CX1700CKA' ;;
	GALNAT360*)             _x='JSL|ASUS Chromebook Flip CX1102' ;;
	GALNAT*)                _x='JSL|ASUS Chromebook CX1102' ;;
	GALTIC360*)             _x='JSL|ASUS Chromebook CX1400FKA' ;;
	GALTIC*)                _x='JSL|ASUS Chromebook CX1' ;;
	GANDOF*)                _x='BDW|Toshiba Chromebook 2 (2015) CB30/CB35' ;;
	GARFOUR*)               _x='GLK|CTL Chromebook NL81/NL81T';;
	GARG360*)               _x='GLK|CTL Chromebook NL71T/TW/TWB';;
	GARG*)                  _x='GLK|CTL Chromebook NL71/CT/LTE';;
	GLIMMER*)               _x='BYT|Lenovo ThinkPad 11e/Yoga Chromebook' ;;
	GLK360*)                _x='GLK|Acer Chromebook Spin 311';;
	GLK*)                   _x='GLK|Acer Chromebook 311';;
	GNAWTY*)                _x='BYT|Acer Chromebook 11 (CB3-111/131,C730/C730E/C735)' ;;
	GRABBITER*)             _x='GLK|Dell Chromebook 3100 2-in-1';;
	GUADO*)                 _x='BDW|ASUS Chromebox 2 / CN62' ;;
	HELIOS*)                _x='CML|ASUS Chromebook Flip C436FA' ;;
	HELI*)                  _x='BYT|Haier Chromebook G2' ;;
	JAX*)                   _x='KBL|AOpen Chromebox Commercial 2' ; device="fizz";;
	JINLON*)                _x='CML|HP Elite c1030 Chromebook / HP Chromebook x360 13c';;
	KAISA*)                 _x='CML|Acer Chromebox CXI4' ;;
	KANO*)                  _x='ADL|Acer Chromebook Spin 714 [CP714-1WN]'; device="kano" ;;
	KARMA*)                 _x='KBL|Acer Chromebase 24I2' ;;
	KASUMI*)                _x='STR|Acer Chromebook 311' ; device="kasumi";;
	KEFKA*)                 _x='BSW|Dell Chromebook 11 (3180,3189)' ;;
	KENCH*)                 _x='KBL|HP Chromebox G2' ; device="fizz";;
	KINDRED*)               _x='CML|Acer Chromebook 712 (C871)' ;;
	KIP*)                   _x='BYT|HP Chromebook 11 G3/G4, 14 G4' ;;
	KLED*)                  _x='CML|Acer Chromebook Spin 713 (CP713-2W)' ;;
	KOHAKU*)                _x='CML|Samsung Galaxy Chromebook' ;;
	KRACKO360-BLXA*)        _x='JSL|CTL Chromebook NL72T' ;;
	KRACKO360*)             _x='JSL|LG Chromebook 11TC50Q/11TQ50Q' ;;
	KRACKO*)                _x='JSL|CTL Chromebook NL72' ;;
	LANDIA*)                _x='JSL|HP Chromebook x360 14a' ;;
	LANDRID*)               _x='JSL|HP Chromebook 15a' ;;
	LANTIS*)                _x='JSL|HP Chromebook 14a' ;;
	LARS_???-???-???-?3?*)  _x='SKL|Acer Chromebook 11 (C771, C771T)' ;;
	LARS*)                  _x='SKL|Acer Chromebook 14 for Work' ;;
	LASER14*)               _x='GLK|Lenovo Chromebook S340 / IdeaPad 3';;
	LASER*)                 _x='GLK|Lenovo Chromebook C340';;
	LAVA*)                  _x='APL|Acer Chromebook Spin 11 CP311' ;;
	LEONA*)                 _x='KBL|Asus Chromebook C425TA' ;;
	LEON*)                  _x='HSW|Toshiba CB30/CB35 Chromebook' ;;
	LIARA*)                 _x='STR|Lenovo 14e Chromebook' ;;
	LIBREM_13_V1)           _x='BDW|Purism Librem 13 v1' ; device="librem13v1";;
	LIBREM13V1)             _x='BDW|Purism Librem 13 v1' ;;
	LIBREM_13_V2)           _x='SKL|Purism Librem 13 v2' ; device="librem13v2";;
	LIBREM13V2)             _x='SKL|Purism Librem 13 v2' ;;
	LIBREM_13_V3)           _x='SKL|Purism Librem 13 v3' ; device="librem13v2";;
	LIBREM13V3)             _x='SKL|Purism Librem 13 v3' ;;
	LIBREM_13_V4)           _x='KBL|Purism Librem 13 v4' ; device="librem13v4";;
	LIBREM13V4)             _x='KBL|Purism Librem 13 v4' ;;
	LIBREM_14)              _x='CML|Purism Librem 14' ; device="librem_14";;
	LIBREM_15_V2)           _x='BDW|Purism Librem 15 v2' ; device="librem15v2";;
	LIBREM15V2)             _x='BDW|Purism Librem 15 v2' ;;
	LIBREM_15_V3)           _x='SKL|Purism Librem 15 v3' ; device="librem15v3";;
	LIBREM15V3)             _x='SKL|Purism Librem 15 v3' ;;
	LIBREM_15_V4)           _x='KBL|Purism Librem 15 v4' ; device="librem15v4";;
	LIBREM15V4)             _x='KBL|Purism Librem 15 v4' ;;
	LIBREM_MINI)            _x='WHL|Purism Librem Mini' ; device="librem_mini";;
	LIBREM_MINI_V2)         _x='CML|Purism Librem Mini v2' ; device="librem_mini_v2";;
	LICK*)                  _x='GLK|Lenovo Ideapad 3 Chromebook' ;;
	LILLIPUP*)              _x='TGL|Lenovo IdeaPad Flex 5i Chromebook' ; device="lillipup";;
	LINDAR-EDFZ*)           _x='TGL|Lenovo 5i-14 Chromebook' ; device="lindar";;
	LINDAR-LCDF*)           _x='TGL|Lenovo Slim 5 Chromebook' ; device="lindar";;
	LINDAR*)                _x='TGL|Lenovo Slim 5/5i/Flex 5i Chromebook' ; device="lindar";;
	LINK*)                  _x='IVB|Google Chromebook Pixel 2013' ;;
	LULU*)                  _x='BDW|Dell Chromebook 13 (7310)' ;;
	MADOO*)                 _x='JSL|HP Chromebook x360 14b' ;;
	MAGISTER*)              _x='JSL|Acer Chromebook Spin 314' ;;
	MAGLET*)                _x='JSL|Acer Chromebook 512 (C852)' ;;
	MAGLIA*)                _x='JSL|Acer Chromebook Spin 512' ;;
	MAGLITH*)               _x='JSL|Acer Chromebook 511' ;;
	MAGMA*)                 _x='JSL|Acer Chromebook 315' ;;
	MAGNETO-BWYB*)          _x='JSL|Acer Chromebook 314' ;;
	MAGNETO-SGGB*)          _x='JSL|Packard Bell Chromebook 314' ;;
	MAGOLOR*)               _x='JSL|Acer Chromebook Spin 511 [R753T]' ;;
	MAGPIE*)                _x='JSL|Acer Chromebook 317 [CB317-1H]' ;;
	METAKNIGHT*)            _x='JSL|NEC Chromebook Y3' ;;
	LUMPY*)                 _x='SNB|Samsung Chromebook Series 5 550' ;;
	MCCLOUD*)               _x='HSW|Acer Chromebox CXI' ;;
	MEEP*)                  _x='GLK|HP Chromebook x360 11 G2 EE' ;;
	MIMROCK*)               _x='GLK|HP Chromebook 11 G7 EE' ;;
	MONROE*)                _x='HSW|LG Chromebase' ;;
	MORPHIUS*)              _x='ZEN2|Lenovo ThinkPad C13 Yoga Chromebook' ;;
	NAUTILUS*)              _x='KBL|Samsung Chromebook Plus V2' ;;
	NASHER360*)             _x='APL|Dell Chromebook 11 2-in-1 5190' ;;
	NASHER*)                _x='APL|Dell Chromebook 11 5190' ;;
	NIGHTFURY*)             _x='CML|Samsung Galaxy Chromebook 2' ;;
	NINJA*)                 _x='BYT|AOpen Chromebox Commercial' ;;
	NOCTURNE*)              _x='KBL|Google Pixel Slate' ;;
	NOIBAT*)                _x='CML|HP Chromebox G3' ;;
	NOSPIKE*)               _x='GLK|ASUS Chromebook C424';;
	ORCO*)                  _x='BYT|Lenovo Ideapad 100S Chromebook' ;;
	ORBATRIX*)              _x='GLK|Dell Chromebook 3400';;
	OSIRIS*)                _x='ADL|Acer Chromebook 516 GE [CBG516-1H]'; device="osiris" ;;
	PAINE*)                 _x='BDW|Acer Chromebook 11 (C740)' ; device="auron_paine";;
	PANTHEON*)              _x='KBL|Lenovo Yoga Chromebook C630'  ; device="nami";;
	PANTHER*)               _x='HSW|ASUS Chromebox CN60' ;;
	PARROT*)                _x='SNB|Acer C7/C710 Chromebook' ;;
	PASARA*)                _x='JSL|Gateway Chromebook 15' ;;
	PEPPY*)                 _x='HSW|Acer C720/C720P Chromebook' ;;
	PHASER360*)             _x='GLK|Lenovo 300e/500e Chromebook 2nd Gen' ;;
	PHASER*)                _x='GLK|Lenovo 100e Chromebook 2nd Gen' ;;
	PIRETTE-LLJI*)          _x='JSL|Axioo Chromebook P11' ;;
	PIRETTE-NGVJ*)          _x='JSL|SPC Chromebook Z1 Mini' ;;
	PIRETTE-RVKU*)          _x='JSL|CTL Chromebook PX11E' ;;
	PIRETTE-UBKE*)          _x='JSL|Zyrex Chromebook M432-2' ;;
	PIRIKA-BMAD*)           _x='JSL|CTL Chromebook PX14E/PX14EX/PX14EXT' ;;
	PIRIKA-NPXS*)           _x='JSL|Axioo Chromebook P14' ;;
	PIRIKA-XAJY*)           _x='JSL|Gateway Chromebook 14' ;;
	PRIMUS*)                _x='ADL|Lenovo ThinkPad C14 Gen 1 Chromebook'; device="primus" ;;
	PYRO*)                  _x='APL|Lenovo Thinkpad 11e/Yoga Chromebook (G4)' ;;
	QUAWKS*)                _x='BYT|ASUS Chromebook C300' ;;
	RABBID*)                _x='APL|ASUS Chromebook C423' ;;
	RAMMUS*)                _x='KBL|Asus Chromebook C425/C433/C434' ;;
	REDRIX*)                _x='ADL|HP Elite Dragonfly Chromebook'; device="redrix" ;;
	REEF_???-C*)            _x='APL|ASUS Chromebook C213NA' ;;
	REEF*)                  _x='APL|Acer Chromebook Spin 11 (R751T)' ; device="electro";;
	REKS_???-???-???-B*)    _x='BSW|2016|Lenovo N42 Chromebook' ;;
	REKS_???-???-???-C*)    _x='BSW|2017|Lenovo N23 Chromebook (Touch)';;
	REKS_???-???-???-D*)    _x='BSW|2017|Lenovo N23 Chromebook' ;;
	REKS_???-???-???-*)     _x='BSW|2016|Lenovo N22 Chromebook' ;;
	REKS*)                  _x='BSW|2016|(unknown REKS)' ;;
	RELM_???-B*)            _x='BSW|CTL NL61 Chromebook' ;;
	RELM_???-C*)            _x='BSW|Edxis Education Chromebook' ;;
	RELM_???-F*)            _x='BSW|Mecer V2 Chromebook' ;;
	RELM_???-G*)            _x='BSW|HP Chromebook 11 G5 EE' ;;
	RELM_???-H*)            _x='BSW|Acer Chromebook 11 N7 (C731)' ;;
	RELM_???-Z*)            _x='BSW|Quanta OEM Chromebook' ;;
	RELM*)                  _x='BSW|(unknown RELM)' ;;
	RIKKU*)                 _x='BDW|Acer Chromebox CXI2' ;;
	ROBO360*)               _x='APL|Lenovo 500e Chromebook' ;;
	ROBO*)                  _x='APL|Lenovo 100e Chromebook' ;;
	SAMUS*)                 _x='BDW|Google Chromebook Pixel 2015' ;;
	SAND*)                  _x='APL|Acer Chromebook 15 (CB515-1HT)' ;;
	SANTA*)                 _x='APL|Acer Chromebook 11 (CB311-8H)' ;;
	SARIEN*)                _x='WHL|Dell Latitude 5400' ;;
	SASUKE*)                _x='JSL|Samsung Galaxy Chromebook Go' ;;
	SENTRY*)                _x='SKL|Lenovo Thinkpad 13 Chromebook' ;;
	SETZER*)                _x='BSW|HP Chromebook 11 G5' ;;
	SHYVANA*)               _x='KBL|Asus Chromebook Flip C433/C434' ;;
	SION*)                  _x='KBL|Acer Chromebox CXI3' ; device="fizz";;
	SNAPPY_???-A*)          _x='APL|HP Chromebook x360 11 G1 EE' ;;
	SNAPPY_???-B*)          _x='APL|HP Chromebook 11 G6 EE' ;;
	SNAPPY_???-C*)          _x='APL|HP Chromebook 14 G5' ;;
	SNAPPY*)                _x='APL|HP Chromebook x360 11 G1/11 G6/14 G5' ;;
	SPARKY360*)             _x='GLK|Acer Chromebook Spin 512 (R851TN)' ;;
	SPARKY*)                _x='GLK|Acer Chromebook 512 (C851/C851T)' ;;
	SONA*)                  _x='KBL|HP Chromebook x360 14' ; device="nami";;
	SORAKA*)                _x='KBL|HP Chromebook x2' ;;
	SQUAWKS*)               _x='BYT|ASUS Chromebook C200' ;;
	STORO360*)              _x='JSL|ASUS Chromebook Flip CR1100FKA' ;;
	STORO*)                 _x='JSL|ASUS Chromebook CR1100CKA' ;;
	STOUT*)                 _x='IVB|Lenovo Thinkpad X131e Chromebook' ;;
	STUMPY*)                _x='SNB|Samsung Chromebox Series 3' ;;
	SUMO*)                  _x='BYT|AOpen Chromebase Commercial' ;;
	SWANKY*)                _x='BYT|Toshiba Chromebook 2 (2014) CB30/CB35' ;;
	SYNDRA*)                _x='KBL|HP Chromebook 15 G1' ; device="nami";;
	TAEKO*)                 _x='ADL|Lenovo Lenovo Flex 5i Chromebook 14"'; device="taeko" ;;
	TANIKS*)                _x='ADL|Lenovo IdeaPad Gaming Chromebook 16'; device="taniks" ;;
	TEEMO*)                 _x='KBL|Asus Chromebox 3 / CN65' ; device="fizz";;
	TERRA_???-???-???-A*)   _x='BSW|ASUS Chromebook C202SA' ;;
	TERRA_???-???-???-B*)   _x='BSW|ASUS Chromebook C300SA/C301SA' ;;
	TERRA*)                 _x='BSW|ASUS Chromebook C202SA, C300SA/C301SA' ; device="terra";;
	TIDUS*)                 _x='BDW|Lenovo ThinkCentre Chromebox' ;;
	TREEYA360*)             _x='STR|Lenovo 300e Chromebook 2nd Gen AMD' ; device="treeya";;
	TREEYA*)                _x='STR|Lenovo 100e Chromebook 2nd Gen AMD' ; device="treeya";;
	TRICKY*)                _x='HSW|Dell Chromebox 3010' ;;
	ULTIMA*)                _x='BSW|Lenovo ThinkPad 11e/Yoga Chromebook (G3)' ;;
	VAYNE*)                 _x='KBL|Dell Inspiron Chromebook 14 (7486)'  ; device="nami";;
	VILBOZ360*)             _x='ZEN2|Lenovo 300e Chromebook Gen 3'; device="vilboz" ;;
	VILBOZ14*)              _x='ZEN2|Lenovo 14e Chromebook Gen 2'; device="vilboz" ;;
	VILBOZ*)                _x='ZEN2|Lenovo 100e Chromebook Gen 3'; device="vilboz" ;;
	VOEMA*)                 _x='TGL|Acer Chromebook Spin 514 (CB514-2H)' ;;
	VOLET*)                 _x='TGL|Acer Chromebook 515 (CB515-1W, CB515-1WT)' ;;
	VOLMAR*)                _x='ADL|Acer Chromebook Vero 514'; device="volmar" ;;
	VOLTA*)                 _x='TGL|Acer Chromebook 514 (CB514-1W, CB514-1WT)' ;;
	VORTICON*)              _x='GLK|HP Chromebook 11 G8 EE' ;;
	VORTININJA*)            _x='GLK|HP Chromebook x360 11 G3 EE' ;;
	VOXEL*)                 _x='TGL|Acer Chromebook Spin 713 (CP713-3W)' ;;
	WHITETIP*)              _x='APL|CTL Chromebook J41/J41T' ;;
	WINKY*)                 _x='BYT|Samsung Chromebook 2 (XE500C12)' ;;
	WIZPIG_???-???-??A*)    _x='BSW|CTL Chromebook J5' ;;
	WIZPIG_???-???-??B*)    _x='BSW|Edugear CMT Chromebook' ;;
	WIZPIG_???-???-??C*)    _x='BSW|Haier Convertible Chromebook 11 C' ;;
	WIZPIG_???-???-??D*)    _x='BSW|Viglen Chromebook 360' ;;
	WIZPIG_???-???-??G*)    _x='BSW|Prowise ProLine Chromebook' ;;
	WIZPIG_???-???-??H*)    _x='BSW|PCMerge Chromebook PCM-116T-432B' ;;
	WIZPIG_???-???-??I*)    _x='BSW|Multilaser M11C Chromebook' ;;
	WIZPIG*)                _x='BSW|(unknown WIZPIG)' ;;
	WOLF*)                  _x='HSW|Dell Chromebook 11' ;;
	WOOMAX*)                _x='ZEN2|ASUS Chromebook Flip CM5' ;;
	WUKONG_???-???-???-??C*) _x='KBL|ViewSonic NMP660 Chromebox' ; device="fizz";;
	WUKONG*)                _x='KBL|CTL Chromebox CBx1' ; device="fizz";;
	WYVERN*)                _x='CML|CTL Chromebox CBx2' ;;
	YUNA*)                  _x='BDW|Acer Chromebook 15 (CB5-571, C910)' ; device="auron_yuna";;
	ZAKO*)                  _x='HSW|HP Chromebox CB1' ;;
	ZAVALA*)                _x='ADL|Acer Chromebook Vero 712'; device="zavala" ;;
	*)                      _x='UNK|ERROR: unknown or unidentifiable device' ;; 
esac

deviceCpuType=$(echo $_x | cut -d\| -f1)
deviceDesc=$(echo $_x | cut -d\| -f2-)

## CPU family, Processor core, other distinguishing characteristic
case "$deviceCpuType" in
SNB) deviceCpuType="Intel SandyBridge" ;;
IVB) deviceCpuType="Intel IvyBridge" ;;
HSW) deviceCpuType="Intel Haswell" ;;
BYT) deviceCpuType="Intel BayTrail" ;;
BDW) deviceCpuType="Intel Broadwell" ;;
BSW) deviceCpuType="Intel Braswell" ;;
SKL) deviceCpuType="Intel Skylake" ;;
APL) deviceCpuType="Intel ApolloLake" ;;
KBL) deviceCpuType="Intel KabyLake" ;;
GLK) deviceCpuType="Intel GeminiLake" ;;
STR) deviceCpuType="AMD StoneyRidge" ;;
WHL) deviceCpuType="Intel WhiskeyLake" ;;
CML) deviceCpuType="Intel CometLake" ;;
ZEN2) deviceCpuType="AMD Zen+/Picasso" ;;
JSL) deviceCpuType="Intel JasperLake" ;;
TGL) deviceCpuType="Intel TigerLake" ;;
ADL) deviceCpuType="Intel AlderLake" ;;
*)   deviceCpuType="(unrecognized)" ;;
esac

[[ "${hsw_boxes[@]}" =~ "$device" ]] && isHswBox=true
[[ "${hsw_books[@]}" =~ "$device" ]] && isHswBook=true
[[  "$isHswBox" = true || "$isHswBook" = true ]] && isHsw=true
[[ "${bdw_boxes[@]}" =~ "$device" ]] && isBdwBox=true
[[ "${bdw_books[@]}" =~ "$device" ]] && isBdwBook=true
[[  "$isBdwBox" = true || "$isBdwBook" = true ]] && isBdw=true
[[ "${baytrail[@]}" =~ "$device" ]] && isByt=true
[[ "${braswell[@]}" =~ "$device" ]] && isBsw=true
[[ "${skylake[@]}" =~ "$device" ]] && isSkl=true
[[ "${snb_ivb[@]}" =~ "$device" ]] && isSnbIvb=true
[[ "${apl[@]}" =~ "$device" ]] && isApl=true
[[ "${kbl_rwl_18[@]}" =~ "$device" ]] && kbl_use_rwl18=true
[[ "${kbl[@]}" =~ "$device" ]] && isKbl=true
[[ "${glk[@]}" =~ "$device" ]] && isGlk=true
[[ "${str[@]}" =~ "$device" ]] && isStr=true
[[ "${whl[@]}" =~ "$device" ]] && isWhl=true
[[ "${cml[@]}" =~ "$device" ]] && isCml=true
[[ "${zen2[@]}" =~ "$device" ]] && isZen2=true
[[ "${jsl[@]}" =~ "$device" ]] && isJsl=true
[[ "${tgl[@]}" =~ "$device" ]] && isTgl=true
[[ "${adl[@]}" =~ "$device" ]] && isAdl=true
[[ "${cml_boxes[@]}" =~ "$device" ]] && isCmlBox=true
[[ "${shellballs[@]}" =~ "${boardName,,}" ]] && hasShellball=true
[[ "${UEFI_ROMS[@]}" =~ "$device" ]] && hasUEFIoption=true
[[ "$isHsw" = true || "$isBdw" = true || "$isByt" = true || "$isBsw" = true \
	|| "$isSkl" = true || "$isSnbIvb" = true || "$isApl" = true \
	|| "$isKbl" = true || "$isStr" = true || "$isWhl" = true \
	|| "$isGlk" = true || "$isCml" = true || "$isZen2" = true \
	|| "$isJsl" = true || "$isTgl" = true || "$isAdl" = true ]] || isUnsupported=true
[[ "$isHswBox" = true || "$isBdwBox" = true || "${kbl_boxes[@]}" =~ "$device" \
	|| "$device" = "ninja" || "$device" = "buddy" ]] && hasLAN=true
[[ "$isKbl" = true || "$isApl" = true || "$isGlk" = true ]] && hasCR50=true
[[ "$device" = "rammus" || "$isGlk" = true ]] && useAltfwStd=true
[[ "${eol_devices[@]}" =~ "$device" ]] && isEOL=true || isEOL=false

# set unsupported if the script fails to identify the platform
# force all menu options disabled
if [[ "$deviceCpuType" = "(unrecognized)" ]] ; then
  isUnsupported=true
  hasUEFIoption=false
  hasLegacyOption=false
fi
}

get_info
if [ "$isUnsupported" = true ]; then
	exit 1
fi



#determine proper file
if [ "$device" = "link" ]; then
	rwlegacy_file=$seabios_link
elif [[ "$isHswBox" = true || "$isBdwBox" = true ]]; then
	rwlegacy_file=$seabios_hswbdw_box
elif [[ "$isHswBook" = true || "$isBdwBook" = true ]]; then
	rwlegacy_file=$seabios_hswbdw_book
elif [ "$isByt" = true ]; then
	rwlegacy_file=$seabios_baytrail
elif [ "$isBsw" = true ]; then
	rwlegacy_file=$seabios_braswell
elif [ "$isSkl" = true ]; then
	rwlegacy_file=$seabios_skylake
elif [ "$isApl" = true ]; then
	rwlegacy_file=$seabios_apl
elif [ "$kbl_use_rwl18" = true ]; then
	rwlegacy_file=$seabios_kbl_18
elif [ "$isStr" = true ]; then
	rwlegacy_file=$rwl_altfw_stoney
elif [ "$isKbl" = true ]; then
	rwlegacy_file=$seabios_kbl
elif [ "$isWhl" = true ]; then
	rwlegacy_file=$rwl_altfw_whl
elif [ "$device" = "drallion" ]; then
	rwlegacy_file=$rwl_altfw_drallion
elif [ "$isCmlBox" = true ]; then
	rwlegacy_file=$rwl_altfw_cml
elif [ "$isJsl" = true ]; then
	rwlegacy_file=$rwl_altfw_jsl
elif [ "$isZen2" = true ]; then
	rwlegacy_file=$rwl_altfw_zen2
elif [ "$isTgl" = true ]; then
	rwlegacy_file=$rwl_altfw_tgl
elif [ "$isGlk" = true ]; then
	rwlegacy_file=$rwl_altfw_glk
elif [ "$isAdl" = true ]; then
	rwlegacy_file=$rwl_altfw_adl
else
	exit 1
fi


echo $rwlegacy_file
