summaryrefslogtreecommitdiff
path: root/meta-hpe
diff options
context:
space:
mode:
authorcharkear <charles.kearney@hpe.com>2023-05-17 23:53:43 +0300
committerJean-Marie Verdun <jean-marie.verdun@hpe.com>2023-05-23 19:23:20 +0300
commitee5dd4aec18d222f499569ab464549d7cc674d86 (patch)
tree47e78ed204502179f5e5644e549d447780c8c64f /meta-hpe
parentb34e0dada006d92d6d12aac6055fb56c39385124 (diff)
downloadopenbmc-ee5dd4aec18d222f499569ab464549d7cc674d86.tar.xz
meta-hpe: remove bash dependency
Images built for HPE machines become too large when bash is added as a dependency. Change-Id: Ib6e49647c22f1d0345ef44ffc9140ac73ed999b1 Signed-off-by: Charles Kearney <charles.kearney@hpe.com>
Diffstat (limited to 'meta-hpe')
-rw-r--r--meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb2
-rw-r--r--meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh12
-rw-r--r--meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh23
-rw-r--r--meta-hpe/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend1
-rw-r--r--meta-hpe/meta-common/recipes-phosphor/packagegroups/packagegroup-hpe-apps.bb1
-rw-r--r--meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend1
-rw-r--r--meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh13
7 files changed, 29 insertions, 24 deletions
diff --git a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb
index c0f5d641b3..58cc921a50 100644
--- a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb
+++ b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb
@@ -14,8 +14,6 @@ SYSTEMD_LINK_${PN} += "${HOST_BOOT_FMT}"
SRC_URI += "file://host-boot-enable.service"
SRC_URI += "file://host-boot-enable.sh"
-RDEPENDS:${PN}:append = " bash"
-
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/host-boot-enable.sh ${D}${bindir}
diff --git a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
index c43ed34d62..06bfecd156 100644
--- a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
+++ b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
@@ -7,10 +7,9 @@ findmtd() {
echo "$m"
}
-rom_lists=(host-prime host-second vrom-prime vrom-second)
-rom_mtd_list=()
+set -- host-prime host-second vrom-prime vrom-second
-for f in "${rom_lists[@]}"
+for f in "$@"
do
image=$(findmtd "${f}")
if test -z "$image"
@@ -18,14 +17,13 @@ do
echo "Unable to find mtd partition for ${f}"
exit 1
fi
- rom_mtd_list+=("$image")
done
#enable vrom
# host-prime to vrom-prime
-dd if="/dev/${rom_mtd_list[0]}" of="/dev/${rom_mtd_list[2]}"
+dd if="/dev/$(findmtd host-prime)" of="/dev/$(findmtd vrom-prime)"
# host-second to vrom-second
-dd if="/dev/${rom_mtd_list[1]}" of="/dev/${rom_mtd_list[3]}"
+dd if="/dev/$(findmtd host-second)" of="/dev/$(findmtd vrom-second)"
echo 0x1800008a > /sys/class/soc/srom/vromoff
diff --git a/meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh b/meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh
index 53905fc82c..b61f9c23f6 100644
--- a/meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh
+++ b/meta-hpe/meta-common/recipes-phosphor/initrdscripts/files/gxp-obmc-init.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
fslist="proc sys dev run"
rodir=run/initramfs/ro
@@ -7,7 +7,10 @@ upper=$rwdir/cow
work=$rwdir/work
cd /
-mkdir -p "$fslist"
+for f in $fslist
+do
+ mkdir -p "$f"
+done
mount dev dev -tdevtmpfs
mount sys sys -tsysfs
mount proc proc -tproc
@@ -125,15 +128,23 @@ try_wget() {
fi
}
+getch() {
+ old=$(stty -g)
+ stty raw -echo min 0 time 50
+ printf '%s' "$(dd bs=1 count=1 2>/dev/null)"
+ stty "$old"
+}
+
debug_takeover() {
echo "$@"
- read -t 5 -n 1 -s -r -p "Press any key to log in and try to manually fix, force recovery in 5 seconds"
- if test $? -gt 0
+ echo "Press (Y/y) to log in and try to manually fix, force recovery in 5 seconds"
+ answer=$(getch)
+ if [ "$answer" != "y" ] && [ "$answer" != "Y" ] ;
then
mkdir -p /var/lock
envdev=$(findmtd u-boot-env)
- echo -e "/dev/${envdev}\t0x00000\t0x10000" > /etc/fw_env.config
- echo -e "/dev/${envdev}\t0x10000\t0x10000" >> /etc/fw_env.config
+ echo "/dev/${envdev} 0x00000 0x10000" > /etc/fw_env.config
+ echo "/dev/${envdev} 0x10000 0x10000" >> /etc/fw_env.config
fw_setenv force_recovery 1
fw_setenv last_booterrmsg "$@"
devmem 0xc0000000 32 0x01
diff --git a/meta-hpe/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend b/meta-hpe/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend
index b4092a1760..17110b3583 100644
--- a/meta-hpe/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend
+++ b/meta-hpe/meta-common/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bbappend
@@ -10,4 +10,3 @@ do_install:append() {
FILES:${PN} += " /init /shutdown /update /whitelist /dev "
FILES:${PN} += " /init-options /init-download-url "
-RDEPENDS:${PN}:append = " bash"
diff --git a/meta-hpe/meta-common/recipes-phosphor/packagegroups/packagegroup-hpe-apps.bb b/meta-hpe/meta-common/recipes-phosphor/packagegroups/packagegroup-hpe-apps.bb
index 5f711a29d4..909f3b8538 100644
--- a/meta-hpe/meta-common/recipes-phosphor/packagegroups/packagegroup-hpe-apps.bb
+++ b/meta-hpe/meta-common/recipes-phosphor/packagegroups/packagegroup-hpe-apps.bb
@@ -45,4 +45,5 @@ RDEPENDS:${PN}-system = " \
phosphor-ipmi-ipmb \
dbus-sensors \
host-ehci-owner-reset \
+ host-boot-enable \
"
diff --git a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend
index e8b0ea6dcc..4fc41d0580 100644
--- a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend
+++ b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend
@@ -1,2 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
-RDEPENDS:${PN}:append = " bash"
diff --git a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
index bff898d7f8..0752205334 100644
--- a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
+++ b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
findmtd() {
m=$(grep -xl "$1" /sys/class/mtd/*/name)
@@ -7,10 +7,9 @@ findmtd() {
echo "$m"
}
-rom_lists=(host-prime host-second vrom-prime vrom-second)
-rom_mtd_list=()
+set -- host-prime host-second vrom-prime vrom-second
-for f in "${rom_lists[@]}"
+for f in "$@"
do
image=$(findmtd "${f}")
if test -z "$image"
@@ -18,14 +17,13 @@ do
echo "Unable to find mtd partition for ${f}"
exit 1
fi
- rom_mtd_list+=("$image")
done
#enable vrom
# host-prime to vrom-prime
-dd if="/dev/${rom_mtd_list[0]}" of="/dev/${rom_mtd_list[2]}"
+dd if="/dev/$(findmtd host-prime)" of="/dev/$(findmtd vrom-prime)"
# host-second to vrom-second
-dd if="/dev/${rom_mtd_list[1]}" of="/dev/${rom_mtd_list[3]}"
+dd if="/dev/$(findmtd host-second)" of="/dev/$(findmtd vrom-second)"
echo 0x1800008a > /sys/class/soc/srom/vromoff
@@ -38,3 +36,4 @@ do
sleep 1
done
+ \ No newline at end of file