shimboot/patch_rootfs.sh

26 lines
770 B
Bash
Raw Normal View History

2023-10-07 00:28:40 -04:00
#!/bin/bash
#patch the target rootfs to add any needed drivers
set -e
if [ "$DEBUG" ]; then
set -x
fi
2023-10-20 06:38:45 -04:00
copy_modules() {
2023-10-07 00:28:40 -04:00
local shim_rootfs=$(realpath $1)
2023-10-20 06:38:45 -04:00
local reco_rootfs=$(realpath $2)
local target_rootfs=$(realpath $3)
2023-10-07 00:28:40 -04:00
cp -r "${shim_rootfs}/lib/modules/"* "${target_rootfs}/lib/modules/"
cp -r "${shim_rootfs}/lib/firmware/"* "${target_rootfs}/lib/firmware/"
2023-10-20 06:38:45 -04:00
cp -r "${reco_rootfs}/lib/modprobe.d/"* "${target_rootfs}/lib/modprobe.d/"
cp -r "${reco_rootfs}/etc/modprobe.d/"* "${target_rootfs}/etc/modprobe.d/"
2023-10-07 00:28:40 -04:00
}
2023-10-20 06:38:45 -04:00
download_firmware() {
local firmware_url="https://chromium.googlesource.com/chromiumos/third_party/linux-firmware"
local firmware_path="/tmp/chromium-firmware"
git clone --branch master --depth=1 "${firmware_url}" $firmware_path
}