Results 1 to 4 of 4

Thread: How can I insert a file into the initramfs?

  1. #1

    Default How can I insert a file into the initramfs?

    The title is the question itself, but let me explain here in more detail what I'm trying to do.

    This is actually a step of a bigger problem I'm trying to solve:

    Quote Originally Posted by vinyanalista View Post
    I have an Acer Aspire E15 laptop (model number E5-573-54ZV) that came with Windows 10 and a built-in Bluetooth 4.0 adapter. While using Windows, I'm able to use the Bluetooth adapter.

    I've installed openSUSE Leap 42.2 in dual boot. While using openSUSE, the Bluetooth adapter is the only piece of hardware that does not work. It seems like it is not even detected.

    A report made using AIDA64 for Windows shows:

    Code:
    04CA 3014    Qualcomm Atheros Bluetooth 4.0
    It appears in the USB devices section, so it is attached to the USB bus.

    Someone made it work on Linux Mint: https://forums.linuxmint.com/viewtopic.php?t=217091

    How can I make that Bluetooth adapter work on openSUSE?
    What I've got so far:

    Quote Originally Posted by vinyanalista View Post
    Now, I realized this:

    Code:
    # dmesg | grep 04ca
    [    6.135872] usb 1-5: New USB device found, idVendor=04ca, idProduct=3014
    The system somehow recognizes my Bluetooth adapter. Why it is not set up?
    Quote Originally Posted by vinyanalista View Post
    See those lines?

    Code:
    # dmesg | grep 'usb 1-5'
    [    6.006708] usb 1-5: new full-speed USB device number 3 using xhci_hcd
    [    6.135872] usb 1-5: New USB device found, idVendor=04ca, idProduct=3014
    [    6.135875] usb 1-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [   18.318545] usb 1-5: USB disconnect, device number 3
    What does dmesg mean by found and then disconnect???
    Quote Originally Posted by vinyanalista View Post
    I thought: maybe the kernel finds the device, does not know how to handle it and then disconnect it. So, I decided to try to load the btusb and ath3k kernel modules earlier, right at boot time, using initramfs. I followed the instructions here:

    Booting a Linux System | Reference | openSUSE Leap 42.2

    Code:
    # echo 'force_drivers+="ath3k btusb"' > /etc/dracut.conf.d/01-bluetooth.conf
    # dracut -f
    # reboot
    Indeed, something has changed, new messages appeared in dmesg:

    Code:
    # dmesg | egrep 'ath|wifi|hal'
    [    5.309618] device-mapper: multipath: version 1.11.0 loaded
    [    6.311336] ath3k: probe of 1-5:1.0 failed with error -2
    [    6.311352] usbcore: registered new interface driver ath3k
    [   19.969812] ath: phy0: WB335 2-ANT card detected
    [   19.969814] ath: phy0: Set BT/WLAN RX diversity capability
    [   19.976484] ath: phy0: Enable LNA combining
    [   19.977581] ath: phy0: ASPM enabled: 0x42
    [   19.977582] ath: EEPROM regdomain: 0x6c
    [   19.977582] ath: EEPROM indicates we should expect a direct regpair map
    [   19.977583] ath: Country alpha2 being used: 00
    [   19.977584] ath: Regpair used: 0x6c
    Code:
    # dmesg | egrep -i 'bluetooth|firm'
    [    0.206528] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
    [    6.309932] Bluetooth: Core ver 2.21
    [    6.309947] Bluetooth: HCI device and connection manager initialized
    [    6.309950] Bluetooth: HCI socket layer initialized
    [    6.309952] Bluetooth: L2CAP socket layer initialized
    [    6.309959] Bluetooth: SCO socket layer initialized
    [    6.311331] usb 1-5: Direct firmware load for ar3k/AthrBT_0x31010100.dfu failed with error -2
    [    6.311332] Bluetooth: Patch file not found ar3k/AthrBT_0x31010100.dfu
    [    6.311333] Bluetooth: Loading patch file failed
    [   84.128995] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [   84.128997] Bluetooth: BNEP filters: protocol multicast
    [   84.129002] Bluetooth: BNEP socket layer initialized
    Code:
    # uname -a
    Linux viny-notebook 4.4.70-18.9-default #1 SMP Wed May 31 09:09:25 UTC 2017 (c1231a7) x86_64 x86_64 x86_64 GNU/Linux
    That is kernel 4.4.70 from the openSUSE Leap 42.2 Update repo, I'm going to try kernel 4.11.4 from the Kernel:stable OBS repo.
    Right now, I'm using openSUSE Leap 42.2 with that kernel:

    Code:
    # uname -a
    Linux viny-notebook 4.11.4-1.gcba98ee-default #1 SMP PREEMPT Wed Jun 7 15:14:28 UTC 2017 (cba98ee) x86_64 x86_64 x86_64 GNU/Linux
    With the kernel 4.11.4, those same messages appear. It seems the ath3k kernel module is trying to load the file AthrBT_0x31010100.dfu during boot time. It is located at /lib/firmware/ar3k/, I think it is part of the kernel-firmware package, which I also downloaded from the Kernel:stable OBS repo. As the kernel module does not find that file, it gives that error message in dmesg.

    So, back to the title/question: how can I insert the file AthrBT_0x31010100.dfu into initramfs?

    I decided to make that specific question in an specific forum (Install/Boot/Login) because everything I found on Google was meant to other distros and does not work on openSUSE. So maybe we can make this post a reference.

    Thank you in advance!

  2. #2
    Join Date
    Sep 2012
    Posts
    4,917

    Default Re: How can I insert a file into the initramfs?

    man dracut.conf, search for "install_items" and similar.

  3. #3

    Default Re: How can I insert a file into the initramfs?

    Thank you! You got right to the point!

    Code:
    $ man dracut.conf
    
    ...
    
           install_items+=" <file>[ <file> ...] "
               Specify additional files to include in the initramfs, separated by spaces.
    
    ...
    
    # nano /etc/dracut.conf.d/01-bluetooth.conf
    
    force_drivers+="ath3k btusb"
    install_items+="/lib/firmware/ar3k/AthrBT_0x31010100.dfu /lib/firmware/ar3k/ramps_0x31010100_40.dfu"
    
    # reboot
    Actually, I started adding the first file. Then, looking at dmesg, it complained about the second. So, I added the second.

    Now, it does not complain about missing files anymore, and it seems my Bluetooth adapter is correctly identified:

    Code:
    # dmesg | egrep -i 'ath|bluetooth|firm|hal|usb|wifi'
    [    0.507083] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
    [    2.637889] ACPI: bus type USB registered
    [    2.639206] usbcore: registered new interface driver usbfs
    [    2.640424] usbcore: registered new interface driver hub
    [    2.641676] usbcore: registered new device driver usb
    [    2.643414] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    2.647881] ehci-pci 0000:00:1d.0: new USB bus registered, assigned bus number 1
    [    2.670124] ehci-pci 0000:00:1d.0: USB 2.0 started, EHCI 1.00
    [    2.670228] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.670274] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.670320] usb usb1: Product: EHCI Host Controller
    [    2.670353] usb usb1: Manufacturer: Linux 4.11.4-1.gcba98ee-default ehci_hcd
    [    2.670399] usb usb1: SerialNumber: 0000:00:1d.0
    [    2.670580] hub 1-0:1.0: USB hub found
    [    2.671150] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2
    [    2.672493] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    2.672539] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.672585] usb usb2: Product: xHCI Host Controller
    [    2.672618] usb usb2: Manufacturer: Linux 4.11.4-1.gcba98ee-default xhci-hcd
    [    2.672664] usb usb2: SerialNumber: 0000:00:14.0
    [    2.672846] hub 2-0:1.0: USB hub found
    [    2.675907] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3
    [    2.676533] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003
    [    2.676578] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    2.676625] usb usb3: Product: xHCI Host Controller
    [    2.676656] usb usb3: Manufacturer: Linux 4.11.4-1.gcba98ee-default xhci-hcd
    [    2.676702] usb usb3: SerialNumber: 0000:00:14.0
    [    2.676877] hub 3-0:1.0: USB hub found
    [    2.678002] usb: port power management may be unreliable
    [    3.002146] usb 1-1: new high-speed USB device number 2 using ehci-pci
    [    3.002156] usb 2-5: new full-speed USB device number 2 using xhci_hcd
    [    3.143037] usb 2-5: New USB device found, idVendor=04ca, idProduct=3014
    [    3.143038] usb 2-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    3.147120] Bluetooth: Core ver 2.22
    [    3.147139] Bluetooth: HCI device and connection manager initialized
    [    3.147141] Bluetooth: HCI socket layer initialized
    [    3.147143] Bluetooth: L2CAP socket layer initialized
    [    3.147147] Bluetooth: SCO socket layer initialized
    [    3.148116] usbcore: registered new interface driver btusb
    [    3.150432] usb 1-1: New USB device found, idVendor=8087, idProduct=8001
    [    3.150433] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [    3.150586] hub 1-1:1.0: USB hub found
    [    3.153192] usbcore: registered new interface driver ath3k
    [    3.262136] usb 2-7: new high-speed USB device number 3 using xhci_hcd
    [    3.411404] usb 2-7: New USB device found, idVendor=1bcf, idProduct=2c81
    [    3.411406] usb 2-7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [    3.411406] usb 2-7: Product: HD WebCam
    [    3.411407] usb 2-7: Manufacturer: NC2141103M50708908LM05
    [    3.530196] usb 2-8: new high-speed USB device number 4 using xhci_hcd
    [    3.670580] usb 2-8: New USB device found, idVendor=0bda, idProduct=0129
    [    3.670584] usb 2-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [    3.670586] usb 2-8: Product: USB2.0-CRW
    [    3.670588] usb 2-8: Manufacturer: Generic
    [    3.670590] usb 2-8: SerialNumber: 20100201396000000
    [    3.671308] usb 2-5: USB disconnect, device number 2
    [    3.675887] usbcore: registered new interface driver rtsx_usb
    [    3.934183] usb 2-5: new full-speed USB device number 5 using xhci_hcd
    [    9.323353] usb 2-5: New USB device found, idVendor=04ca, idProduct=3014
    [    9.324077] usb 2-5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
    [   14.476841] usb 2-5: USB disconnect, device number 5
    [   14.919635] ath: phy0: WB335 2-ANT card detected
    [   14.923495] ath: phy0: Set BT/WLAN RX diversity capability
    [   14.934042] ath: phy0: Enable LNA combining
    [   14.936330] ath: phy0: ASPM enabled: 0x42
    [   14.937453] ath: EEPROM regdomain: 0x6c
    [   14.937454] ath: EEPROM indicates we should expect a direct regpair map
    [   14.937455] ath: Country alpha2 being used: 00
    [   14.937455] ath: Regpair used: 0x6c
    [   15.108629] ieee80211 phy0: Atheros AR9565 Rev:2 mem=0xffffa29f41c00000, irq=19
    [   17.131412] input: HD WebCam as /devices/pci0000:00/0000:00:14.0/usb2/2-7/2-7:1.0/input/input22
    [   17.132859] usbcore: registered new interface driver uvcvideo
    [   17.134202] USB Video Class driver (1.1.1)
    [   27.872910] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [   27.876028] Bluetooth: BNEP filters: protocol multicast
    [   27.877987] Bluetooth: BNEP socket layer initialized
    But I'm concerned about those lines:

    Code:
    [    3.671308] usb 2-5: USB disconnect, device number 2
    
    ...
    
    [   14.476841] usb 2-5: USB disconnect, device number 5
    During this boot, my Bluetooth adapter was disconnected twice!

    Also, I'm not able to use it. GNOME says there is no Bluetooth found. Indeed, it is not listed by lsusb:

    Code:
    # lsusb
    Bus 001 Device 002: ID 8087:8001 Intel Corp. 
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 002 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
    Bus 002 Device 003: ID 1bcf:2c81 Sunplus Innovation Technology Inc. 
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Do you have any idea on why that is happening? And/or what could I try next?

    The original question of this post (How can I insert a file into the initramfs?) has been answered, should I add [SOLVED] to it?

  4. #4

    Default Re: How can I insert a file into the initramfs?

    I gave up. Instead of spending more time trying to make my built-in Bluetooth adapter work on Linux, I bought an USB adapter that actually works on Linux, more info here.

    Anyways, the original question of this post has been answered, so I marked this thread as solved adding a solved tag to it, according to HOW TO!! Mark a Thread SOLVED!

    Thank you!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •