Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # ----------------------------------------------------------------------- |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 3 | # Copyright 2023-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
Joey Armstrong | 2c03936 | 2024-02-04 18:51:52 -0500 | [diff] [blame] | 17 | # SPDX-FileCopyrightText: 2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 36c9bcd | 2023-04-05 19:05:56 -0400 | [diff] [blame] | 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ----------------------------------------------------------------------- |
| 20 | |
| 21 | ## ----------------------------------------------------------------------- |
| 22 | ## Intent: Install a bbsim binary for local development use. |
| 23 | ## ----------------------------------------------------------------------- |
| 24 | ## Note: A python or golang script may be a simpler answer. |
| 25 | ## Interpreter modules provide answers for uname -{a,m,o} |
| 26 | ## with dictionary translation into needed values. |
| 27 | ## ----------------------------------------------------------------------- |
| 28 | |
| 29 | # import platform |
| 30 | # platform.processor() |
| 31 | # platform.system # Windows |
| 32 | |
| 33 | # lshw: width: 64 bits |
| 34 | |
| 35 | # >>> import platform |
| 36 | # >>> platform.machine() |
| 37 | # 'x86' |
| 38 | |
| 39 | |
| 40 | # $ uname -m |
| 41 | # armv7l |
| 42 | |
| 43 | ## which arch |
| 44 | # https://github.com/hadolint/hadolint/releases/tag/v2.12.0 |
| 45 | case "$(uname -a)" in |
| 46 | *x86_64*) |
| 47 | esac |
| 48 | |
| 49 | os='' |
| 50 | case "$(uname -o)" in |
| 51 | *Linux*) os='Linux' |
| 52 | esac |
| 53 | |
| 54 | |
| 55 | # hadolint-Darwin-x86_64 |
| 56 | # hadolint-Darwin-x86_64.sha256 |
| 57 | # hadolint-Linux-arm64 |
| 58 | # hadolint-Linux-arm64.sha256 |
| 59 | # hadolint-Linux-x86_64 |
| 60 | # hadolint-Linux-x86_64.sha256 |
| 61 | # hadolint-Windows-x86_64.exe |
| 62 | # hadolint-Windows-x86_64.exe.sha256 |
| 63 | # Source code (zip) |
| 64 | # Source code (tar.gz) |