From 58376b855516c75c5674d4890863bbfea8e60257 Mon Sep 17 00:00:00 2001 From: Andrew Doran Date: Fri, 9 Oct 2020 11:07:57 -0700 Subject: [PATCH] revert systemd changes for now Summary: This reverts D24086062 and D24134064. No other changes. Test Plan: Successfully built an image with bitbake. Reviewed By: vineelasmile fbshipit-source-id: 1349bcd979 --- .../recipes-core/images/galaxy100-image.bb | 7 +-- .../systemd/systemd-serialgetty.bbappend | 7 --- .../recipes-kernel/linux/files/defconfig | 10 ++-- .../openbmc-utils/openbmc-utils_%.bbappend | 55 +++++++++++++------ .../files/repeater_card.sh} | 47 ++++++++++++---- .../files/repeater_scm.sh} | 42 +++++++++++--- .../recipes-utils/repeater/repeater_0.1.bb | 38 +++++++++++++ .../files/retimer_card.sh} | 42 +++++++++++--- .../retimer/files/retimer_scm.sh | 52 ++++++++++++++++++ .../recipes-utils/retimer/retimer_0.1.bb | 38 +++++++++++++ .../{watchdogd.service => setup-watchdogd.sh} | 25 +++++---- .../recipes-utils/watchdogd/watchdogd_0.1.bb | 22 ++++---- 12 files changed, 299 insertions(+), 86 deletions(-) delete mode 100644 meta-facebook/meta-galaxy100/recipes-core/systemd/systemd-serialgetty.bbappend rename meta-facebook/meta-galaxy100/recipes-utils/{openbmc-utils/files/fix_fru_eeprom.service => repeater/files/repeater_card.sh} (67%) rename meta-facebook/meta-galaxy100/recipes-utils/{openbmc-utils/files/sensors_config_fix.service => repeater/files/repeater_scm.sh} (67%) create mode 100644 meta-facebook/meta-galaxy100/recipes-utils/repeater/repeater_0.1.bb rename meta-facebook/meta-galaxy100/recipes-utils/{openbmc-utils/files/us_monitor.service => retimer/files/retimer_card.sh} (67%) create mode 100644 meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_scm.sh create mode 100644 meta-facebook/meta-galaxy100/recipes-utils/retimer/retimer_0.1.bb rename meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/{watchdogd.service => setup-watchdogd.sh} (68%) diff --git a/meta-facebook/meta-galaxy100/recipes-core/images/galaxy100-image.bb b/meta-facebook/meta-galaxy100/recipes-core/images/galaxy100-image.bb index 24100968472b..30044a135e12 100644 --- a/meta-facebook/meta-galaxy100/recipes-core/images/galaxy100-image.bb +++ b/meta-facebook/meta-galaxy100/recipes-core/images/galaxy100-image.bb @@ -23,6 +23,8 @@ IMAGE_INSTALL += " \ openbmc-utils \ openbmc-gpio \ po-eeprom \ + repeater \ + retimer \ kcsd \ spatula \ stress \ @@ -30,9 +32,4 @@ IMAGE_INSTALL += " \ wedge-eeprom \ weutil-dhcp-id \ watchdogd \ - systemd-networkd \ - udev-rules \ " - -IMAGE_INSTALL_remove += "init-ifupdown" -SYSVINIT_SCRIPTS_remove += "init-ifupdown" diff --git a/meta-facebook/meta-galaxy100/recipes-core/systemd/systemd-serialgetty.bbappend b/meta-facebook/meta-galaxy100/recipes-core/systemd/systemd-serialgetty.bbappend deleted file mode 100644 index 66345bd7b45c..000000000000 --- a/meta-facebook/meta-galaxy100/recipes-core/systemd/systemd-serialgetty.bbappend +++ /dev/null @@ -1,7 +0,0 @@ -SERIAL_CONSOLES = "9600;ttyS0 57600;ttyS2" - -do_install_append() { - # Undo the masking we had on the wedge100 layer - from which we - # inherit. OMG this is awful. - rm -f "${D}${systemd_system_unitdir}/serial-getty@ttyS2.service" -} diff --git a/meta-facebook/meta-galaxy100/recipes-kernel/linux/files/defconfig b/meta-facebook/meta-galaxy100/recipes-kernel/linux/files/defconfig index 5c6e03c242dc..1189d3adb792 100644 --- a/meta-facebook/meta-galaxy100/recipes-kernel/linux/files/defconfig +++ b/meta-facebook/meta-galaxy100/recipes-kernel/linux/files/defconfig @@ -49,7 +49,7 @@ CONFIG_SYSVIPC=y CONFIG_SYSVIPC_SYSCTL=y # CONFIG_POSIX_MQUEUE is not set CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_FHANDLE=y +# CONFIG_FHANDLE is not set CONFIG_USELIB=y # CONFIG_AUDIT is not set @@ -98,7 +98,7 @@ CONFIG_IKCONFIG=m CONFIG_IKCONFIG_PROC=y CONFIG_LOG_BUF_SHIFT=16 CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_CGROUPS=y +# CONFIG_CGROUPS is not set # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_NAMESPACES=y # CONFIG_UTS_NS is not set @@ -161,7 +161,7 @@ CONFIG_SLUB=y # CONFIG_PROFILING is not set CONFIG_HAVE_OPROFILE=y # CONFIG_KPROBES is not set -CONFIG_JUMP_LABEL=y +# CONFIG_JUMP_LABEL is not set # CONFIG_UPROBES is not set # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set CONFIG_ARCH_USE_BUILTIN_BSWAP=y @@ -2396,7 +2396,7 @@ CONFIG_CRYPTO_MD5=y # CONFIG_CRYPTO_RMD256 is not set # CONFIG_CRYPTO_RMD320 is not set CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_SHA256=y +# CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_TGR192 is not set # CONFIG_CRYPTO_WP512 is not set @@ -2434,7 +2434,7 @@ CONFIG_CRYPTO_DEFLATE=m # # CONFIG_CRYPTO_ANSI_CPRNG is not set # CONFIG_CRYPTO_DRBG_MENU is not set -CONFIG_CRYPTO_USER_API_HASH=m +# CONFIG_CRYPTO_USER_API_HASH is not set # CONFIG_CRYPTO_USER_API_SKCIPHER is not set # CONFIG_CRYPTO_USER_API_RNG is not set # CONFIG_CRYPTO_HW is not set diff --git a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend b/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend index 8c4430bc7593..7f528db75f41 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend +++ b/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/openbmc-utils_%.bbappend @@ -10,8 +10,6 @@ # for more details. # -inherit systemd - FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://board-utils.sh \ @@ -27,9 +25,7 @@ SRC_URI += "file://board-utils.sh \ file://lsb_release \ file://seutil \ file://sensors_config_fix.sh \ - file://sensors_config_fix.service \ file://fix_fru_eeprom.py \ - file://fix_fru_eeprom.service \ file://qsfp_cpld_ver.sh \ file://ceutil.py \ file://version_dump \ @@ -39,10 +35,10 @@ SRC_URI += "file://board-utils.sh \ file://scm_cpld_rev.sh \ file://ec_version.sh \ file://create_vlan_intf \ - file://us_monitor.service \ " RDEPENDS_${PN} += " python3 bash" +DEPENDS_append += " update-rc.d-native" do_install_board() { # for backward compatible, create /usr/local/fbpackages/utils/ast-functions @@ -68,25 +64,48 @@ do_install_board() { install -m 0755 scm_cpld_rev.sh ${D}${localbindir}/scm_cpld_rev.sh install -m 0755 ec_version.sh ${D}${localbindir}/ec_version.sh - install -m 755 setup_i2c.sh ${D}${localbindir} + # create VLAN intf automatically + install -d ${D}/${sysconfdir}/network/if-up.d + install -m 755 create_vlan_intf ${D}${sysconfdir}/network/if-up.d/create_vlan_intf + + # init + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/rcS.d + + # rc.S + + # the script to mount /mnt/data + install -m 0755 ${WORKDIR}/mount_data0.sh ${D}${sysconfdir}/init.d/mount_data0.sh + update-rc.d -r ${D} mount_data0.sh start 03 S . + + install -m 0755 ${WORKDIR}/rc.early ${D}${sysconfdir}/init.d/rc.early + update-rc.d -r ${D} rc.early start 04 S . - install -m 755 fix_fru_eeprom.py ${D}${localbindir}/fix_fru_eeprom.py - install -m 644 fix_fru_eeprom.service ${D}${systemd_system_unitdir} + install -m 755 setup_i2c.sh ${D}${sysconfdir}/init.d/setup_i2c.sh + update-rc.d -r ${D} setup_i2c.sh start 60 S . - install -m 644 us_monitor.service ${D}${systemd_system_unitdir} + install -m 755 fix_fru_eeprom.py ${D}${sysconfdir}/init.d/fix_fru_eeprom.py + update-rc.d -r ${D} fix_fru_eeprom.py start 61 S . - install -m 755 eth0_mac_fixup.sh ${D}${localbindir}/eth0_mac_fixup.sh + # networking is done after rcS, any start level within rcS + # for mac fixup should work + install -m 755 eth0_mac_fixup.sh ${D}${sysconfdir}/init.d/eth0_mac_fixup.sh + update-rc.d -r ${D} eth0_mac_fixup.sh start 70 S . - install -m 755 power-on.sh ${D}${localbindir}/power-on.sh + install -m 755 start_us_monitor.sh ${D}${sysconfdir}/init.d/start_us_monitor.sh + update-rc.d -r ${D} start_us_monitor.sh start 84 S . - install -m 755 sensors_config_fix.sh ${D}${localbindir} - install -m 644 sensors_config_fix.service ${D}${systemd_system_unitdir} + install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh + update-rc.d -r ${D} power-on.sh start 85 S . + + # rc.[2345] + + install -m 0755 ${WORKDIR}/rc.local ${D}${sysconfdir}/init.d/rc.local + update-rc.d -r ${D} rc.local start 99 2 3 4 5 . + + install -m 755 sensors_config_fix.sh ${D}${sysconfdir}/init.d/sensors_config_fix.sh + update-rc.d -r ${D} sensors_config_fix.sh start 100 2 3 4 5 . } FILES_${PN} += "${sysconfdir}" - -SYSTEMD_SERVICE_${PN} += "fix_fru_eeprom.service \ - us_monitor.service \ - sensors_config_fix.service \ -" diff --git a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/fix_fru_eeprom.service b/meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_card.sh similarity index 67% rename from meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/fix_fru_eeprom.service rename to meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_card.sh index 124b12821d46..ffddf2e274d0 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/fix_fru_eeprom.service +++ b/meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_card.sh @@ -1,3 +1,5 @@ +#!/bin/sh +# # Copyright 2014-present Facebook. All Rights Reserved. # # This program file is free software; you can redistribute it and/or modify it @@ -15,15 +17,36 @@ # 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # -[Unit] -Description=Fix FRU EEPROM -Wants=setup_i2c.service -After=setup_i2c.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/local/bin/fix_fru_eeprom.py - -[Install] -WantedBy=multi-user.target + +. /usr/local/bin/openbmc-utils.sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin + +I2C_BUS=0 +RETIMER_ADDR=0x58 + +usage() { + echo "Usage: $0 start" +} + +do_start() { + #i2cset -f -y ${I2C_BUS} ${RETIMER_ADDR} 0 0 + exit 0 +} + +if [ $# -lt 1 ]; then + usage + exit -1 +fi + +case "$1" in + start) + do_start + ;; + *) + usage + exit -1 + ;; +esac + +exit $? diff --git a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/sensors_config_fix.service b/meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_scm.sh similarity index 67% rename from meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/sensors_config_fix.service rename to meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_scm.sh index 7db6cb029bb9..bb9d2e384a12 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/sensors_config_fix.service +++ b/meta-facebook/meta-galaxy100/recipes-utils/repeater/files/repeater_scm.sh @@ -1,3 +1,5 @@ +#!/bin/sh +# # Copyright 2014-present Facebook. All Rights Reserved. # # This program file is free software; you can redistribute it and/or modify it @@ -15,14 +17,36 @@ # 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # -[Unit] -Description=Fix sensor configuration -Wants=setup_i2c.service -After=setup_i2c.service -[Service] -Type=oneshot -ExecStart=/usr/local/bin/sensors_config_fix.sh +. /usr/local/bin/openbmc-utils.sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin + +I2C_BUS=1 +RETIMER_ADDR=0x58 + +usage() { + echo "Usage: $0 start" +} + +do_start() { + #i2cset -f -y ${I2C_BUS} ${RETIMER_ADDR} 0 0 + exit 0 +} + +if [ $# -lt 1 ]; then + usage + exit -1 +fi + +case "$1" in + start) + do_start + ;; + *) + usage + exit -1 + ;; +esac -[Install] -WantedBy=multi-user.target +exit $? diff --git a/meta-facebook/meta-galaxy100/recipes-utils/repeater/repeater_0.1.bb b/meta-facebook/meta-galaxy100/recipes-utils/repeater/repeater_0.1.bb new file mode 100644 index 000000000000..3934e65bf1aa --- /dev/null +++ b/meta-facebook/meta-galaxy100/recipes-utils/repeater/repeater_0.1.bb @@ -0,0 +1,38 @@ +# Copyright 2014-present Facebook. All Rights Reserved. +# +# This program file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# + +SUMMARY = "Repeater Utilities" +DESCRIPTION = "Util for Repeater" +SECTION = "base" +PR = "r1" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://repeater_card.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0" + +SRC_URI = "file://repeater_card.sh \ + file://repeater_scm.sh \ + " +S = "${WORKDIR}" + +DEPENDS += "update-rc.d-native" + +do_install() { + #init + install -d ${D}${sysconfdir}/init.d + install -m 0755 repeater_card.sh ${D}${sysconfdir}/init.d/repeater_card.sh + update-rc.d -r ${D} repeater_card.sh start 110 2 3 4 5 . + install -m 0755 repeater_scm.sh ${D}${sysconfdir}/init.d/repeater_scm.sh + update-rc.d -r ${D} repeater_scm.sh start 110 2 3 4 5 . +} + +FILES_${PN} = "${sysconfdir}" diff --git a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/us_monitor.service b/meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_card.sh similarity index 67% rename from meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/us_monitor.service rename to meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_card.sh index 4e5d1a29188e..0df8995244b4 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/openbmc-utils/files/us_monitor.service +++ b/meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_card.sh @@ -1,3 +1,5 @@ +#!/bin/sh +# # Copyright 2014-present Facebook. All Rights Reserved. # # This program file is free software; you can redistribute it and/or modify it @@ -15,14 +17,36 @@ # 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # -[Unit] -Description=Monitor microserver status -Wants=setup_i2c.service -After=setup_i2c.service -[Service] -Restart=on-failure -ExecStart=/usr/local/bin/us_monitor.sh +. /usr/local/bin/openbmc-utils.sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin + +I2C_BUS=0 +RETIMER_ADDR=0x18 + +usage() { + echo "Usage: $0 start" +} + +do_start() { + #i2cset -f -y ${I2C_BUS} ${RETIMER_ADDR} 0 0 + exit 0 +} + +if [ $# -lt 1 ]; then + usage + exit -1 +fi + +case "$1" in + start) + do_start + ;; + *) + usage + exit -1 + ;; +esac -[Install] -WantedBy=multi-user.target +exit $? diff --git a/meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_scm.sh b/meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_scm.sh new file mode 100644 index 000000000000..1f5ba6da0071 --- /dev/null +++ b/meta-facebook/meta-galaxy100/recipes-utils/retimer/files/retimer_scm.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Copyright 2014-present Facebook. All Rights Reserved. +# +# This program file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program in a file named COPYING; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301 USA +# + +. /usr/local/bin/openbmc-utils.sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin + +I2C_BUS=1 +RETIMER_ADDR=0x18 + +usage() { + echo "Usage: $0 start" +} + +do_start() { + #i2cset -f -y ${I2C_BUS} ${RETIMER_ADDR} 0 0 + exit 0 +} + +if [ $# -lt 1 ]; then + usage + exit -1 +fi + +case "$1" in + start) + do_start + ;; + *) + usage + exit -1 + ;; +esac + +exit $? diff --git a/meta-facebook/meta-galaxy100/recipes-utils/retimer/retimer_0.1.bb b/meta-facebook/meta-galaxy100/recipes-utils/retimer/retimer_0.1.bb new file mode 100644 index 000000000000..1d1a62031329 --- /dev/null +++ b/meta-facebook/meta-galaxy100/recipes-utils/retimer/retimer_0.1.bb @@ -0,0 +1,38 @@ +# Copyright 2014-present Facebook. All Rights Reserved. +# +# This program file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# + +SUMMARY = "Retimer Utilities" +DESCRIPTION = "Util for Retimer" +SECTION = "base" +PR = "r1" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://retimer_card.sh;beginline=5;endline=18;md5=0b1ee7d6f844d472fa306b2fee2167e0" + +SRC_URI = "file://retimer_card.sh \ + file://retimer_scm.sh \ + " +S = "${WORKDIR}" + +DEPENDS += "update-rc.d-native" + +do_install() { + #init + install -d ${D}${sysconfdir}/init.d + install -m 0755 retimer_card.sh ${D}${sysconfdir}/init.d/retimer_card.sh + update-rc.d -r ${D} retimer_card.sh start 110 2 3 4 5 . + install -m 0755 retimer_scm.sh ${D}${sysconfdir}/init.d/retimer_scm.sh + update-rc.d -r ${D} retimer_scm.sh start 110 2 3 4 5 . +} + +FILES_${PN} = "${sysconfdir}" diff --git a/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/watchdogd.service b/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/setup-watchdogd.sh similarity index 68% rename from meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/watchdogd.service rename to meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/setup-watchdogd.sh index 90e0479060d1..d4f3bc9ec68a 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/watchdogd.service +++ b/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/files/setup-watchdogd.sh @@ -1,3 +1,5 @@ +#!/bin/sh +# # Copyright 2014-present Facebook. All Rights Reserved. # # This program file is free software; you can redistribute it and/or modify it @@ -15,16 +17,19 @@ # 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # -[Unit] -Description=Set up watchdogd -After=setup_i2c.service -Wants=setup_i2c.service +### BEGIN INIT INFO +# Provides: setup-watchdogd +# Required-Start: +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Set watchdogd handler +### END INIT INFO + +. /usr/local/bin/openbmc-utils.sh -[Service] -Restart=on-failure -ExecStartPre=/bin/sh -c 'source /usr/local/bin/openbmc-utils.sh; devmem_clear_bit 0x1e78502c 0' -ExecStart=/usr/bin/watchdogd.sh +# Disable the dual boot watch dog +devmem_clear_bit 0x1e78502c 0 -[Install] -WantedBy=multi-user.target +/usr/bin/watchdogd.sh > /dev/null 2>&1 & diff --git a/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/watchdogd_0.1.bb b/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/watchdogd_0.1.bb index 8ba0c238e099..b427f0c1acd8 100644 --- a/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/watchdogd_0.1.bb +++ b/meta-facebook/meta-galaxy100/recipes-utils/watchdogd/watchdogd_0.1.bb @@ -24,37 +24,37 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://watchdogd.sh;beginline=4;endline=16;md5=c5df8524e560f89f6fe75bb131d6e14d" SRC_URI = "file://watchdogd.sh \ - file://watchdogd.service \ + file://setup-watchdogd.sh \ " RDEPENDS_${PN} += " python3 bash" +DEPENDS_append += " update-rc.d-native" # Why do rocko needs python3 and krogoth didn't? # -# First, it's important to mention that when you run bitbake,you have several functions from .bbclass files which scanned your recipe and get the build going. +# First, it's important to mention that when you run bitbake,you have several functions from .bbclass files which scanned your recipe and get the build going. # The watchdog daemon recipe is being scanned by the do_package_qa recipe task. This yocto package function call the package_qa_check_rdepends function which # will check all the dependencies in this watchdogd_0.1.bb recipe. It expects to have python in the dependency list for python-core and skip checking /usr/bin/python # if python is in the dependency list. Please read go to the codes that I mentioned at the end of this note for more details of what's going on. # That's the case for both rocko and krogoth. For krogoth, if it doesn't find the python dependency it treats it as a warning and continue. -# Rocko is a lot stricter and treats it as an error. Unlike krogoth, rocko doesn't add the code to override it. +# Rocko is a lot stricter and treats it as an error. Unlike krogoth, rocko doesn't add the code to override it. # # More details can be found here (check both rocko and krogoth). -# Files: yocto/rocko/poky/meta/classes/insane.bbclass +# Files: yocto/rocko/poky/meta/classes/insane.bbclass # Function: search for package_qa_check_rdepends # -# Read the codes and you will see where it is expecting python dependency to be part of the recipe file and why, and this will make more sense to you. +# Read the codes and you will see where it is expecting python dependency to be part of the recipe file and why, and this will make more sense to you. # -inherit systemd - S = "${WORKDIR}" do_install() { install -d ${D}${bindir} install -m 0755 watchdogd.sh ${D}${bindir}/watchdogd.sh - install -d ${D}${systemd_system_unitdir} - install -m 644 watchdogd.service ${D}${systemd_system_unitdir} + install -d ${D}${sysconfdir}/init.d + install -d ${D}${sysconfdir}/rcS.d + install -m 755 setup-watchdogd.sh ${D}${sysconfdir}/init.d/setup-watchdogd.sh + update-rc.d -r ${D} setup-watchdogd.sh start 95 2 3 4 5 . } FILES_${PN} = "${bindir}" - -SYSTEMD_SERVICE_${PN} = "watchdogd.service" +FILES_${PN} += "${sysconfdir}"