Update initramfs and boot info

firmware.service now just modprobes wlan to get it working
Other services do not need to be changed to work with firmware.service
creating a full arch linux initramfs now works (module loading still done via
firmware.service unfortunately)
This commit is contained in:
crondog 2014-04-25 14:39:54 +10:00
parent 419082bbc7
commit 1d176175ab
8 changed files with 63 additions and 23 deletions

View file

@ -49,9 +49,9 @@ initramfs (which I am haven't done yet)
4: Copy firmware.service to /etc/systemd/system/ 4: Copy firmware.service to /etc/systemd/system/
5: ln -s /etc/systemd/system/firmware.service /etc/systemd/system/multi-user.target.wants/firmware.service 5: ln -s /etc/systemd/system/firmware.service /etc/systemd/system/multi-user.target.wants/firmware.service
6: cp wpa_supplicant-nl80211@wlan0.service /etc/systemd/system/ and then ln -s /etc/systemd/system/wpa_supplicant-nl80211@wlan0.service /etc/systemd/system/multi-user.target.wants/wpa_supplicant-nl80211@wlan0.service Idealy you can use the original service file but since the ramdisk does not load the module, it requires the firmware.service 6: ln -s /lib/systemd/system/wpa_supplicant-nl80211@wlan0.service /etc/systemd/system/multi-user.target.wants/wpa_supplicant-nl80211@wlan0.service
7: ln -s /etc/systemd/system/dhcpcd.service /etc/systemd/system/multi-user.target.wants/dhcpcd.service 7: ln -s /lib/systemd/system/dhcpcd.service /etc/systemd/system/multi-user.target.wants/dhcpcd.service
8: ln -s /etc/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.service 8: ln -s /lib/systemd/system/sshd.service /etc/systemd/system/multi-user.target.wants/sshd.service
Note: Disable the wpa_supplicant hook in /etc/dhcpcd.conf Note: Disable the wpa_supplicant hook in /etc/dhcpcd.conf
@ -112,11 +112,21 @@ CONFIG_STACKTRACE=y
CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y
## Build initramfs ## Build initramfs (Manually)
1: Edit makebootimage.sh with paths 1: Edit makebootimage.sh with paths
2: cd systemd-initramfs; find . | cpio -o -H newc | gzip > ../minimal.initramfs 2: cd systemd-initramfs; find . | cpio -o -H newc | gzip > ../minimal.initramfs
3: ./makebootimage.sh 3: ./makebootimage.sh
## Build initramfs (mkinitcpio)
1: Copy zImage to /boot/
2: Copy modules to /lib/modules/`uname -r`
3: Apply mkinitcpio.patch
4: Copy hooks/imgmount and install/imgmount to /lib/initcpio
5: sudo mkinitcpio -p linux
6: abootimg --create boot.img -f bootimg.cfg -k /boot/zImage -r /boot/initramfs-linux.img
# Whats Working # Whats Working
Wifi Wifi
fb0 fb0

7
abootimg.cfg Normal file
View file

@ -0,0 +1,7 @@
pagesize = 0x800
kerneladdr = 0x80208000
ramdiskaddr = 0x82200000
secondaddr = 0x81100000
tagsaddr = 0x80200100
name =
cmdline = console=ttyHSL0,115200,n8 g_serial.n_ports=2 console=tty1 fbcon=rotate:1 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 selinux=0 fsck.mode=skip

View file

@ -1,10 +1,12 @@
[Unit] [Unit]
Description=Load wlan firmware Description=Load wlan firmware
Wants=network.target
Before=network.target
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/usr/bin/bash -c 'echo 1 > /dev/wcnss_wlan; /usr/bin/sleep 2; echo sta > /sys/module/wlan/parameters/fwpath' ExecStart=/usr/bin/modprobe wlan
ExecStart=/usr/bin/bash -c 'echo 1 > /sys/module/hci_smd/parameters/hcismd_set; /usr/bin/sleep 2' ExecStart=/usr/bin/bash -c 'echo 1 > /sys/module/hci_smd/parameters/hcismd_set;'
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -4,4 +4,4 @@
KERNEL=~/android/kernel_msm/arch/arm/boot/zImage KERNEL=~/android/kernel_msm/arch/arm/boot/zImage
INITRAMFS=minimal.initramfs INITRAMFS=minimal.initramfs
~/android/system/out/host/linux-x86/bin/mkbootimg --kernel $KERNEL --cmdline "console=ttyHSL0,115200,n8 g_serial.n_ports=2 console=tty1 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 selinux=0 fbcon=map:10 fbcon=font:VGA8x8" --base 0x80200000 --pagesize 2048 --ramdisk_offset 0x02000000 --ramdisk $INITRAMFS --output newboot ~/android/system/out/host/linux-x86/bin/mkbootimg --kernel $KERNEL --cmdline "console=ttyHSL0,115200,n8 g_serial.n_ports=2 console=tty1 fbcon=rotate:1 androidboot.hardware=flo user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 selinux=0 fsck.mode=skip" --base 0x80200000 --pagesize 2048 --ramdisk_offset 0x02000000 --ramdisk $INITRAMFS --output newboot

13
mkinicpio/hooks/imgmount Normal file
View file

@ -0,0 +1,13 @@
#!/usr/bin/ash
run_hook () {
mount_handler="img_mount_handler"
}
img_mount_handler() {
mkdir /data
mount -t ext4 /dev/mmcblk0p30 /data
mknod /dev/loop256 b 7 256
losetup /dev/loop256 /data/arch.img
mount -t ext4 -o rw,noatime /dev/loop256 /new_root
}

View file

@ -0,0 +1,13 @@
#!/bin/bash
build ()
{
add_runscript
}
help ()
{
cat<<HELPEOF
Loads arch linux img loopback
HELPEOF
}

View file

@ -0,0 +1,11 @@
--- /usr/bin/mkinitcpio 2014-03-09 06:12:20.000000000 +1100
+++ mkinitcpio 2014-04-25 14:04:21.149124690 +1000
@@ -87,6 +87,8 @@
resolve_kernver() {
local kernel=$1 offset kver
+ uname -r
+ return 0
if [[ -z $kernel ]]; then
uname -r
return 0

View file

@ -1,16 +0,0 @@
[Unit]
Description=WPA supplicant daemon (interface- and nl80211 driver-specific version)
#Requires=sys-subsystem-net-devices-%i.device
#After=sys-subsystem-net-devices-%i.device
Requires=firmware.service
After=firmware.service
# NetworkManager users will probably want the dbus version instead.
[Service]
Type=oneshot
ExecStart=/usr/bin/sleep 2
ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211 -i%I
[Install]
Alias=multi-user.target.wants/wpa_supplicant-nl80211@wlan0.service