Skip to content

Commit

Permalink
Use firmware prefix and path in initramfs generation
Browse files Browse the repository at this point in the history
Mimic kernel behaviour of a prefix where to lookup firmware and a file with its path from prefix to avoid confusion on how to use these parameters. This also prevents in folder firmware(ex. i915,amdgpu...) to be copied straight to /lib/firmware in the initramfs.

Signed-off-by: José Pekkarinen <[email protected]>
Fixes: gentoo#5
Signed-off-by: Ben Kohler <[email protected]>
  • Loading branch information
Pekkari authored and benkohler committed Mar 8, 2019
1 parent 8ae9d5a commit 2effaa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gen_initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ append_dropbear(){
}

append_firmware() {
if [ -z "${FIRMWARE_FILES}" -a ! -d "${FIRMWARE_DIR}" ]
if [ ! -d "${FIRMWARE_DIR}" ]
then
gen_die "specified firmware directory (${FIRMWARE_DIR}) does not exist"
fi
Expand All @@ -736,10 +736,12 @@ append_firmware() {
then
OLD_IFS=$IFS
IFS=","
pushd ${FIRMWARE_DIR} >/dev/null
for i in ${FIRMWARE_FILES}
do
cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/
cp -L --parents "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/
done
popd >/dev/null
IFS=$OLD_IFS
else
cp -a "${FIRMWARE_DIR}"/* ${TEMP}/initramfs-firmware-temp/lib/firmware/
Expand Down

0 comments on commit 2effaa1

Please sign in to comment.