pkg/firmware: Fix firmware extraction

Some drivers offer mutliple firmwares with the WHENCE file
defining the default. Use the cope-firmware.sh script to
create a copy of the firmware repository with the defaults
copied in to the right place.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
This commit is contained in:
Rolf Neugebauer 2020-04-13 15:22:03 +01:00
parent 384b439d05
commit cd92ad3f16
2 changed files with 12 additions and 7 deletions

View File

@ -5,12 +5,13 @@ RUN apk add --no-cache git
ENV FW_URL=git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
ENV FW_COMMIT=edf390c23a4e185ff36daded36575f669f5059f7
RUN mkdir -p /out/lib && \
cd /out/lib && \
git clone ${FW_URL} firmware && \
cd firmware && \
git checkout ${FW_COMMIT} && \
rm -rf .git
RUN git clone ${FW_URL} && \
cd /linux-firmware && \
git checkout ${FW_COMMIT}
RUN mkdir -p /out/lib/firmware && \
cd /linux-firmware && \
./copy-firmware.sh /out/lib/firmware
FROM scratch
WORKDIR /

View File

@ -25,6 +25,10 @@ RUN set -e && \
;; \
esac
# Create copy of files with symlinks based on WHENCE
RUN cd /linux-firmware && \
./copy-firmware.sh /linux-firmware-whence
# Extract kernel modules for
WORKDIR /
COPY --from=kernel /kernel.tar /kernel.tar
@ -34,7 +38,7 @@ RUN tar xf /kernel.tar
RUN set -e && \
for fw in $(find /lib/modules -name \*.ko -exec modinfo --field=firmware {} \;); do \
mkdir -p "/out/lib/firmware/$(dirname $fw)" && \
cp "/linux-firmware/$fw" "/out/lib/firmware/$fw"; \
cp "/linux-firmware-whence/$fw" "/out/lib/firmware/$fw"; \
done
FROM scratch