diff mbox series

[Unstable] UBUNTU: [Debian] Remove old and unused firmware helper scripts

Message ID 20211020130503.175575-1-juergh@canonical.com
State New
Headers show
Series [Unstable] UBUNTU: [Debian] Remove old and unused firmware helper scripts | expand

Commit Message

Juerg Haefliger Oct. 20, 2021, 1:05 p.m. UTC
There are scripts in the kernel tree that supposedly help with managing
firmware files/blobs but they haven't been used nor needed in ages so get
rid of them.

Signed-off-by: Juerg Haefliger <juergh@canonical.com>
---
 debian/scripts/misc/find-obsolete-firmware | 91 ----------------------
 debian/scripts/misc/get-firmware           | 62 ---------------
 2 files changed, 153 deletions(-)
 delete mode 100755 debian/scripts/misc/find-obsolete-firmware
 delete mode 100755 debian/scripts/misc/get-firmware

Comments

Tim Gardner Oct. 20, 2021, 2:48 p.m. UTC | #1
Acked-by: Tim Gardner <tim.gardner@canonical.com>

I kinda remember writing these scripts, but it was a long time ago.

On 10/20/21 7:05 AM, Juerg Haefliger wrote:
> There are scripts in the kernel tree that supposedly help with managing
> firmware files/blobs but they haven't been used nor needed in ages so get
> rid of them.
> 
> Signed-off-by: Juerg Haefliger <juergh@canonical.com>
> ---
>   debian/scripts/misc/find-obsolete-firmware | 91 ----------------------
>   debian/scripts/misc/get-firmware           | 62 ---------------
>   2 files changed, 153 deletions(-)
>   delete mode 100755 debian/scripts/misc/find-obsolete-firmware
>   delete mode 100755 debian/scripts/misc/get-firmware
> 
> diff --git a/debian/scripts/misc/find-obsolete-firmware b/debian/scripts/misc/find-obsolete-firmware
> deleted file mode 100755
> index 97a1f3074d21..000000000000
> --- a/debian/scripts/misc/find-obsolete-firmware
> +++ /dev/null
> @@ -1,91 +0,0 @@
> -#!/bin/bash
> -#
> -# Find all duplicate or obsolete firmware that is being carried
> -# in the kernel firmware directory. Compare these files against
> -# the linux-firmware package for the approriate release. For example,
> -# assuming this is raring, then compare the kernel firmware files
> -# against the raring branch of linux-firmware.
> -#
> -# Example: $0 ~/ubuntu/linux-firmware-raring
> -
> -USEAGE="$0 LINUX-FIRMWARE"
> -
> -. debian/debian.env
> -
> -NFWINFO="`find $DEBIAN -name fwinfo|wc -l`"
> -if [ ! "$NFWINFO" = "1" ]
> -then
> -	echo Your repo is hosed. There can only be one fwinfo file.
> -	find $DEBIAN -name fwinfo
> -	exit 1
> -fi
> -
> -FWINFO="`pwd`/`find $DEBIAN -name fwinfo`"
> -
> -if [ "$1" = "" ]
> -then
> -	echo $USEAGE
> -	exit 1
> -fi
> -FW="$1"
> -
> -if [ ! -f $FW/WHENCE ]
> -then
> -	echo Bogus linux-firmware directory
> -	exit 1
> -fi
> -if ! egrep -q "^firmware:" $FWINFO
> -then
> -	echo Bogus firmware info file
> -	exit 1
> -fi
> -
> -#
> -# Prepare the tree and make firmware.
> -#
> -TEE="tee -a"
> -LO=`pwd`/firmware.txt
> -LF=`pwd`/lib/firmware
> -rm -rf debian/build $LF $LO
> -fakeroot debian/rules clean prepare-generic
> -cp debian/build/build-generic/.config .
> -mkdir -p $LF
> -make firmware_install INSTALL_MOD_PATH=`pwd`
> -
> -(cd $LF
> -find . -type f | while read f
> -do
> -	BN="`basename $f`"
> -
> -	if ! grep -q $BN $FWINFO
> -	then
> -		echo "Unused firmware: $f" | $TEE $LO
> -	else
> -		if [ -f $FW/$f ]
> -		then
> -			if ! cmp $FW/$f $f
> -			then
> -				echo "$f differs" | $TEE $LO
> -			else
> -				echo "$f is duplicated" | $TEE $LO
> -			fi
> -		else
> -			echo "$f does not exist in $FW" | $TEE $LO
> -		fi
> -	fi
> -done)
> -
> -#
> -# Check for firmware files referenced by the kernel
> -# that do not exist in either location.
> -#
> -cat $FWINFO | while read fwi f
> -do
> -	if [ -s lib/firmware/$f ] || [ -s $FW/$f ]
> -	then
> -		continue
> -	else
> -		echo "Missing firmware $f" | $TEE $LO
> -	fi
> -done
> -
> diff --git a/debian/scripts/misc/get-firmware b/debian/scripts/misc/get-firmware
> deleted file mode 100755
> index b1ed8e68985c..000000000000
> --- a/debian/scripts/misc/get-firmware
> +++ /dev/null
> @@ -1,62 +0,0 @@
> -#!/bin/bash
> -#
> -# Find all files in linux-firmware that are new or different since the previous release
> -# and copy them into the kernel firmware directory. You should only do this on the
> -# backport branch since it would be redundant on the released kernel. It assumed you've
> -# unpacked linux-firmware from each release into separate directories.
> -#
> -# Example: $0 ~/ubuntu/linux-firmware-precise ~/ubuntu/linux-firmware-quantal
> -
> -if [ "$1" = "" ] || [ "$2" = "" ] || [ ! -f $1/WHENCE ] || [ ! -f $2/WHENCE ]
> -then
> -	echo You must supply 2 firmware directories.
> -	exit 1
> -fi
> -
> -if [ ! -f debian/debian.env ]
> -then
> -	echo You must run this script from the root of the repo
> -	exit 1
> -fi
> -. debian/debian.env
> -
> -NFWINFO="`find $DEBIAN -name fwinfo|wc -l`"
> -if [ ! "$NFWINFO" = "1" ]
> -then
> -	echo Your repo is hosed. There can only be one fwinfo file.
> -	find $DEBIAN -name fwinfo
> -	exit 1
> -fi
> -
> -FWINFO="`pwd`/`find $DEBIAN -name fwinfo`"
> -
> -CDIR=`pwd`
> -OFW=$1
> -NFW=$2
> -
> -cd $NFW
> -#
> -# Find all files in $NFW that are new or different from $1
> -#
> -(find . -type f | egrep -v "debian|git|LICEN|WHEN|READ|Make|configure" | sed 's;\./;;' | \
> -while read f
> -do
> -	if grep -q $f $FWINFO
> -	then
> -		if [ ! -f $OFW/$f ]
> -		then
> -			echo $f
> -		elif ! cmp $f $OFW/$f > /dev/null
> -		then
> -			echo $f
> -		fi
> -	fi
> -done) |\
> -while read f
> -do
> -	mkdir -p $CDIR/firmware/`dirname $f`
> -	if [ ! -f $CDIR/firmware/`dirname $f`/`basename $f`.ihex ]
> -	then
> -		cp -v $f $CDIR/firmware/`dirname $f`
> -	fi
> -done
>
Andrea Righi Oct. 26, 2021, 11:03 a.m. UTC | #2
On Wed, Oct 20, 2021 at 03:05:03PM +0200, Juerg Haefliger wrote:
> There are scripts in the kernel tree that supposedly help with managing
> firmware files/blobs but they haven't been used nor needed in ages so get
> rid of them.
> 
> Signed-off-by: Juerg Haefliger <juergh@canonical.com>
> ---

Applied to unstable/5.15.

Thanks,
-Andrea
diff mbox series

Patch

diff --git a/debian/scripts/misc/find-obsolete-firmware b/debian/scripts/misc/find-obsolete-firmware
deleted file mode 100755
index 97a1f3074d21..000000000000
--- a/debian/scripts/misc/find-obsolete-firmware
+++ /dev/null
@@ -1,91 +0,0 @@ 
-#!/bin/bash
-#
-# Find all duplicate or obsolete firmware that is being carried
-# in the kernel firmware directory. Compare these files against
-# the linux-firmware package for the approriate release. For example,
-# assuming this is raring, then compare the kernel firmware files
-# against the raring branch of linux-firmware.
-#
-# Example: $0 ~/ubuntu/linux-firmware-raring
-
-USEAGE="$0 LINUX-FIRMWARE"
-
-. debian/debian.env
-
-NFWINFO="`find $DEBIAN -name fwinfo|wc -l`"
-if [ ! "$NFWINFO" = "1" ]
-then
-	echo Your repo is hosed. There can only be one fwinfo file.
-	find $DEBIAN -name fwinfo
-	exit 1
-fi
-
-FWINFO="`pwd`/`find $DEBIAN -name fwinfo`"
-
-if [ "$1" = "" ]
-then
-	echo $USEAGE
-	exit 1
-fi
-FW="$1"
-
-if [ ! -f $FW/WHENCE ]
-then
-	echo Bogus linux-firmware directory
-	exit 1
-fi
-if ! egrep -q "^firmware:" $FWINFO
-then
-	echo Bogus firmware info file
-	exit 1
-fi
-
-#
-# Prepare the tree and make firmware.
-#
-TEE="tee -a"
-LO=`pwd`/firmware.txt
-LF=`pwd`/lib/firmware
-rm -rf debian/build $LF $LO
-fakeroot debian/rules clean prepare-generic
-cp debian/build/build-generic/.config .
-mkdir -p $LF
-make firmware_install INSTALL_MOD_PATH=`pwd`
-
-(cd $LF
-find . -type f | while read f
-do
-	BN="`basename $f`"
-
-	if ! grep -q $BN $FWINFO
-	then
-		echo "Unused firmware: $f" | $TEE $LO
-	else
-		if [ -f $FW/$f ]
-		then
-			if ! cmp $FW/$f $f
-			then
-				echo "$f differs" | $TEE $LO
-			else
-				echo "$f is duplicated" | $TEE $LO
-			fi
-		else
-			echo "$f does not exist in $FW" | $TEE $LO
-		fi
-	fi
-done)
-
-#
-# Check for firmware files referenced by the kernel
-# that do not exist in either location.
-#
-cat $FWINFO | while read fwi f
-do
-	if [ -s lib/firmware/$f ] || [ -s $FW/$f ]
-	then
-		continue
-	else
-		echo "Missing firmware $f" | $TEE $LO
-	fi
-done
-
diff --git a/debian/scripts/misc/get-firmware b/debian/scripts/misc/get-firmware
deleted file mode 100755
index b1ed8e68985c..000000000000
--- a/debian/scripts/misc/get-firmware
+++ /dev/null
@@ -1,62 +0,0 @@ 
-#!/bin/bash
-#
-# Find all files in linux-firmware that are new or different since the previous release
-# and copy them into the kernel firmware directory. You should only do this on the
-# backport branch since it would be redundant on the released kernel. It assumed you've
-# unpacked linux-firmware from each release into separate directories.
-#
-# Example: $0 ~/ubuntu/linux-firmware-precise ~/ubuntu/linux-firmware-quantal
-
-if [ "$1" = "" ] || [ "$2" = "" ] || [ ! -f $1/WHENCE ] || [ ! -f $2/WHENCE ]
-then
-	echo You must supply 2 firmware directories.
-	exit 1
-fi
-
-if [ ! -f debian/debian.env ]
-then
-	echo You must run this script from the root of the repo
-	exit 1
-fi
-. debian/debian.env
-
-NFWINFO="`find $DEBIAN -name fwinfo|wc -l`"
-if [ ! "$NFWINFO" = "1" ]
-then
-	echo Your repo is hosed. There can only be one fwinfo file.
-	find $DEBIAN -name fwinfo
-	exit 1
-fi
-
-FWINFO="`pwd`/`find $DEBIAN -name fwinfo`"
-
-CDIR=`pwd`
-OFW=$1
-NFW=$2
-
-cd $NFW
-#
-# Find all files in $NFW that are new or different from $1
-#
-(find . -type f | egrep -v "debian|git|LICEN|WHEN|READ|Make|configure" | sed 's;\./;;' | \
-while read f
-do
-	if grep -q $f $FWINFO
-	then
-		if [ ! -f $OFW/$f ]
-		then
-			echo $f
-		elif ! cmp $f $OFW/$f > /dev/null
-		then
-			echo $f
-		fi
-	fi
-done) |\
-while read f
-do
-	mkdir -p $CDIR/firmware/`dirname $f`
-	if [ ! -f $CDIR/firmware/`dirname $f`/`basename $f`.ihex ]
-	then
-		cp -v $f $CDIR/firmware/`dirname $f`
-	fi
-done