Skip to content
Snippets Groups Projects
Verified Commit 176fba59 authored by Johannes Schauer Marin Rodrigues's avatar Johannes Schauer Marin Rodrigues
Browse files

add /usr/share/kernel/postinst.d/zz-reform-tools

parent 9fd11409
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ flash-kernel/* /usr/share/flash-kernel
initramfs-tools/hooks/reform /usr/share/initramfs-tools/hooks
initramfs-tools/reform.conf /usr/share/initramfs-tools/modules.d/
initramfs-tools/scripts/reform /usr/share/initramfs-tools/scripts/init-top
kernel/zz-reform-tools /usr/share/kernel/postinst.d/zz-reform-tools
libexec/* /usr/libexec
machines/* /usr/share/reform-tools/machines
mnt-icon-font/MNTIcons.ttf /usr/share/fonts/truetype/
......
#!/bin/sh
#
# Populate /boot with all known dtbs.
# The flash-kernel package is still needed to provide the /boot/dtb-$(uname -r)
# symlink. That symlink is needed on platforms that do not set the `${fdtfile}`
# u-boot environment variable.
set -e
self="$0"
version="$1"
image_path="$2"
set -- $DEB_MAINT_PARAMS
# strip single quotes from beginning and end
action="${1#\'}"
action="${mode%\'}"
set -u
install_dtbs() {
for CONF in /usr/share/reform-tools/machines/*.conf; do
. "$CONF"
dtb=$(find "/usr/lib/linux-image-$version" -wholename "*/$DTBPATH" 2>/dev/null | head -n 1)
if ! test -f "$dtb"; then
echo "E: $dtb does not exist" >&2
continue
fi
mkdir -p "/boot/dtbs/$version/$(dirname "$DTBPATH")"
cp "$dtb" "/boot/dtbs/$version/$DTBPATH"
done
}
remove_dtbs() {
for CONF in /usr/share/reform-tools/machines/*.conf; do
. "$CONF"
rm -f "/boot/dtbs/$version/$DTBPATH" || :
done
rmdir --ignore-fail-on-non-empty "/boot/dtbs/$version"
}
case "$self:$action" in
# Only run on postinst configure and postrm remove, to avoid wasting
# time by calling this script multiple times on upgrade and removal.
*/postinst.d/*:configure) install_dtbs ;;
*/postrm.d/*:remove) remove_dtbs ;;
*) exit 0 ;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment