Skip to content

Update preinstallimage-bios.sh.in review #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: release/IPM-2.8.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions obs/preinstallimage-bios.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ mkdir -p /etc/network
# The IPC loader renames interfaces to LANx pattern, current OVA one does not
FIRSTIFNAME="`file -b /bin/bash | sed -e 's|.*x86-64.*|eth0|' -e 's|.*ARM.*|LAN1|'`"
mkdir -p /etc/network/interfaces.d

## Review1: obsolete debian version
## Proposal1: remove it and keep the default case
case "$OSIMAGE_DISTRO" in
Debian_8.0) # syntax not supported, parsing the lines below fails
# in main file, spews errors but proceeds in included config
Expand All @@ -385,17 +388,8 @@ cat > /etc/network/interfaces <<EOF
auto lo
# Note: the list of configured "iface"s below must contain all these allowed:
auto $FIRSTIFNAME
allow-hotplug LAN2 LAN3
iface lo inet loopback
iface $FIRSTIFNAME inet dhcp
iface LAN2 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
iface LAN3 inet static
address 192.168.2.10
netmask 255.255.255.0
gateway 192.168.2.1
# Note: This inclusion must be last in the file, Debian 8 OS images get
# confused about it and tend to not read config/start the network at all
source-directory /etc/network/interfaces.d
Expand All @@ -408,6 +402,8 @@ if [ -e /lib/udev/rules.d/80-net-setup-link.rules ] || [ -e /usr/lib/udev/rules.
ln -s /dev/null /etc/udev/rules.d/80-net-setup-link.rules
fi

## Review3: check resolv file
## Proposal3: check
cat > /etc/resolv.conf <<EOF
domain mbt.lab.etn.com
search mbt.lab.etn.com
Expand Down Expand Up @@ -447,6 +443,9 @@ EOF
# Note that this (and other code) currently hardcodes a DEB package based
# distro, and specifically Jessie (Debian 8), into the image recipe.
mkdir -p /etc/apt/sources.list.d

## Review4: obsolete debian version
## Proposal4: update teh fallback
# Our build system is now expected to provide an OSIMAGE_DISTRO value and
# pre-populate /etc/apt/sources.list.d/debian.list with a proper repository
if test -z "${OSIMAGE_DISTRO-}" ; then
Expand All @@ -460,6 +459,8 @@ EOF
echo "WARNING : Fallback to OSIMAGE_DISTRO='$OSIMAGE_DISTRO' since none was provided" >&2
fi

## Review5: 'Pool\:/master' does not exist !!!!
## Proposal5: should be craeted on OBS ? how?
# Append the (currently internal) OBS source of built packages:
# Note: do not change the 'Pool\:/master' reference below because it may be
# substituted to corresponding actual repository during OBS image creation.
Expand All @@ -486,6 +487,9 @@ case "$IMGTYPE" in
esac

# This may be not available on space-constrained deploy images
## Review6: apt-key is deprecated
## Proposal6: should use gpg to add repository keys
##question6: which repo key ?
if command -v apt-key >/dev/null ; then
cat << EOF | apt-key add -
-----BEGIN PGP PUBLIC KEY BLOCK-----
Expand Down Expand Up @@ -865,7 +869,15 @@ esac

# Enable 42ity services (distributed as a systemd preset file)
# NOTE that in Debian 10 this seems to also process ALL service files
# found in the system, not just presets.
## found in the system, not just presets.
## Review7: some services don't exist
## Proposal7: for which reason? somethting to do remove them or create them?
## [ 139s] Failed to disable unit, unit lcd-boot-display.service does not exist.
## [ 139s] Failed to disable unit, unit lcd-net-display.service does not exist.
## [ 139s] Failed to disable unit, unit lcd-shutdown-display.service does not exist.
## [ 139s] Failed to disable unit, unit lcd-shutdown-inverse-display.service does not exist.
## [ 139s] Failed to disable unit, unit lcd-reboot-display.service does not exist.
## [ 139s] Failed to disable unit, unit lcd-poweroff-display.service does not exist
/bin/systemctl preset-all
if [ "`uname -m`" = x86_64 ]; then
/bin/systemctl disable lcd-boot-display || true
Expand All @@ -891,6 +903,9 @@ else
/bin/systemctl enable lcd-poweroff-display || true
#sed -i 's|PathChanged=/etc|PathChanged=/mnt/nand/overlay/etc|' /usr/lib/systemd/system/composite-metrics\@.path
fi
## Review8: some services don't exist
## Proposal8:for which reason? somethting to do remove them or create them?
##[ 139s] Failed to disable unit, unit [email protected] does not exist.

# Our tntnet unit rocks, disable packaged default
if [ -s /lib/systemd/system/[email protected] ]; then
Expand Down Expand Up @@ -1172,6 +1187,9 @@ fi
install -m 0755 /usr/share/fty/scripts/curlbbwget.sh /usr/bin/curl

#########################################################################
## Review9: check this agent ?
## Proposal9: --

# Setup zabbix
# TODO: revise the list of 42ity services here
if [ -f /usr/bin/zabbix_agent ]; then
Expand Down