Skip to content

Commit

Permalink
m1n1: use case not if
Browse files Browse the repository at this point in the history
  • Loading branch information
dkwo committed Dec 24, 2024
1 parent 29bf71f commit c34d845
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions srcpkgs/m1n1/files/kernel.d/m1n1.post-install
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,24 @@ if [ -e "$CONFIG" ]; then
done <$CONFIG
fi

if [ $PAYLOAD = "kernel" ]; then
cat "${M1N1}" $m1n1config >"${TARGET}.new"
cat ${DTBS} >>"${TARGET}.new"
gzip -c "${BOOT}/initramfs-${VERSION}.img" >>"${TARGET}.new"
gzip -c "${BOOT}/vmlinux-${VERSION}" >>"${TARGET}.new"
echo "Payload: m1n1 config dtbs initram kernel"
fi
if [ $PAYLOAD = "uboot" ]; then
cat "${M1N1}" ${DTBS} >"${TARGET}.new"
gzip -c "${U_BOOT}" >>"${TARGET}.new"
cat $m1n1config >>"${TARGET}.new"
echo "Payload: m1n1 dtbs uboot config"
fi
case "$PAYLOAD" in
kernel)
cat "${M1N1}" $m1n1config >"${TARGET}.new"
cat ${DTBS} >>"${TARGET}.new"
gzip -c "${BOOT}/initramfs-${VERSION}.img" >>"${TARGET}.new"
gzip -c "${BOOT}/vmlinux-${VERSION}" >>"${TARGET}.new"
echo "Payload: m1n1 config dtbs initram kernel"
;;
uboot)
cat "${M1N1}" ${DTBS} >"${TARGET}.new"
gzip -c "${U_BOOT}" >>"${TARGET}.new"
cat $m1n1config >>"${TARGET}.new"
echo "Payload: m1n1 dtbs uboot config"
;;
*)
echo "error: unknown PAYLOAD"
;;
esac

[ -e "$TARGET" ] && mv -f "$TARGET" "${TARGET}.old"
mv -f "${TARGET}.new" "$TARGET"
Expand Down

0 comments on commit c34d845

Please sign in to comment.