From 127f4ce3ecb0e8a7903b89becaad520156b42aaf Mon Sep 17 00:00:00 2001 From: notro Date: Sun, 3 Nov 2013 11:13:01 +0000 Subject: [PATCH] Add support for pre/post install scripts and Device Tree Blobs --- rpi-update | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rpi-update b/rpi-update index b643eda..0c75dd7 100755 --- a/rpi-update +++ b/rpi-update @@ -103,6 +103,9 @@ function update_firmware { cp -v "${FW_REPOLOCAL}/"*.dat "${FW_PATH}/" if [[ ${SKIP_KERNEL} -eq 0 ]]; then cp -v "${FW_REPOLOCAL}/"*.img "${FW_PATH}/" + if [[ -n $(shopt -s nullglob; echo "${FW_REPOLOCAL}/"*.dtb) ]]; then + cp -v "${FW_REPOLOCAL}/"*.dtb "${FW_PATH}/" + fi else echo " *** As requested, not updating kernel" fi @@ -155,11 +158,19 @@ function do_backup { } function do_update { + if [[ -f "${FW_REPOLOCAL}/pre-install" ]]; then + echo " *** Running pre-install script" + source "${FW_REPOLOCAL}/pre-install" + fi update_firmware update_modules update_vc_libs update_sdk finalise + if [[ -f "${FW_REPOLOCAL}/post-install" ]]; then + echo " *** Running post-install script" + source "${FW_REPOLOCAL}/post-install" + fi echo " *** If no errors appeared, your firmware was successfully $1" if [[ "${ROOT_PATH}" == "/" ]]; then echo " *** A reboot is needed to activate the new firmware"