I'm trying to do the following:
1) add the smi2021 driver for EasyCap Somagic usb frame grabbers into the
2) compile the kernel with smi2021 as a module
3) build the rpm.
I got the driver from Jon Arne Jorgensen's kernel branch on github:
then tried to follow these instructions:
but the whole thing fails with this eror:
+ case "$patch" in
+ patch -p1 -F1 -s
+ chmod +x scripts/checkpatch.pl
+ touch .scmversion
+ mkdir configs
+ for i in '*.config'
+ mv kernel-3.17.8-aarch64.config .config
++ head -1 .config
++ cut -b 3-
+ make ARCH=arm64 listnewconfig
+ grep -E '^CONFIG_'
+ '[' -s .newoptions ']'
+ cat .newoptions
+ exit 1
error: Bad exit status from /var/tmp/rpm-tmp.sASN4F (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.sASN4F (%prep)
So I spent a lot of time trying to figure this out and I know why it happens
but I don't know how to fix it.
The smi2021.patch being applied above is the diff between the kernel trees
with and without the driver. The patch succeeds. The problem is that in
order to have the module compiled I did make oldconfig and so I ended up with
in the kernel-3.17.8-x86_64 **ONLY**. Then the kernel.spec has some code
that runs oldconfig over **ALL** the kernel*.config files:
for i in *.config
mv $i .config
Arch=`head -1 .config | cut -b 3-`
make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
if [ -s .newoptions ]; then
rm -f .newoptions
make ARCH=$Arch oldnoconfig
echo "# $Arch" > configs/$i
cat .config >> configs/$i
# end of kernel config
Of course, none of the other config files (for other architectures then
x86_64) have the CONFIG_VIDEO_SMI2021 options, hence the error.
So the key question is what is the proper way to add a new driver to the
kernel tree and run
rpmbuild -bb --target=$(uname -m) kernel.spec
on it? Do I put CONFIG=VIDEO_SMI2021=m in SOURCES/config-local, or what?
For what it's worth, I am able to do
make oldconfig # picks up the option for the new driver
in the kernel tree with the new code in it and it goes through without errors.
So if I want to run the new kernel with the new driver, I can, but I'd rather
do this by building the custom rpm, as I don't know when or if this driver
will be included in the vanilla kernel.
Please help, I'm at the end of my wits. Thanks!