git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git cd linux-stable git checkout v6.15.4 cp /boot/config-$(uname -r) arch/x86/configs/my_defconfig make my_defconfig make localmodconfig make localyesconfig make -j 12 make install
Sunday, July 6. 2025
Another Take on Building a 'recent' Kernel
Saturday, June 28. 2025
Bisect Linux Example
From an email list:
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git cd linux cat /proc/config.gz > .config yes '' | make oldconfig make localmodconfig make savedefconfig cp defconfig arch/x86/configs/test_defconfig git bisect start v6.11 v6.6
Then iterate:
make test_defconfig make make install
Test the newly installed kernel. Depending on the kernel having the problem or not run:
git bisect good
or
git bisect bad
Repeat until git identifed the problematic commit.
Note: Make sure to pick the right kernel to boot, it's not always the one with the highest version number. After a test you can remove the installed kernel at any time (and you probably want that to not run out of disk space).
Sunday, March 23. 2025
Intel Wireless BE200 Firmware Installation
I picked up an Intel Z890 chipset based Asus ProArt Z890-CREATOR WIFI motherboard. It has a relatively new Wifi card:
# lspci |grep -i wi-fi 85:00.0 Network controller: Intel Corporation Wi-Fi 7(802.11be) AX1775*/AX1790*/BE20*/BE401/BE1750* 2x2 (rev 1a)
With the Trixie based install, Bluetooth mice have a few problems with connecting and maintaining connection. Maybe these dmesg fail messages might point to a solution:
[ 2.806746] iwlwifi 0000:85:00.0: firmware: failed to load iwlwifi-gl-c0-fm-c0-93.ucode (-2) [ 2.806750] iwlwifi 0000:85:00.0: firmware: failed to load iwlwifi-gl-c0-fm-c0-93.ucode (-2) [ 2.806751] iwlwifi 0000:85:00.0: Direct firmware load for iwlwifi-gl-c0-fm-c0-93.ucode failed with error -2 [ 2.811678] iwlwifi 0000:85:00.0: firmware: failed to load iwl-debug-yoyo.bin (-2) [ 2.811681] iwlwifi 0000:85:00.0: firmware: failed to load iwl-debug-yoyo.bin (-2)
Linux Wireless Documentation suggests an updated firmware package from linux-firmware.git, and then an installation with:
# cp iwlwifi-*.{ucode,pnvm} /lib/firmware/
The following may be required to load the firmware during boot:
# update-initramfs -u -k all
I also upgraded the kernel from 6.12.6 to 6.12.19
/debian/pool/non-free-firmware/f/firmware-nonfree has latest packaged firmware, which may not be as recent as the git repository.
I used this to attempt to load a more recent firmware, but the kernel module seems to be limiting it to v92, and v93 is not available, for some reason. I hope the 6.13.8 series kernel, when it comes out of experimental might alleviate that.
# ln -s /lib/firmware/iwlwifi-gl-c0-fm-c0-96.ucode /lib/firmware/iwlwifi-gl-c0-fm-c0-93.ucode
Intel Wireless WiFi Link, Wireless-N, Advanced-N, Ultimate-N devices - iwlwifi mentions:
You may try to switch power management scheme from balanced (default) into active by adding the following to /etc/modprobe.d/iwlmvm.conf and reboot:options iwlmvm power_scheme=1
The following command will identify the firmware files for which a driver is looking. In this case, the driver looks for -93, but it isn't in the firmware files:
# modinfo iwlwifi |grep firmware ... firmware: iwlwifi-gl-c0-fm-c0.pnvm firmware: iwlwifi-gl-c0-fm-c0-93.ucode ... parm: fw_restart:restart firmware in case of error (default true) (bool)
Additional references:
Sunday, August 18. 2024
Debian Linux Grub initrd recovery
During the early days of Debian Linux, one could get away with a 100mb boot partition. With the explosion of included firmware files in the initramfs file, the boot directory needs to be 500mb or even 1gb in size. I have a couple older machines I have not yet rebuilt, which have limited size. I resort to copying various initrd.img files in and out as I upgrade kernels or boot into older versions of the kernel.
Sometimes I have forgotten to properly copy an image back into /boot and run update-grub. When I do that, I have to boot into grub and run the grub command line. Some commands that I run are as follows:
Set a variable so when requesting help, you can page through entries:
grub> set pager=1
List the various mount points:
grub> ls
List the files in a particular mount point
grub> ls (hd0,msdos2)/root
Startup commands, depending upon where linux and initrd files are found:
grub> set root=(hd0,msdos2) grub> linux (hd0,msdos1)/vmlinux-6.1.0-15-amd64 root=LABEL=main grub> initrd (hd0,msdos2)/root/initramfs/initrd.img-6.1.0-15-amd64 grub> boot
Sunday, July 21. 2024
Copy ISO Image to USB
# dd if=Downloads/iso/debian-testing-amd64-netinst.iso of=/dev/sda bs=1M status=progress conv=fdatasync
'fdatasync' is equivalent to running 'sync' as a second command
watch kern.log to determine on which drive the USB is mounted when inserted
ensure that the USB is not auto-mounted by any other application or service
Sunday, May 26. 2024
Useful Debian Packaging Query
$ ucfq /etc/ssh/sshd_config Configuration file Package Exists Changed /etc/ssh/sshd_config openssh-server Yes No
Wednesday, July 19. 2023
SaltStack on Debian Bookworm
I found out the hard way that SaltStack and Debian no longer place nice together. I had upgraded a Debian installation from Bullseye to Bookworm, along with the resident Salt Minion. When attempting to use the minion, it no longer starts up, due to various imports no longer working. Which was due to the salt-minion not being upgraded. The error message would started this odyssey:
salt ImportError: cannot import name 'Markup' from 'jinja2'
Taking a look at the Debian Developer Information for Salt, the last version started in 'unstable' was 3004.1 back in December of 2022. This is now almost 8 months later and little or no movement. There was some mention in a ticket somewhere that Salt release cycles don't cater to Debian stable release cycles. Not sure if that is a legitimate reason or not, but, well, for whatever reason, SaltStack management in Debian is no longer a simple no brainer.
However, after a little digging, there is a way to run SaltStack versions 3006 (current as of this writing). It is simple to install on Bullseye, but not easily done on Bookworm.
On Bullseye (as root, or implies sudo):
# cd ~ # apt remove salt-minion salt-master # apt install curl # curl -L https://bootstrap.saltstack.com -o install_salt.sh # sh install_salt.sh -M onedir
The '-M' installs the salt master at the same time (for machines running master). If you forget to do that, you'll need to diagnose and fix the systemctl mask error with the following:
# apt install file # file /etc/systemd/system/salt-master.service # rm /etc/systemd/system/salt-master.service # systemctl daemon-reload # sh install_salt.sh -M onedir
The 'sh install_salt.sh -M onedir' should show a symlink to /dev/nul, which the 'rm ...' will fix.
On Bookworm, the bootstrap isn't scheduled to work till beginning of 2024 sometime I think with Salt 3007 or 3008 -- more info in [FEATURE REQUEST] Add Salt support for Debian 12 #64223 .
In the meantime, I had to cheat a bit:
- in /etc/debian_version, change 12.0 to 11.0
- in /etc/apt/sources.list, change bookworm to bullseye
- rm /etc/apt/sources.list.d/salt.list
- run apt update
- run the commands listed above for installing the one or both the salt services
- restore /etc/debian_version and /etc/apt/sources.list to their original content
I'm sure there are more elegant ways of doing this, but this worked to fake the needed version 11 in the installation script and directory traversal requirements
Note, more info on the Salt Install/Bootstrap Process.
Sunday, May 14. 2023
dd with ongoing commit
From a debian-boot mailing list:
A couple more options may help: it's sometimes possible that you've extracted the USB stick while files were still writing.
sudo dd \ if=/debian-11.7.0-amd64-netinst.iso \ of=/dev/sda \ bs=1M oflag=dsync status=progressThis forces a sync on each write to the usb so you don't lose data and also gives you a brief status output on the size written.
Saturday, April 9. 2022
Building Kernel for Debian
- download kernel 5.17 source tar.gz file from kernel.org
- Unpack the source and apply the patch with cd linux; patch -p1 < patch_file
- Run "make localmodconfig"
- Compile (run "make")
- Install: sudo make modules_install install
- reboot and choose the new kernel in grub
Saturday, May 8. 2021
Package vital stats via dpkg
# dpkg -s sc Package: sc Status: install ok installed Priority: optional Section: math Installed-Size: 440 Maintainer: Adam MajerArchitecture: amd64 Source: sc (7.16-4) Version: 7.16-4+b3 Depends: libc6 (>= 2.14), libncurses6 (>= 6), libtinfo6 (>= 6) Description: Text-based spreadsheet with VI-like keybindings "Spreadsheet Calculator" is a much modified version of the public- domain spread sheet sc, which was posted to Usenet several years ago by Mark Weiser as vc, originally by James Gosling. It is based on rectangular table much like a financial spreadsheet. . Its keybindings are familiar to users of 'vi', and it has most features that a pure spreadsheet would, but lacks things like graphing and saving in foreign formats. It's very stable and quite easy to use once you've put a little effort into learning it.
Debian Versioning
# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux bullseye/sid Release: testing Codename: bullseye
Thursday, May 6. 2021
Unable to open MTP device "001,104"
When attaching an Android device to a Linux machine, you may see a popup with the message:
Unable to open MTP device "001,104"
The numbers may vary depending upon device and port:
# tail -f /var/log/kern.log May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.564694] usb 1-1: new high-speed USB device number 105 using xhci_hcd May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714863] usb 1-1: New USB device found, idVendor=18d1, idProduct=4ee1, bcdDevice= 2.23 May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714865] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714866] usb 1-1: Product: Nexus 6 May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714867] usb 1-1: Manufacturer: motorola May 5 22:53:51 nuc8i7hvk01 kernel: [3205901.714868] usb 1-1: SerialNumber: ZX1G22MGK2
Further diagnostics generate:
# mtp-detect libmtp version: 1.1.17 Listing raw device(s) No raw devices found. root@nuc8i7hvk01:/home/rpb# mtp-detect libmtp version: 1.1.17 Listing raw device(s) Device 0 (VID=18d1 and PID=4ee1) is a Google Inc Nexus/Pixel (MTP). Found 1 device(s): Google Inc: Nexus/Pixel (MTP) (18d1:4ee1) @ bus 1, dev 103 Attempting to connect device(s) error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device Unable to open raw device 0 OK.
On my system, the culprit is the gvfs filesystem packages:
# dpkg -l |grep gvfs ii gvfs:amd64 1.46.2-1 amd64 userspace virtual filesystem - GIO module ii gvfs-backends 1.46.2-1 amd64 userspace virtual filesystem - backends ii gvfs-common 1.46.2-1 all userspace virtual filesystem - common data files ii gvfs-daemons 1.46.2-1 amd64 userspace virtual filesystem - servers ii gvfs-fuse 1.46.2-1 amd64 userspace virtual filesystem - fuse server ii gvfs-libs:amd64 1.46.2-1 amd64 userspace virtual filesystem - private libraries # systemctl |grep gvfs run-user-1000-gvfs.mount loaded active mounted /run/user/1000/gvfs # ps aux |grep gvfs rpb 1886 0.0 0.0 241436 4036 ? Ssl Mar29 0:00 /usr/libexec/gvfsd rpb 1891 0.0 0.0 753756 3364 ? Sl Mar29 0:26 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f rpb 2009 0.0 0.0 501008 4632 ? Ssl Mar29 0:00 /usr/libexec/gvfs-udisks2-volume-monitor rpb 2041 0.0 0.0 237900 4828 ? Ssl Mar29 0:00 /usr/libexec/gvfs-mtp-volume-monitor rpb 2061 0.0 0.0 239776 3052 ? Ssl Mar29 0:00 /usr/libexec/gvfs-gphoto2-volume-monitor rpb 2069 0.0 0.0 237500 3052 ? Ssl Mar29 0:00 /usr/libexec/gvfs-goa-volume-monitor rpb 2073 0.0 0.0 315992 3160 ? Ssl Mar29 0:41 /usr/libexec/gvfs-afc-volume-monitor rpb 2135 0.0 0.0 391244 6824 ? Sl Mar29 0:02 /usr/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gvfs/exec_spaw/0 rpb 178920 0.0 0.0 315892 3956 ? Sl Mar30 0:01 /usr/libexec/gvfsd-network --spawner :1.8 /org/gtk/gvfs/exec_spaw/1 rpb 178946 0.0 0.0 317528 3172 ? Sl Mar30 0:01 /usr/libexec/gvfsd-dnssd --spawner :1.8 /org/gtk/gvfs/exec_spaw/3 rpb 179014 0.0 0.0 206540 5372 ? Ssl Mar30 1:29 /usr/libexec/gvfsd-metadata
The file browser known as pcmanfs does not seem to be able to access the filesystem
Solution: Dolphin, as a substitute for Nautilus, can be used to access the virtual filesystems.
The command gio can be used to access the file system:
# gio Usage: gio COMMAND [ARGS…] Commands: help Print help version Print version cat Concatenate files to standard output copy Copy one or more files info Show information about locations list List the contents of locations mime Get or set the handler for a mimetype mkdir Create directories monitor Monitor files and directories for changes mount Mount or unmount the locations move Move one or more files open Open files with the default application rename Rename a file remove Delete one or more files save Read from standard input and save set Set a file attribute trash Move files or directories to the trash tree Lists the contents of locations in a tree Use “gio help COMMAND” to get detailed help.
Background info via Wikipedia, which comes with a set of back-ends, including trash support, SFTP, FTP, WebDAV, SMB, and local data via Udev integration, OBEX, MTP and others.
- Don't know why this has to be so difficult on Debian, why all the competing applications which lock each other out?
- Remember: on Android, once connected, select transfer files
- May need to open a new dolphin window to actually get at the files
- And then in Dolphin, the actual right-click/copy/paste doesn't actually work -- need to load a file and then save it.... just painful .. I hope other's experience is less painful ... maybe I have to rebuild my machine
Tuesday, April 6. 2021
Debian Boot Links
- DebianInstaller - wiki starting point for many things installer
- Debian Installer Internals - introduction to the inner workings of the installer when it is running, its components (udebs) and its build system.
- Debian GNU/Linux Installation Guide - installation instructions for the Debian GNU/Linux system for the 64-bit PC (“amd64”) architecture. It also contains pointers to more information and information on how to make the most of your new Debian system.
- Netboot Assistant - provides a tool to simplify the preparation of files for TFTP net booting
- UEFI - describe UEFI for Debian purposes: what's supported in Debian and how to use it, plus some troubleshooting tips.
- Installing Debian using network booting - describes installing a new Debian system with no CD, DVD, USB at all. By the end of the installation process, the new machine is able to run without the support of the server. During the installation, you will need a network boot server.
Monday, January 18. 2021
Grub Notes
When in the grub prompt, these two commands provide good situational awareness:
- run the 'set' command to see what the current boot and network variables are.
- run the 'ls' command to see what devices and partitions are available
Then something like 'ls (hd0,gpt1)/boot' can show files in that partition
When running manual boot operations in the grub menu on a Dell Wyse 3040, something along the lines of the following might be used:
grub> linux (hd0,gpt2)/vmliunz root=/dev/mmcblk0p2 ro grub> initrd (hd0,gpt2)/initrd.img grub> boot
At Grub not loading config file or booting into linux automatically shows the trick of starting the grub menu:
grub> configfile (hd0,gpt4)/boot/grub/grub.cfg
Saturday, December 19. 2020
Debian Debugging During Install
Is it possible to shift+page-up to reveal the backtrace? The backtrace section ends with "---[ end trace 75435… ]---" If that's not possible, see if you can get a copy from /var/log after rebooting with a working kernel or when using a network disk. If that's not possible, and you have good reflexes, you could try ctr+s or scroll-lock to pause the kernel output at just the right moment, but it's probably easier to just set up remote logs: