Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Wifi in initramfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
firelizzard
n00b
n00b


Joined: 26 Feb 2016
Posts: 5

PostPosted: Sat Mar 12, 2016 6:10 am    Post subject: [SOLVED] Wifi in initramfs Reply with quote

I'm using FDE (LUKS) on a home server. I want to be able to unlock it over the network. I have my initramfs set up with dropbear, dhcpcd, cryptsetup, etc. I've compiled wifi drivers and firmware into my kernel.

I'm getting an error when I try to run wpa_supplicant from my initramfs. The same config file works from the normal runlevel. The following is the output when I run with 'wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -ddd':

Code:
wpa_supplicant v2.5
random: Trying to read entropy from /dev/random
Successfully initialized wpa_supplicant
Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
Line: 1 - start of a new network block
ssid - hexdump_ascii(len=9):
     54 65 6c 70 65 72 69 6f 6e                        Telperion
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
scan_ssid=1 (0x1)
proto: 0x2
key_mgmt: 0x2
group: 0x18
pairwise: 0x18
priority=5 (0x5)
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 5
   id=0 ssid='Telperion'
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:10
nl80211: Supported cipher 00-0f-ac:8
nl80211: Supported cipher 00-0f-ac:9
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported cipher 00-0f-ac:13
nl80211: Supported cipher 00-0f-ac:11
nl80211: Supported cipher 00-0f-ac:12
nl80211: Using driver-based off-channel TX
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Enable multi-channel concurrent (driver advertised support)
nl80211: use P2P_DEVICE support
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 4 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x10db450
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=0801
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=0a07
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=0a11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=1101
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=1102
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x10db450 match=0505
netlink: Operstate: ifindex=4 linkmode=1 (userspace-control), operstate=5 (IF_OPER_DORMANT)
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=4 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 4 iftype 2 (STATION)
nl80211: Unsubscribe mgmt frames handle 0x8888888889853cd9 (mode change)
wlan0: Failed to initialize driver interface
Failed to add interface wlan0
wlan0: Cancelling scan request
wlan0: Cancelling authentication timeout


The following is my initramfs list file:
Code:
# directory structure
dir     /bin                                                    755 0 0
dir     /dev                                                    755 0 0
dir     /dev/pts                                                755 0 0
dir     /etc                                                    755 0 0
dir     /etc/dropbear                                           700 0 0
dir     /home                                                   755 0 0
dir     /lib                                                    755 0 0
dir     /lib/firmware                                           755 0 0
dir     /lib64                                                  755 0 0
dir     /mnt                                                    755 0 0
dir     /mnt/root                                               755 0 0
dir     /mnt/var_lib                                            755 0 0
dir     /mnt/var_opt                                            755 0 0
dir     /proc                                                   755 0 0
dir     /root                                                   700 0 0
dir     /sbin                                                   755 0 0
dir     /sys                                                    755 0 0
dir     /usr                                                    755 0 0
dir     /var                                                    755 0 0

# special files
nod     /dev/console                                            600 0 0 c 5 1

# binaries
file    /bin/busybox            /bin/busybox                    755 0 0
file    /sbin/btrfs             /sbin/btrfs                     755 0 0
file    /sbin/cryptsetup        /sbin/cryptsetup                755 0 0
file    /sbin/dhcpcd            /sbin/dhcpcd                    755 0 0
file    /sbin/dropbear          /usr/sbin/dropbear              755 0 0
file    /sbin/wpa_supplicant  /usr/src/initramfs/wpa_supplicant 755 0 0

# libraries
file    /lib/ld-linux.so.2      /lib/ld-linux.so.2              755 0 0
file    /lib/libattr.so.1       /lib/libattr.so.1               755 0 0
file    /lib/libblkid.so.1      /lib/libblkid.so.1              755 0 0
file    /lib/libc.so.6          /lib/libc.so.6                  755 0 0
file    /lib/libcap.so.2        /lib/libcap.so.2                755 0 0
file    /lib/libcryptsetup.so.4 /usr/lib/libcryptsetup.so.4     755 0 0
file    /lib/libdevmapper.so.1.02 /lib/libdevmapper.so.1.02     755 0 0
file    /lib/libdl.so.2         /lib/libdl.so.2                 755 0 0
file    /lib/libgcrypt.so.20    /usr/lib/libgcrypt.so.20        755 0 0
file    /lib/libgpg-error.so.0  /usr/lib/libgpg-error.so.0      755 0 0
file    /lib/liblzo2.so.2       /usr/lib/liblzo2.so.2           755 0 0
file    /lib/libm.so.6          /lib/libm.so.6                  755 0 0
file    /lib/libnl-3.so.200     /usr/lib/libnl-3.so.200         755 0 0
file    /lib/libnl-genl-3.so.200 /usr/lib/libnl-genl-3.so.200   755 0 0
file    /lib/libpopt.so.0       /usr/lib/libpopt.so.0           755 0 0
file    /lib/libpthread.so.0    /lib/libpthread.so.0            755 0 0
file    /lib/librt.so.1         /lib/librt.so.1                 755 0 0
file    /lib/libtommath.so.0    /usr/lib/libtommath.so.0        755 0 0
file    /lib/libudev.so.1       /usr/lib/libudev.so.1           755 0 0
file    /lib/libuuid.so.1       /lib/libuuid.so.1               755 0 0
file    /lib/libz.so.1          /lib/libz.so.1                  755 0 0
file    /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 755 0 0

# scripts
file    /init                   /usr/src/initramfs/init         755 0 0
file    /sbin/unlock            /usr/src/initramfs/unlock       755 0 0

# config files
file /etc/wpa_supplicant.conf               /usr/src/initramfs/wpa_supplicant.conf  600 0 0
file /etc/dropbear/dropbear_ecdsa_host_key  /usr/src/initramfs/ecdsa_host_key       600 0 0
file /etc/dropbear/dropbear_rsa_host_key    /usr/src/initramfs/rsa_host_key         600 0 0
file /etc/dropbear/dropbear_dss_host_key    /usr/src/initramfs/dss_host_key         600 0 0
file /lib/firmware/iwlwifi-7260-13.ucode    /lib/firmware/iwlwifi-7260-13.ucode     755 0 0


The following is my initramfs init script:
Code:
#!/bin/busybox sh

rescue_shell() {
    echo "$@"
    echo "Something went wrong. Dropping to a shell."
    #/bin/busybox --install -s
    #rm /sbin/switch_root
    exec setsid busybox cttyhack sh
}

# set up environment
export LD_LIBRARY_PATH=/lib

# temporarily mount proc and sys
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs none /dev

# disable kernel messages from popping onto the screen
echo 0 > /proc/sys/kernel/printk

# clear the screen
clear

#rescue_shell "testing"

# preparing dev to be unlocked
dev=$(findfs UUID=c8c5968b-c4b9-433f-bd96-dc86721938df)
cat <<EOF > /etc/crypt.env || rescue_shell "Could not write crypt.env file"
LUKS_DEVICE=$dev
LUKS_NAME=main
EOF

# set up networking and ssh
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B || rescue_shell "Error while starting wpa_supplicant"
dhcpcd wlp3s0 || rescue_shell "Error while starting dhcpcd"
dropbear || rescue_shell "Error while starting dropbear"

# wait for the local user or a remote user to enter the password
echo "Decrypting $dev"
unlock $dev main || rescue_shell "Error while unlocking or decrypting drive"

# clean up ssh
killall dropbear
killall dhcpcd
killall wpa_supplicant

# mounting
echo "Mounting root from /dev/mapper/main"
mount -o ro,subvol=/gentoo/root /dev/mapper/main /mnt/root || rescue_shell "Error while mounting root"

# mounting the rest of the filesystem
ln -s /mnt/root/etc/fstab /etc/fstab

for m in /home /var /var/lib /var/opt ; do
    echo "Mounting $m"
    mount $m || rescue_shell "Error while mounting $m"
done

mount --move /home /mnt/root/home || rescue_shell "Error while moving /home"
mount --move /var/lib /mnt/var_lib || rescue_shell "Error while moving /var/lib (1)"
mount --move /var/opt /mnt/var_opt || rescue_shell "Error while moving /var/opt (1)"
mount --move /var /mnt/root/var || rescue_shell "Error while moving /var"
mount --move /mnt/var_lib /mnt/root/var/lib || rescue_shell "Error while moving /var/lib (2)"
mount --move /mnt/var_opt /mnt/root/var/opt || rescue_shell "Error while moving /var/opt (2)"

echo "Done. Switching to real root."

# clean up
umount /proc
umount /sys
umount /dev

# switch to the real root and init
exec switch_root /mnt/root /usr/lib/systemd/systemd


The following is from lspci:
Code:
03:00.0 Network controller: Intel Corporation Wireless 7260 (rev bb)
        Subsystem: Intel Corporation Dual Band Wireless-AC 7260
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 27
        Region 0: Memory at f7c00000 (64-bit, non-prefetchable) [size=8K]
        Capabilities: [c8] Power Management version 3
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000fee0f00c  Data: 41d1
        Capabilities: [40] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 unlimited
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset+
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd- ExtTag- PhantFunc- AuxPwr+ NoSnoop+ FLReset-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <4us, L1 <32us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR+, OBFF Via WAKE#
                DevCtl2: Completion Timeout: 16ms to 55ms, TimeoutDis-, LTR+, OBFF Disabled
                LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
                         EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
        Capabilities: [100 v1] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP+ BadDLLP- Rollover- Timeout- NonFatalErr+
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
                AERCap: First Error Pointer: 00, GenCap- CGenEn- ChkCap- ChkEn-
        Capabilities: [140 v1] Device Serial Number 7c-5c-f8-ff-ff-73-d5-e8
        Capabilities: [14c v1] Latency Tolerance Reporting
                Max snoop latency: 71680ns
                Max no snoop latency: 71680ns
        Capabilities: [154 v1] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>
        Kernel driver in use: iwlwifi


The following is from my kernel config:
Code:

CONFIG_EXTRA_FIRMWARE="iwlwifi-7260-13.ucode"
CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware"
CONFIG_IWLWIFI=y
CONFIG_IWLWIFI_LEDS=y
# CONFIG_IWLDVM is not set
CONFIG_IWLMVM=y
# CONFIG_IWLWIFI_BCAST_FILTERING is not set
# CONFIG_IWLWIFI_UAPSD is not set
# CONFIG_IWLWIFI_DEBUG is not set
# CONFIG_IWLWIFI_DEVICE_TRACING is not set
# CONFIG_IWL4965 is not set
# CONFIG_IWL3945 is not set


The following is my wpa_supplicant.conf:
Code:
network={
    ssid="Telperion"
    psk="1.618034"
    scan_ssid=1
    proto=RSN
    key_mgmt=WPA-PSK
    group=CCMP TKIP
    pairwise=CCMP TKIP
    priority=5
}


Last edited by firelizzard on Sat Mar 12, 2016 10:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sat Mar 12, 2016 10:40 am    Post subject: Reply with quote

Quote:
I want to be able to unlock it over the network.


So you want to use wifi with a key and it should unlock itself when you connect to the access point?
Sounds like that will not work

I do not get the point why not boot up the box with the initramfs and just use /etc/wpa_supplicant/wpa_supplicant.conf to connect to wifi.

Busybox is just a subset of the tools. And thats afaik before the network service itself is started. You may check the init level definitions first.

For network afaik you need to be in runlevel 2 or 3, which is much later in the boot process
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42558
Location: 56N 3W

PostPosted: Sat Mar 12, 2016 10:44 am    Post subject: Reply with quote

firelizzard,

init:
# set up networking and ssh
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B || rescue_shell "Error while starting wpa_supplicant"
dhcpcd wlp3s0 || rescue_shell "Error while starting dhcpcd"


Is it wlan0 or wlp3s0?

I suspect that your interface is called wlan0 in the initrd, as udev has not been started by your init script.
Also
nl80211: interface wlan0 in phy phy0 :
nl80211: interface wlan0 in phy phy0


I would tell udev to keep its hands off my interface names because having the interface renamed during boot would make my head hurt.
This does mean you need to use kernel interface names everywhere.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sat Mar 12, 2016 10:54 am    Post subject: Reply with quote

Quote:
wlan0: Failed to initialize driver interface

I don't see modules in your initramfs. Probably you compiled it as a module but didn't include in the intiramfs.
Quote:
For network afaik you need to be in runlevel 2 or 3, which is much later in the boot process
No, you don't. The "standard" model is 2 for no-network, 3 for default and 5 for graphic mode, but since it's you who assigns services to the runlevels, you are free to change it. And I bet most of us actually only uses 2 runlevels: "default" and "oh-shit".
Oh, and busybox init doesn't support runlevels at all.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42558
Location: 56N 3W

PostPosted: Sat Mar 12, 2016 11:54 am    Post subject: Reply with quote

szatox,

The concept of runlevels doesn't exist in the initrd.
It could do but that would be a complication everyone could do without.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 12, 2016 4:51 pm    Post subject: Reply with quote

firelizzard ...

that would be an example of a technical argument against systemd, but you know best, so why ask a greybeard about basic stuff like having the necessary directory structure expected by your execuatbles, or other obvious issues with the above init?

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42558
Location: 56N 3W

PostPosted: Sat Mar 12, 2016 5:32 pm    Post subject: Reply with quote

khayyam,

Well spotted.
Ewwww ...:
exec switch_root /mnt/root /usr/lib/systemd/systemd


At least systemd isn't running in the initrd. Its just the content of the initrd with the initrd init script as PID 1.

Hmm ...
Code:
file /lib/firmware/iwlwifi-7260-13.ucode    /lib/firmware/iwlwifi-7260-13.ucode     755 0 0

Those files are just bloat. They need to be built into the kernel along with the wifi driver, which the kernel .config fragment shows as built it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
firelizzard
n00b
n00b


Joined: 26 Feb 2016
Posts: 5

PostPosted: Sat Mar 12, 2016 6:27 pm    Post subject: Reply with quote

tw04l124 wrote:
So you want to use wifi with a key and it should unlock itself when you connect to the access point?


No, I want to be able to unlock my server remotely. To that end, I need networking, dhcp, and ssh in my initramfs. Since my server has no hard wire, this requires wifi in my initramfs. Idea is, I'm at a friend's house and I need to restart my server, or the power goes down for a few minutes, or whatever. But once it gets to the initramfs, I can SSH in and unlock it so it can finish booting. And to answer your question, I can't just let the initramfs boot it up because my hard drive is encrypted. And if I automated the unlock by putting the key in the initramfs or some such, what would be the point of encrypting anything?

NeddySeagoon wrote:
Is it wlan0 or wlp3s0?


As you suspect, it is wlan0 before udev and wlp3s0 after. I originally had wpa_supplicant acting on the latter, but that obviously failed, so I changed it. I forgot to change the DHCPCD line, and haven't yet since it's never got that far.

szatox wrote:
I don't see modules in your initramfs.


I compiled in everything I thought I needed. iwlwifi, iwlmvm, cfg80211, the firmware blobs, etc. I might have missed something, but I figured posting my entire kernel config would be a bit excessive.

khayyam wrote:
so why ask a greybeard about basic stuff like having the necessary directory structure expected by your execuatbles, or other obvious issues with the above init?


It should be obvious that I do not find these issues obvious, so why do you bother commenting if you're not going to help?

NeddySeagoon wrote:
Those files are just bloat.


I forgot if I had put them in there, so it was something to try. Because if it works, it works. But obviously it didn't so I'll be removing that bloat. Apparently you and khayyam noticed something. Would you care to share?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 12, 2016 7:34 pm    Post subject: Reply with quote

firelizzard wrote:
khayyam wrote:
so why ask a greybeard about basic stuff like having the necessary directory structure expected by your execuatbles, or other obvious issues with the above init?

It should be obvious that I do not find these issues obvious, so why do you bother commenting if you're not going to help?

firelizzard ... because there is no reciprocality invoved, that was what made our community work, we had an agreement to work together toward a common goal, assisting one another as and where that was possible, tollerating each others choices, passing on knowledge, etc, that implicit agreement is nolonger applicable, it has been swept aside by the process of systemd "adoption".

firelizzard wrote:
Apparently you and khayyam noticed something. Would you care to share?

I did, I gave you a clue, but I won't do any more than that.

best ... khay
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42558
Location: 56N 3W

PostPosted: Sat Mar 12, 2016 8:14 pm    Post subject: Reply with quote

firelizzard,

I have no more sympathy for systemd users than khayyam.
In addition to what khayyam said, to my mind, systemd is poor design practice, badly implemented. Using systemd at all is a poor choice.
Using systemd on a server, doubly so. Anyway, I'm still here because your issue is before systemd starts and this is not a systemd thread.

Buildind on khayyams hint ... Watch carefully.
initramfs list:
# config files
file /etc/wpa_supplicant.conf               /usr/src/initramfs/wpa_supplicant.conf  600 0 0


init:
# set up networking and ssh
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B || rescue_shell "Error while starting


You have that wrong 5 times, that's just the first instance.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
firelizzard
n00b
n00b


Joined: 26 Feb 2016
Posts: 5

PostPosted: Sat Mar 12, 2016 10:44 pm    Post subject: Reply with quote

No idea what the hell you two are getting on about. The problem was that I had CONFIG_PACKET=m and I did not have the module in my initramfs. I changed it to CONFIG_PACKET=y and how everything works. And how does systemd have anything to do with a problem that occurs before systemd is even loaded at all? Systemd is entirely irrelevant to this issue.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Mar 12, 2016 11:50 pm    Post subject: Reply with quote

firelizzard wrote:
And how does systemd have anything to do with a problem that occurs before systemd is even loaded at all? Systemd is entirely irrelevant to this issue.

firelizzard ... did I say the problem had anything to do with systemd? No. I pointed to the fact your init, directory structure, and paths provided, were inconsistent, or missing. But, yeah, "it works", never mind about that, or about the knock-on effects of systemd adoption for those of us supporting the community, and who on the one hand are asked to provide their time supporting users, etc, and on the other told they should "go elsewhere if they don't like it" ... that's "entirely irrelevant".

best ... khay
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Sun Mar 13, 2016 12:06 am    Post subject: Reply with quote

@firelizzard:

glad you could figure out your issue :)

If you're experienced in regards to wpa supplicant and systemd initramfs, those are two things still missing in https://wiki.gentoo.org/wiki/Custom_Initramfs so if you have time, feel free to add your knowledge/experience. Or if that is too much work, if your /init is fully functional you could add it to https://wiki.gentoo.org/wiki/Custom_Initramfs/Examples

My experience with systemd is virtually nonexistant, I only noticed that it really dislikes devices set up by initramfs (particularly lvm + luks), basically it does not see them unless systemd created it by itself. Maybe that can be configured or I just did something wrong?

Personally I won't use systemd on Gentoo for as long as it's not the default in Gentoo; but I don't fight it in other distros either (but their initramfs also contains systemd then) and people coming from those other distroes to Gentoo in the future are probably already so used to systemd that they'll want to use it in Gentoo too. And that's everyone's choice to make.


Regarding modules, I don't have any. :lol: :lol: :lol: Everything's built in. Modules have never given me any advantage and many disadvantages (tons of hard to debug problems because a module was not loaded when it should be).
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42558
Location: 56N 3W

PostPosted: Sun Mar 13, 2016 11:16 am    Post subject: Reply with quote

firelizzard,

For you anh others who come after you ...

initramfs list:
# config files
file /etc/wpa_supplicant.conf               /usr/src/initramfs/wpa_supplicant.conf  600 0 0

Puts the file found at /etc/wpa_supplicant.conf into /usr/src/initramfs/wpa_supplicant.conf which will become /wpa_supplicant.conf in your initrd. - The /etc/ part of the path is missing.

init:

# set up networking and ssh
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B || rescue_shell "Error while starting

Looks for /etc/wpa_supplicant.conf in the initrd but its not there ...

Rinse and repeat for dropbears host key files too. Dropbear will make new host keys every boot but you should get the warning about unknown host key or host key has changed. Its over 10 years sice I've used dropbear, so maybe it doesn't do that.

We have already agreed that /lib/firmware/iwlwifi-7260-13.ucode is bloat, so I miscounted which I said you have 5 instances of the same error.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Sun Mar 13, 2016 3:23 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Puts the file found at /etc/wpa_supplicant.conf into /usr/src/initramfs/wpa_supplicant.conf which will become /wpa_supplicant.conf in your initrd.


It's probably the other way around, it puts file found at /usr/src/initramfs/wpa_supplicant.conf into the initrd as /etc/wpa_supplicant.conf

Example from /usr/src/linux/Domentation/filesystems/ ramfs-rootfs-initramfs.txt
Code:

file /init initramfs/init.sh 755 0 0


It's /init in the initrd, and the source coming from whereever.

I don't use this style myself, I prefer populating a directory like /usr/src/initramfs directly. Using a text file instead has the advantage of always grabbing the latest versions from your system, but in my case I build them static / with different useflags for the initramfs so I have to use copies either way... :wink:
Back to top
View user's profile Send private message
firelizzard
n00b
n00b


Joined: 26 Feb 2016
Posts: 5

PostPosted: Sat Mar 19, 2016 8:18 pm    Post subject: Reply with quote

frostschutz wrote:
It's probably the other way around.


It is certainly the other way around. I've got it wrong before and my kernel won't build. So by virtue of the fact that my kernel builds, I know it finds the files, and by virtue of the fact that my initramfs works now, I know it puts the files in the right places.

@frostschutz,

I will certainly add to the custom initramfs wiki when I have the time. As far as systemd/initramfs, I'm not doing anything special. I ran into the same issue with systemd not seeing my decrypted luks device, but not wanting to open a new one since technically its already decrypted. I solved it by mounting everything in my initramfs. As far as the network interface device naming, I dealt with that by killing everything that was talking to the NICs. After boot is complete, my interface has been renamed from wlan0 to wlp3s0.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Mar 23, 2016 2:33 pm    Post subject: Reply with quote

khayyam wrote:
that would be an example of a technical argument against systemd, but you know best, so why ask a greybeard about basic stuff like having the necessary directory structure expected by your execuatbles, or other obvious issues with the above init?

That is very unhelpful as a first response to someone asking a clearly-put technical question.

Not expecting a response, since we're "ignoring" each other; just wanted the OP to know what I thought.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Mar 23, 2016 2:57 pm    Post subject: Reply with quote

steveL wrote:
That is very unhelpful as a first response to someone asking a clearly-put technical question. Not expecting a response, since we're "ignoring" each other; just wanted the OP to know what I thought.

Again, please not to engage me in any further discussion ... indirectly or otherwise.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Wed Mar 23, 2016 3:11 pm    Post subject: Reply with quote

firelizzard wrote:
I will certainly add to the custom initramfs wiki when I have the time.


Thanks! :D

I've already added the cpio file list which was not previously in there; the wiki page does not use it but builds a real directory structure instead, but it should be mentioned for those who are interested.

firelizzard wrote:
As far as systemd/initramfs, I'm not doing anything special. [...]


I'm not using systemd myself in Gentoo, and for other systemd based distros I don't use a "Custom Initramfs" but extend their existing ones with hooks/addons/whatnot, so the systemd side of things is never handled by me...

The one time I tried to use it in a Gentoo VM, I remember systemd would hang in the boot process forever no matter what I did. :cry: So I'm not able to give systemd instructions in the wiki. I hope the guide is somewhat helpful to systemd users anyway... :?


Last edited by frostschutz on Thu Mar 24, 2016 12:40 pm; edited 1 time in total
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Mar 24, 2016 4:59 am    Post subject: Reply with quote

khayyam wrote:
Again, please not to engage me in any further discussion ... indirectly or otherwise.

I did not invite a further response, so again you are poking the passive-aggressive stick.

Kindly desist.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2968
Location: Germany

PostPosted: Thu Mar 24, 2016 12:58 pm    Post subject: Reply with quote

With all due respect, you poked first and nobody invited you either. Regarding helpfulness, good intentions notwithstanding, none of the answers (mine included) helped anyone at all. OP solved it by himself so all credits go to him. So if we could all stop the pointless bickering, that'd be great.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Mar 24, 2016 3:09 pm    Post subject: Reply with quote

Actually, "you know best, so why ask a greybeard" is the initial, unpleasant, poke, that came out of nowhere and had absolutely nothing to do with helping.

As for the nonsense about invitation, I'll leave that as simple waspishness, though it is disappointing from someone of your calibre.

But by all means, let's stop.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum