-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathzz-sync-dtb
executable file
·36 lines (25 loc) · 996 Bytes
/
zz-sync-dtb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
## Copyright 2019-2020 Vagrant Cascadian <vagrant@debian.org>
## This program comes with ABSOLUTELY NO WARRANTY; for details see
## COPYING. This is free software, and you are welcome to
## redistribute it under the terms of the GNU GPL, version 2 or any
## later version; see COPYING for details.
# sync .dtb files into /boot to simplify installations on systems with
# a split /boot partition. To use, install this file into
# /etc/kernel/postinst.d/zz-sync-dtb and mark it as executable.
set -e
version="$1"
command -v rsync >/dev/null 2>&1 || exit 0
# passing the kernel version is required
if [ -z "${version}" ]; then
echo >&2 "W: sync-dtb: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
exit 2
fi
dtbdir="/usr/lib/linux-image-${version}"
if [ -d "${dtbdir}" ]; then
echo >&2 "W: sync-dtb: syncing ${dtbdir}"
mkdir -p "/boot/${dtbdir}"
rsync -a "${dtbdir}/." "/boot/${dtbdir}/."
else
echo >&2 "W: sync-dtb: ${dtbdir} NOT PRESENT"
fi