Skip to content

Commit

Permalink
revert systemd changes for now
Browse files Browse the repository at this point in the history
Summary: This reverts D24086062 and D24134064.  No other changes.

Test Plan: Successfully built an image with bitbake.

Reviewed By: vineelasmile

fbshipit-source-id: 1349bcd979
  • Loading branch information
doranand authored and facebook-github-bot committed Oct 9, 2020
1 parent 51e0176 commit 58376b8
Show file tree
Hide file tree
Showing 12 changed files with 299 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ IMAGE_INSTALL += " \
openbmc-utils \
openbmc-gpio \
po-eeprom \
repeater \
retimer \
kcsd \
spatula \
stress \
usb-console \
wedge-eeprom \
weutil-dhcp-id \
watchdogd \
systemd-networkd \
udev-rules \
"

IMAGE_INSTALL_remove += "init-ifupdown"
SYSVINIT_SCRIPTS_remove += "init-ifupdown"

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
# for more details.
#

inherit systemd

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://board-utils.sh \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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 \
"
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 $?
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 $?
Original file line number Diff line number Diff line change
@@ -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}"
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 $?
Loading

0 comments on commit 58376b8

Please sign in to comment.