( cd boot ; rm -rf System.map-armv7 )
( cd boot ; ln -sf System.map-armv7-5.15.21 System.map-armv7 )
( cd boot ; rm -rf dtb )
( cd boot ; ln -sf dtb-5.15.21 dtb )
( cd boot ; rm -rf initrd-armv7 )
( cd boot ; ln -sf initrd-armv7-5.15.21 initrd-armv7 )
( cd boot ; rm -rf zImage-armv7 )
( cd boot ; ln -sf zImage-armv7-5.15.21 zImage-armv7 )

# Call the OS InitrRD manager to reincorporate any locally
# held user modifications, to load modules and so on.
#
chroot . /usr/sbin/os-initrd-mgr -q

# Collapse all 32bit ARM & x86 variants of 'i?86' into a single
# platform: 'x86' and 'arm' respectively.
export ARCH=$( uname -m | sed -e 's%i[0-9]86%x86%g' -e 's?arm.*?arm?g' )

# Execute any helper scripts found for this platform.
# This enables the Raspberry Pi's Hardware Model Boot Ware partition
# to receive the latest Kernel, OS InitRD, DTBs et al in addition to
# the standard location, /boot.
# This may be useful for other Hardware Models that need to perform
# post installation actions, to accommodate idiosyncrasies.
[ -d /boot/platform/$ARCH/helper/ ] && {
   for helper in $( find /boot/platform/$ARCH/helper/ -name 'pkg-kernel-*' -type f ) ; do
      [ -x ${helper} ] && ${helper}
   done }
