Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
e0b17cf2
Commit
e0b17cf2
authored
Nov 16, 2012
by
Tim Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UBUNTU: [debian] script to detect obsolete firmware
Signed-off-by:
Tim Gardner
<
tim.gardner@canonical.com
>
parent
23b893cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
0 deletions
+92
-0
debian/scripts/misc/find-obsolete-firmware
debian/scripts/misc/find-obsolete-firmware
+92
-0
No files found.
debian/scripts/misc/find-obsolete-firmware
0 → 100755
View file @
e0b17cf2
#!/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
[
!
-f
$f
]
then
if
[
!
-f
$FW
/
$f
]
then
echo
"Missing firmware
$f
"
|
$TEE
$LO
fi
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment