do kernels have left over conf files (that's a real question)?tony37 wrote: Mon Nov 09, 2020 2:49 pm "dpkg-query --status" also gives output for packages with remaining configuration files:Code: Select all
Status: deinstall ok config-files
rebuild_dkms_packages.sh script fails
- dolphin_oracle
- Developer
- Posts: 22657
- Joined: Sun Dec 16, 2007 12:17 pm
Re: rebuild_dkms_packages.sh script fails
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
Re: rebuild_dkms_packages.sh script fails
Of course, I have linux-image-4.19.0-11-amd64 there
(easy command to search for such packages: aptitude search '~c')
(easy command to search for such packages: aptitude search '~c')
- dolphin_oracle
- Developer
- Posts: 22657
- Joined: Sun Dec 16, 2007 12:17 pm
Re: rebuild_dkms_packages.sh script fails
ok, then we will go full on fool-proof
Code: Select all
#!/bin/bash
#force rebuild of dkms packages (virtualbox, nvidia, fglrx, broadcom, ndiswrapper)
#part of mx-packageinstaller
kernel="$1"
# if parameter passed, then check to see if package is installed, exit if not
if [ -n "$kernel" ]; then
[[ ! $(LANG=C dpkg-query --status $1 |grep "install ok installed" ) ]] || exit 0
fi
#if no kernel parameter given, assume current kernel
if [ -z "$kernel" ]; then
kernel="$(uname -r)"
fi
kernel=${kernel#"linux-image-"}
kernel=${kernel%-unsigned}
echo "update dkms modules for kernel: " $kernel |tee /var/log/rebuild-dkms.log
echo "see log at /var/log/rebuild-dkms.log"
/usr/lib/dkms/dkms_autoinstaller start $kernel |tee -a /var/log/rebuild-dkms.log
exit 0
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
Re: rebuild_dkms_packages.sh script fails
Maybe still a mistake, I think it exits if the package is installed and not the reverse
If you leave out the ! it works better:
But with a package not installed and also with no config files remaining, I get this message:
edit: The right solution is of course combining the two conditions:
If you leave out the ! it works better:
Code: Select all
[[ $(LANG=C dpkg-query --status $1 |grep "install ok installed" ) ]] || exit 0
Code: Select all
dpkg-query: package 'linux-image-4.19.0-10-amd64' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files.
Code: Select all
#!/bin/bash
#force rebuild of dkms packages (virtualbox, nvidia, fglrx, broadcom, ndiswrapper)
#part of mx-packageinstaller
kernel="$1"
# if parameter passed, then check to see if package is installed, exit if not
if [ -n "$kernel" ]; then
[[ $(dpkg-query --status $1 2>/dev/null ) ]] || exit 0
[[ $(LANG=C dpkg-query --status $1 |grep "install ok installed" ) ]] || exit 0
fi
#if no kernel parameter given, assume current kernel
if [ -z "$kernel" ]; then
kernel="$(uname -r)"
fi
kernel=${kernel#"linux-image-"}
kernel=${kernel%-unsigned}
echo "update dkms modules for kernel: " $kernel |tee /var/log/rebuild-dkms.log
echo "see log at /var/log/rebuild-dkms.log"
/usr/lib/dkms/dkms_autoinstaller start $kernel |tee -a /var/log/rebuild-dkms.log
exit 0
Last edited by tony37 on Mon Nov 09, 2020 4:02 pm, edited 1 time in total.
Re: rebuild_dkms_packages.sh script fails
in case you can still use this, an easy way to find the dependency of the installed linux-image-amd64 package:
Code: Select all
dpkg-query -W -f='${Depends}\n' linux-image-amd64
- dolphin_oracle
- Developer
- Posts: 22657
- Joined: Sun Dec 16, 2007 12:17 pm
Re: rebuild_dkms_packages.sh script fails
I used similar in the kernel pm files.tony37 wrote: Mon Nov 09, 2020 3:41 pm in case you can still use this, an easy way to find the dependency of the installed linux-image-amd64 package:Code: Select all
dpkg-query -W -f='${Depends}\n' linux-image-amd64
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
- dolphin_oracle
- Developer
- Posts: 22657
- Joined: Sun Dec 16, 2007 12:17 pm
Re: rebuild_dkms_packages.sh script fails
I don't want it it exit if the package is installed. I want it to exit if the package is NOT installed, so that nothing happens if the build fails.
I'll make sure to test it when I'm back at my linux box.
I'll make sure to test it when I'm back at my linux box.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
Re: rebuild_dkms_packages.sh script fails
this works to check if the package is installed or not:
Code: Select all
if [ -n "$kernel" ]; then
[[ $(grep -A1 $1 /var/lib/dpkg/status | grep 'install ok installed' ) ]] || exit 0
fi
- dolphin_oracle
- Developer
- Posts: 22657
- Joined: Sun Dec 16, 2007 12:17 pm
Re: rebuild_dkms_packages.sh script fails
used your test, and got rid of hte !
Code: Select all
#!/bin/bash
#force rebuild of dkms packages (virtualbox, nvidia, fglrx, broadcom, ndiswrapper)
#part of mx-packageinstaller
kernel="$1"
# if parameter passed, then check to see if package is installed, exit if not
if [ -n "$kernel" ]; then
[[ -n $(grep -A1 $kernel /var/lib/dpkg/status | grep 'install ok installed' ) ]] || exit 0
fi
#if no kernel parameter given, assume current kernel
if [ -z "$kernel" ]; then
kernel="$(uname -r)"
fi
kernel=${kernel#"linux-image-"}
kernel=${kernel%-unsigned}
echo "update dkms modules for kernel: " $kernel |tee /var/log/rebuild-dkms.log
echo "see log at /var/log/rebuild-dkms.log"
#/usr/lib/dkms/dkms_autoinstaller start $kernel |tee -a /var/log/rebuild-dkms.log
exit 0
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.
Live system help document: https://mxlinux.org/wiki/help-antix-live-usb-system/
Re: rebuild_dkms_packages.sh script fails
I'm sorry to say, but you have
in kernel_debian_64.pm (and similar in kernel_debian_32.pm) and it should have been
:lipsrsealed:
edit: the deb file also has a folder /share/mx-packageinstaller-pkglist (without /usr)...
Code: Select all
file=$(apt-cache show linux-image-amd64=4.19 |grep -m1 Depends)
Code: Select all
file=$(apt-cache show linux-image-amd64=4.19* |grep -m1 Depends)
edit: the deb file also has a folder /share/mx-packageinstaller-pkglist (without /usr)...