diff options
Diffstat (limited to 'meta-quanta/meta-common/recipes-quanta')
7 files changed, 148 insertions, 4 deletions
diff --git a/meta-quanta/meta-common/recipes-quanta/default-users/default-users.bb b/meta-quanta/meta-common/recipes-quanta/default-users/default-users.bb new file mode 100755 index 000000000..0bb9be821 --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/default-users/default-users.bb @@ -0,0 +1,24 @@ +SUMMARY = "Add default Users" +DESCRIPTION = "Add Users" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +EXCLUDE_FROM_WORLD = "1" + +DEPENDS = "bmcweb" +DEPENDS += "phosphor-ipmi-host" +DEPENDS += "phosphor-user-manager" +RDEPENDS_${PN} = "bmcweb" +RDEPENDS_${PN} += "phosphor-ipmi-host" +RDEPENDS_${PN} += "phosphor-user-manager" + +inherit useradd +USERADD_PACKAGES = "${PN}" + +USERADD_PARAM_${PN} = "-m -N -u 1000 -g 100 -s /bin/nologin \ + -p '\$1\$UGMqyqdG\$FZiylVFmRRfl9Z0Ue8G7e/' \ + -G 'web,redfish,priv-admin' Megapede; " +GROUPMEMS_PARAM_${PN} = "-g priv-admin -a root; " +GROUPMEMS_PARAM_${PN} += "-g ipmi -a root; " + +ALLOW_EMPTY_${PN} = "1" diff --git a/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls.bb b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls.bb new file mode 100644 index 000000000..fca483e11 --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls.bb @@ -0,0 +1,22 @@ +SUMMARY = "Enable TLS with static CA" +DESCRIPTION = "Add static CA and only enable TLS authentication" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://certs/authority/ \ + file://bmcweb_persistent_data.json \ + " +do_install(){ + install -d ${D}${sysconfdir}/ssl/certs/authority + install -m 0644 -D ${WORKDIR}/certs/authority/* \ + ${D}${sysconfdir}/ssl/certs/authority + + install -d ${D}${ROOT_HOME} + install -m 0640 ${WORKDIR}/bmcweb_persistent_data.json ${D}${ROOT_HOME} +} + +FILES_${PN} = "${ROOT_HOME}/bmcweb_persistent_data.json \ + ${sysconfdir}/ssl/certs/authority/* \ + " diff --git a/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/bmcweb_persistent_data.json b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/bmcweb_persistent_data.json new file mode 100644 index 000000000..aa5015268 --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/bmcweb_persistent_data.json @@ -0,0 +1 @@ +{"auth_config":{"BasicAuth":false,"Cookie":false,"SessionToken":false,"TLS":true,"XToken":false}} diff --git a/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/certs/authority/Quanta_CA.crt b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/certs/authority/Quanta_CA.crt new file mode 100755 index 000000000..77e5b2c9b --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/enable-tls/enable-tls/certs/authority/Quanta_CA.crt @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDkDCCAnigAwIBAgIIRnUufKw0mL8wDQYJKoZIhvcNAQELBQAwPTELMAkGA1UE +BhMCVFcxDzANBgNVBAoTBlF1YW50YTELMAkGA1UECxMCQ0ExEDAOBgNVBAMTB09w +ZW5CTUMwHhcNMjAwMTAxMDAwMDAwWhcNMzYxMjMxMjM1OTU5WjA9MQswCQYDVQQG +EwJUVzEPMA0GA1UEChMGUXVhbnRhMQswCQYDVQQLEwJDQTEQMA4GA1UEAxMHT3Bl +bkJNQzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANyBHOcnaVt4K1lt +msTmFzIBf1sI/HV7XW6VMICOOESUv/vrMxCNOzhil4J+CWpFjwkk8zGK6tiLXmMe +3/oa6qqHN0GXd7XoyBn3XRrr/L2gKipUsWlYk43Wq0TX2ugEcCWqOr0Ol4TcuD4Z ++pswkgHxqJtbfiWd1sTKpbCvjbnlN9EKir52DRZie0m8ANIbTp/KPVmY+UAU7Vz/ +QpYemolsrwupzWJbz34jC2rnNw8HFBHIMyNLJVocUkCVYy5ka0dRk+APC3VWX4C6 +1GmUd4ZQZs4LayyfQcK3Tb+PkNCf9AxBE8eId0lHpufq2Uhml1Lwrfh/1TObCwkW +ufgv6HsCAwEAAaOBkzCBkDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTpEhTE +nCIZo7dCDFtqUjMRcOI9SDAfBgNVHSMEGDAWgBTpEhTEnCIZo7dCDFtqUjMRcOI9 +SDALBgNVHQ8EBAMCAb4wHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBEG +CWCGSAGG+EIBAQQEAwIAxzANBgkqhkiG9w0BAQsFAAOCAQEAaw2to4hiADeZO/WF +UMxrKjB4mbpHOb8cn3HIBIkrE6XxpH6T9MaZh7xi7kyyiuVNGh70lh+qxBUmVf5B +OF2NSF6ffDrW86dMNV+tKlByHElUqWFcWgU1XFipcN7u0aeFkfPsqG4BwcZlBUEN +rr9GDFNNadmjnoVA3deVTu4kHTVz6vg0vJExDfBHhNBWsLzLizRIebv9jumJlHPl +I99czz3NQKVjm8z/BlWaMxpWU/bLxL2Aq/6rQ0iCoeIPJqHubG1CmGwI7k9ZQTUh +VAMKR4W7JAul+CK8oEC7TAVU2L2fk6g+eSwU12HgO+IUOXmdp3bPtGkk73wG4iOj +hN2Bow== +-----END CERTIFICATE----- diff --git a/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb b/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb new file mode 100644 index 000000000..fd5819d42 --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/fans/read-margin-temp_git.bb @@ -0,0 +1,25 @@ +PR = "r1" +PV = "1.0+git${SRCPV}" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "git://github.com/quanta-bmc/read-margin-temp.git" +SRCREV = "ca2dc1bf7f34d517f0edc59dd3596c3a76c3d7a1" +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit meson + +DEPENDS += " nlohmann-json" +DEPENDS += " sdbusplus" +DEPENDS += " sdeventplus" +DEPENDS += " phosphor-dbus-interfaces" +RDEPENDS_${PN} += " bash" + +FILES_${PN} = "${bindir}/read-margin-temp" + +do_install() { + install -d ${D}${bindir} + install -m 0755 read-margin-temp ${D}${bindir} +} + diff --git a/meta-quanta/meta-common/recipes-quanta/monitor-hostname/phosphor-monitor-hostname_git.bb b/meta-quanta/meta-common/recipes-quanta/monitor-hostname/phosphor-monitor-hostname_git.bb new file mode 100755 index 000000000..99d11d173 --- /dev/null +++ b/meta-quanta/meta-common/recipes-quanta/monitor-hostname/phosphor-monitor-hostname_git.bb @@ -0,0 +1,22 @@ +SUMMARY = "Quanta Monitor HostName Service" +DESCRIPTION = "Quanta Monitor HostName Service" +PR = "r1" +PV = "1.0+git${SRCPV}" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +inherit cmake systemd + +DEPENDS += " \ + boost \ + sdbusplus \ + " + +SRC_URI += "git://github.com/quanta-bmc/phosphor-monitor-hostname" +SRCREV := "1172ec20f8dd41d18519c2cb3ae59bbde5acd634" +S = "${WORKDIR}/git" + +SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.MonitorHostname.service" + + + diff --git a/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh b/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh index 444d4aee7..6840f9ffc 100644 --- a/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh +++ b/meta-quanta/meta-common/recipes-quanta/network/usb-network/usb-network.sh @@ -1,5 +1,25 @@ #!/bin/bash +mac_config="/usr/share/mac-address/config.txt" +dev_mac_path="/tmp/usb0_dev" +host_mac_path="/tmp/usb0_host" + +check_usb_local_administered() { + is_enable="$(cat ${mac_config} | grep 'USBLAA')" + echo ${is_enable} +} + +# Set the locally administered bit (the second least-significant +# bit of the first octet) of the MAC address +set_local_administered_bit() { + mac="$(cat $1)" + first_byte="${mac:0:2}" + first_byte="$((0x$first_byte|2))" + first_byte="$(printf "%02x\n" "$first_byte")" + mac="${first_byte}${mac:2}" + echo $mac +} + cd /sys/kernel/config/usb_gadget if [ ! -f "g1" ]; then @@ -17,16 +37,24 @@ if [ ! -f "g1" ]; then mkdir -p configs/c.1/strings/0x409 echo "ECM" > configs/c.1/strings/0x409/configuration + + if [[ $(check_usb_local_administered) == "USBLAA=true" ]]; then + dev_mac="$(set_local_administered_bit $dev_mac_path)" + host_mac="$(set_local_administered_bit $host_mac_path)" + echo $dev_mac > $dev_mac_path + echo $host_mac > $host_mac_path + fi + mkdir -p functions/ecm.usb0 - cat /tmp/usb0_dev > functions/ecm.usb0/dev_addr # write device mac address - cat /tmp/usb0_host > functions/ecm.usb0/host_addr # write usb mac address + cat $dev_mac_path > functions/ecm.usb0/dev_addr # write device mac address + cat $host_mac_path > functions/ecm.usb0/host_addr # write usb mac address ln -s functions/ecm.usb0 configs/c.1 echo "$UDC" > UDC - rm /tmp/usb0_dev - rm /tmp/usb0_host + rm $dev_mac_path + rm $host_mac_path fi |