Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #294 from tinkerbell/asrock-kernel-alpine312
Browse files Browse the repository at this point in the history
Asrock Kernel Testing - Alpine 3.12 Version
  • Loading branch information
ScottGarman authored Oct 12, 2021
2 parents 8f09258 + c3b5bb3 commit 75937e4
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docker/lfs/* filter=lfs diff=lfs merge=lfs -text
installer/alpine/assets-*/* filter=lfs diff=lfs merge=lfs -text
installer/alpine/eclypsiumdriver-alpine-* filter=lfs diff=lfs merge=lfs -text
installer/alpine/BIOSControl_v1.0.3.zip filter=lfs diff=lfs merge=lfs -text
11 changes: 11 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ RUN if [ "$(uname -m)" = 'x86_64' ]; then \
rm -f "${ECLYPSIUM_AGENT_FILENAME}"; \
fi ;

ARG ASRR_BIOS_APP_VERSION=1.0.3
ARG ASRR_BIOS_APP_SHA512=5dbb458dd105d872f61f0256ec1a57c5de922328a23cd42e636b35c5bbda7e1e1d957b271de76b49345c35a55a97845842de106aea61f930ac440ad6e21f344a
ARG ASRR_BIOS_APP_FILENAME="BIOSControl_v${ASRR_BIOS_APP_VERSION}.zip"

COPY lfs/${ASRR_BIOS_APP_FILENAME} /tmp/osie/
RUN cd /tmp/osie && \
echo "${ASRR_BIOS_APP_SHA512} ${ASRR_BIOS_APP_FILENAME}" | sha512sum -c && \
unzip ${ASRR_BIOS_APP_FILENAME} && \
install -D -m 755 BIOSControl /usr/sbin/BIOSControl && \
rm -rf /tmp/osie/BIOSControl /tmp/osie/driver /tmp/osie/ReadMe.txt

# freebsd ufs fs fuse
COPY lfs/osie-fuse-* /tmp/osie/
RUN mv /tmp/osie/osie-fuse*$(uname -m).deb /tmp/ && rm -rf /tmp/osie/
Expand Down
3 changes: 3 additions & 0 deletions docker/lfs/BIOSControl_v1.0.3.zip
Git LFS file not shown
4 changes: 2 additions & 2 deletions docker/lfs/getbiosconfig
Git LFS file not shown
12 changes: 10 additions & 2 deletions docker/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function configure_image_cache_dns() {
getent hosts github-cloud.githubusercontent.com | awk '{print $1}'
}

# returns a string of the BIOS vendor: "dell", "supermicro", or "unknown"
# returns a string of the BIOS vendor: "Dell", "Supermicro", "ASRockRack", or "unknown"
function detect_bios_vendor() {
local vendor=unknown

Expand All @@ -128,6 +128,11 @@ function detect_bios_vendor() {
# Check for Supermicro
if /opt/supermicro/sum/sum -c GetDmiInfo >/dev/null; then
vendor="Supermicro"
else
# Check for ASRockRack
if dmidecode --string baseboard-manufacturer | grep --ignore-case ASRockRack >/dev/null; then
vendor="ASRockRack"
fi
fi
fi

Expand All @@ -146,6 +151,9 @@ function detect_bios_version() {
if [[ ${vendor} == "Supermicro" ]]; then
version=$(/opt/supermicro/sum/sum -c GetDmiInfo | grep --after-context 2 "^\[BIOS Information\]" | awk -F '"' '/^Version/ {print $2}')
fi
if [[ ${vendor} == "ASRockRack" ]]; then
version=$(dmidecode --string bios-version)
fi

echo "${version}"
}
Expand All @@ -162,7 +170,7 @@ function bios_inventory() {
local bios_json_fn="/tmp/bios.json"
local hollow_json_fn="/tmp/hollow.json"
local hollow_namespace="net.platformequinix.bios"
if UTIL_RACADM7=/opt/dell/srvadmin/bin/idracadm7 UTIL_SUM=/opt/supermicro/sum/sum packet-hardware inventorybios --verbose -u localhost --dry --cache-file "${bios_json_fn}"; then
if UTIL_RACADM7=/opt/dell/srvadmin/bin/idracadm7 UTIL_SUM=/opt/supermicro/sum/sum UTIL_ASRR_BIOSCONTROL=/usr/sbin/BIOSControl packet-hardware inventorybios --verbose -u localhost --dry --cache-file "${bios_json_fn}"; then
local inventorybios_json
inventorybios_json="$(cat "${bios_json_fn}")"
echo "inventorybios JSON is: [${inventorybios_json}]"
Expand Down
3 changes: 3 additions & 0 deletions installer/alpine/BIOSControl_v1.0.3.zip
Git LFS file not shown
18 changes: 18 additions & 0 deletions installer/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN true && \
coreutils \
linux-headers \
sudo \
unzip \
&& \
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder && \
echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
Expand Down Expand Up @@ -89,6 +90,23 @@ RUN echo "${ECLYPSIUM_DRIVER_SHA512} ${ECLYPSIUM_DRIVER_FILENAME}" | sha512sum
sudo apk add --no-scripts --no-cache --update --upgrade --cache-dir /tmp/non-persisted-apk-cache-dir \
/home/builder/packages/non-free/x86_64/eclypsium*.apk

# Build and install the ASRR BIOS utility and kernel module
ARG ASRR_BIOS_DRIVER_VERSION=1.0
ARG ASRR_BIOS_DRIVER_SHA512=5dbb458dd105d872f61f0256ec1a57c5de922328a23cd42e636b35c5bbda7e1e1d957b271de76b49345c35a55a97845842de106aea61f930ac440ad6e21f344a
ARG ASRR_BIOS_DRIVER_FILENAME="BIOSControl_v1.0.3.zip"

COPY ${ASRR_BIOS_DRIVER_FILENAME} /home/builder/
RUN echo "${ASRR_BIOS_DRIVER_SHA512} ${ASRR_BIOS_DRIVER_FILENAME}" | sha512sum -c && \
unzip ${ASRR_BIOS_DRIVER_FILENAME} && \
# def for 5.x kernel build
echo '#define LINUX_VERSION_500 0' > driver/ver.h && \
# build module
make -C /lib/modules/${KERNEL}-${PKGREL}-${FLAVOR}/build M=/home/builder/driver && \
# install module
sudo install -D -m 600 driver/asrdev.ko /lib/modules/${KERNEL}-${PKGREL}-${FLAVOR}/extra/ && \
# clean up
rm -rf /home/builder/BIOSControl /home/builder/driver /home/builder/ReadMe.txt

# Remove built and installed packages, these never get installed at runtime
RUN rm -rf /home/builder/packages/*

Expand Down
4 changes: 2 additions & 2 deletions installer/alpine/assets-x86_64/initramfs
Git LFS file not shown
4 changes: 2 additions & 2 deletions installer/alpine/assets-x86_64/modloop
Git LFS file not shown
2 changes: 1 addition & 1 deletion installer/alpine/assets-x86_64/vmlinuz
Git LFS file not shown
7 changes: 6 additions & 1 deletion installer/alpine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ set -o errexit -o nounset -o pipefail -o xtrace
[[ $(uname -m) == aarch64 ]] && echo "aarch64 isn't _really_ tested/supported yet" && exit 1

build_initramfs() {
# Asrockrack kernel module
cat >/etc/mkinitfs/features.d/asrockrack.modules <<-EOF
extra/asrdev.ko
EOF

# Eclypsium driver and supporting modules (IPMI)
cat >/etc/mkinitfs/features.d/eclypsium.modules <<-EOF
extra/eclypsiumdriver.ko
Expand All @@ -30,7 +35,7 @@ build_initramfs() {

# Make initramfs with features we think are spiffy
# shellcheck disable=SC2016
echo 'features="base ext2 ext3 ext4 keymap network packetrepo squashfs virtio eclypsium"' >/etc/mkinitfs/mkinitfs.conf
echo 'features="asrockrack base eclypsium ext2 ext3 ext4 keymap network packetrepo squashfs virtio"' >/etc/mkinitfs/mkinitfs.conf
kver=$(basename /lib/modules/*)
mkinitfs -l "$kver"
mkinitfs -o /assets/initramfs "$kver"
Expand Down
2 changes: 1 addition & 1 deletion installer/alpine/init-x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ esac
KOPT_pkgs="curl,docker,jq,mdadm,openssh,kexec-tools,tcpdump"
case "$KOPT_packet_state" in
'') ;;
deprovisioning) KOPT_modules="$KOPT_modules,eclypsiumdriver,ipmi_devintf" ;;
deprovisioning) KOPT_modules="$KOPT_modules,asrdev,eclypsiumdriver,ipmi_devintf" ;;
preinstalling) packet_action=runner ;;
*) echo "ignoring packet_state: $KOPT_packet_state" ;;
esac
Expand Down

0 comments on commit 75937e4

Please sign in to comment.