Minor refactor of wwinit and build-ipxe scripts

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2024-10-31 09:49:55 -06:00
parent f3a1b43360
commit 36d8984d96
2 changed files with 7 additions and 23 deletions

View File

@@ -5,21 +5,13 @@ echo "Hello from WWINIT"
. /warewulf/config . /warewulf/config
myPATH=/warewulf/init.d myPATH=/warewulf/init.d
while read -r NAME; do ls -1 $myPATH/ | while read -r NAME; do
# if [ -x $myPATH/$NAME ] echo "Launching: $NAME"
# then sh "$myPATH/$NAME"
echo "Launching: $NAME" done
sh "$myPATH/$NAME"
# fi
done <<EOF
# `ls $myPATH/*.sh`
`ls $myPATH/`
EOF
echo "Calling $WWINIT..." echo "Calling $WWINIT..."
echo echo
sleep 2 sleep 2
exec $WWINIT exec $WWINIT

View File

@@ -3,10 +3,6 @@
set -e set -e
TARGETS=${TARGETS:-"bin-x86_64-pcbios/undionly.kpxe bin-x86_64-efi/snponly.efi bin-arm64-efi/snponly.efi"} TARGETS=${TARGETS:-"bin-x86_64-pcbios/undionly.kpxe bin-x86_64-efi/snponly.efi bin-arm64-efi/snponly.efi"}
TARGS="bin-x86_64-pcbios/undionly.kpxe
bin-x86_64-efi/snponly.efi
bin-arm64-efi/snponly.efi"
IPXE_BRANCH=${IPXE_BRANCH:-master} IPXE_BRANCH=${IPXE_BRANCH:-master}
DESTDIR=${DESTDIR:-/usr/local/share/ipxe} DESTDIR=${DESTDIR:-/usr/local/share/ipxe}
@@ -43,7 +39,8 @@ main() {
cd ipxe/src cd ipxe/src
while read -r target; do echo $TARGETS | sed 's/ */\n/g' | while read -r target
do
if $(echo "$target" | grep -q "\-arm64-") if $(echo "$target" | grep -q "\-arm64-")
then then
if ! which aarch64-linux-gnu-gcc >/dev/null 2>&1 if ! which aarch64-linux-gnu-gcc >/dev/null 2>&1
@@ -60,17 +57,13 @@ while read -r target; do
destname=$(echo $target | tr / -) destname=$(echo $target | tr / -)
make -j $CPUS CROSS="${CROSS}" $target "$@" && cp -v $target ${DESTDIR}/${destname} make -j $CPUS CROSS="${CROSS}" $target "$@" && cp -v $target ${DESTDIR}/${destname}
restore_config restore_config
done
done <<EOF
$TARGS
EOF
} }
configure_arm64() { configure_arm64() {
# CONSOLE_SERIAL causes build failure for aarch64, so omitting here # CONSOLE_SERIAL causes build failure for aarch64, so omitting here
# https://github.com/ipxe/ipxe/issues/658 # https://github.com/ipxe/ipxe/issues/658
ls -l config >> /root/args
sed -i.bak \ sed -i.bak \
-e 's,//\(#define.*CONSOLE_FRAMEBUFFER.*\),\1,' \ -e 's,//\(#define.*CONSOLE_FRAMEBUFFER.*\),\1,' \
config/console.h config/console.h
@@ -84,7 +77,6 @@ configure_arm64() {
configure_x86_64() { configure_x86_64() {
ls -l config >> /root/args
sed -i.bak \ sed -i.bak \
-e 's,//\(#define.*CONSOLE_SERIAL.*\),\1,' \ -e 's,//\(#define.*CONSOLE_SERIAL.*\),\1,' \
-e 's,//\(#define.*CONSOLE_FRAMEBUFFER.*\),\1,' \ -e 's,//\(#define.*CONSOLE_FRAMEBUFFER.*\),\1,' \