From f3c2b1d76386ddd4882bbbb2632813fdcde370bd Mon Sep 17 00:00:00 2001 From: Steven Noble Date: Fri, 18 Dec 2015 20:54:02 -0800 Subject: [PATCH] Initial port of Quanta LY8 Rangeley platform --- .../platform-config/Makefile | 1 + .../platform-config/r0/Makefile | 1 + .../platform-config/r0/PKG.yml | 1 + .../platform-config/r0/src/lib/boot/grub.cfg | 22 +++++++++++++ .../lib/boot/x86-64-quanta-ly8-rangeley-r0 | 5 +++ .../install/x86-64-quanta-ly8-rangeley-r0.sh | 16 +++++++++ .../x86-64-quanta-ly8-rangeley-r0/__init__.py | 33 +++++++++++++++++++ 7 files changed, 79 insertions(+) create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/Makefile create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/Makefile create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/PKG.yml create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/grub.cfg create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/x86-64-quanta-ly8-rangeley-r0 create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/install/x86-64-quanta-ly8-rangeley-r0.sh create mode 100644 packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/python/x86-64-quanta-ly8-rangeley-r0/__init__.py diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/Makefile b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/Makefile b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/Makefile new file mode 100644 index 00000000..003238cf --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/Makefile @@ -0,0 +1 @@ +include $(ONL)/make/pkg.mk \ No newline at end of file diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/PKG.yml b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/PKG.yml new file mode 100644 index 00000000..b2bf0d7e --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/PKG.yml @@ -0,0 +1 @@ +!include $ONL_TEMPLATES/platform-config-platform.yml ARCH=x86 VENDOR=quanta PLATFORM=x86-64-quanta-ly8-rangeley-r0 diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/grub.cfg b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/grub.cfg new file mode 100644 index 00000000..08dd6fb6 --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/grub.cfg @@ -0,0 +1,22 @@ +serial --port=0x2f8 --speed=115200 --word=8 --parity=no --stop=1 +terminal_input serial +terminal_output serial +set timeout=5 + +# boot onl +menuentry OpenNetworkLinux { + search --no-floppy --label --set=root ONL-BOOT + echo 'Loading Open Network Linux ...' + insmod gzio + insmod part_msdos + linux /kernel-x86_64 console=ttyS1,115200n8 onl_platform=x86-64-quanta-ly6-ran +geley-r0 + initrd /initrd-amd64 +} + +# Menu entry to chainload ONIE +menuentry ONIE { + search --no-floppy --label --set=root ONIE-BOOT + echo 'Loading ONIE ...' + chainloader +1 +} diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/x86-64-quanta-ly8-rangeley-r0 b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/x86-64-quanta-ly8-rangeley-r0 new file mode 100644 index 00000000..d728b719 --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/boot/x86-64-quanta-ly8-rangeley-r0 @@ -0,0 +1,5 @@ +echo "pci0000:00/0000:00:14.0 ma1" >/etc/onl/net + +cp /dev/null /etc/onl_mounts +echo "LABEL=FLASH * flash" >> /etc/onl/mounts +echo "LABEL=FLASH2 * flash2" >> /etc/onl/mounts diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/install/x86-64-quanta-ly8-rangeley-r0.sh b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/install/x86-64-quanta-ly8-rangeley-r0.sh new file mode 100644 index 00000000..1a40e94b --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/lib/install/x86-64-quanta-ly8-rangeley-r0.sh @@ -0,0 +1,16 @@ +############################################################ +# +# +# Copyright 2013, 2014 BigSwitch Networks, Inc. +# Copyright 2015 Quanta Computer Inc. +# +# +# +# +############################################################ +# Platform data goes here. + +platform_installer() { + # Standard isntallation to an available GPT partition + installer_standard_gpt_install /dev/sda +} diff --git a/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/python/x86-64-quanta-ly8-rangeley-r0/__init__.py b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/python/x86-64-quanta-ly8-rangeley-r0/__init__.py new file mode 100644 index 00000000..6d60df68 --- /dev/null +++ b/packages/platforms/quanta/x86-64-quanta-ly8-rangely/platform-config/r0/src/python/x86-64-quanta-ly8-rangeley-r0/__init__.py @@ -0,0 +1,33 @@ +from onl.platform.base import * +from onl.platform.accton import * + +class OnlPlatform_x86_64_quanta_ly8_rangeley_r0(OnlPlatformAccton): + + def model(self): + return "LY8-Rangeley" + + def platform(self): + return "x86-64-quanta-ly8-rangeley-r0" + + def sys_oid_platform(self): + return ".8.1" + + def baseconfig(self): + try: + files = os.listdir("%s/etc/init.d" % self.platform_basedir()) + for file in files: + src = "%s/etc/init.d/%s" % (self.platform_basedir(), file) + dst = "/etc/init.d/%s" % file + os.system("cp -f %s %s" % (src, dst)) + os.system("/usr/sbin/update-rc.d %s defaults" % file) + except: + pass + + # make ds1339 as default rtc + os.system("ln -snf /dev/rtc1 /dev/rtc") + os.system("hwclock --hctosys") + + # set system led to green + os.system("%s/sbin/systemled green" % self.platform_basedir()) + + return True