From ef71f0e3e9950a1dc52532fd843dddb53b069d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Wed, 10 Feb 2021 21:21:53 +0100 Subject: [PATCH] Check that files that we want to update do exist On arm64 the set of available files is different because we don't use isolinux and win32-loader. --- simple-cdd/disc-end-hook | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/simple-cdd/disc-end-hook b/simple-cdd/disc-end-hook index 3c48f3a..95916b9 100755 --- a/simple-cdd/disc-end-hook +++ b/simple-cdd/disc-end-hook @@ -10,18 +10,25 @@ ARCHES=$5 cd $CDDIR +fix_branding() { + sed -i -e 's|Debian GNU/Linux|Kali Linux|g' \ + -e 's|Kali GNU/Linux|Kali Linux|g' \ + -e 's|Debian kali-rolling|Kali Rolling|g' \ + -e 's|Debian|Kali|g' \ + -e 's|DEBIAN|KALI|g' \ + "$@" +} + # Rebrand Debian into Kali -# The theme doesn't exist on arm64... -if [ "$ARCHES" != "arm64" ]; then -sed -i -e 's|Debian GNU/Linux|Kali Linux|g' \ - -e 's|Kali GNU/Linux|Kali Linux|g' \ - -e 's|Debian kali-rolling|Kali Rolling|g' \ - -e 's|Debian|Kali|g' \ - -e 's|DEBIAN|KALI|g' \ - ../boot$DISKNUM/isolinux/menu.cfg \ - ../boot$DISKNUM/isolinux/*.txt \ - boot/grub/theme/* \ - autorun.inf +if [ -e ../boot$DISKNUM/isolinux/menu.cfg ]; then + fix_branding ../boot$DISKNUM/isolinux/menu.cfg \ + ../boot$DISKNUM/isolinux/*.txt +fi +if [ -d boot/grub/theme ] && [ -s boot/grub/theme ]; then + fix_branding boot/grub/theme/* +fi +if [ -e autorun.inf ]; then + fix_branding autorun.inf fi # Replace Debian specific documentation