From 1d176175aba7dc819c7be54116dacb6f8527b807 Mon Sep 17 00:00:00 2001 From: crondog Date: Fri, 25 Apr 2014 14:39:54 +1000 Subject: [PATCH] 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) --- README.md | 18 ++++++++++++++---- abootimg.cfg | 7 +++++++ firmware.service | 6 ++++-- makebootimage.sh | 2 +- mkinicpio/hooks/imgmount | 13 +++++++++++++ mkinicpio/install/imgmount | 13 +++++++++++++ mkinicpio/mkinitcpio.patch | 11 +++++++++++ wpa_supplicant-nl80211@.service | 16 ---------------- 8 files changed, 63 insertions(+), 23 deletions(-) create mode 100644 abootimg.cfg create mode 100644 mkinicpio/hooks/imgmount create mode 100644 mkinicpio/install/imgmount create mode 100644 mkinicpio/mkinitcpio.patch delete mode 100644 wpa_supplicant-nl80211@.service diff --git a/README.md b/README.md index 55e3f61..fa0a962 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,9 @@ initramfs (which I am haven't done yet) 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 -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 -7: ln -s /etc/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 +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 /lib/systemd/system/dhcpcd.service /etc/systemd/system/multi-user.target.wants/dhcpcd.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 @@ -112,11 +112,21 @@ CONFIG_STACKTRACE=y CONFIG_DEBUG_BUGVERBOSE=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y -## Build initramfs +## Build initramfs (Manually) 1: Edit makebootimage.sh with paths 2: cd systemd-initramfs; find . | cpio -o -H newc | gzip > ../minimal.initramfs 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 Wifi fb0 diff --git a/abootimg.cfg b/abootimg.cfg new file mode 100644 index 0000000..9fede2b --- /dev/null +++ b/abootimg.cfg @@ -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 diff --git a/firmware.service b/firmware.service index 0af7e3e..f8b1925 100644 --- a/firmware.service +++ b/firmware.service @@ -1,10 +1,12 @@ [Unit] Description=Load wlan firmware +Wants=network.target +Before=network.target [Service] 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/bash -c 'echo 1 > /sys/module/hci_smd/parameters/hcismd_set; /usr/bin/sleep 2' +ExecStart=/usr/bin/modprobe wlan +ExecStart=/usr/bin/bash -c 'echo 1 > /sys/module/hci_smd/parameters/hcismd_set;' [Install] WantedBy=multi-user.target diff --git a/makebootimage.sh b/makebootimage.sh index 0dc7c1a..234ed8e 100755 --- a/makebootimage.sh +++ b/makebootimage.sh @@ -4,4 +4,4 @@ KERNEL=~/android/kernel_msm/arch/arm/boot/zImage 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 diff --git a/mkinicpio/hooks/imgmount b/mkinicpio/hooks/imgmount new file mode 100644 index 0000000..f97bd85 --- /dev/null +++ b/mkinicpio/hooks/imgmount @@ -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 +} diff --git a/mkinicpio/install/imgmount b/mkinicpio/install/imgmount new file mode 100644 index 0000000..e5588d6 --- /dev/null +++ b/mkinicpio/install/imgmount @@ -0,0 +1,13 @@ +#!/bin/bash + +build () +{ + add_runscript +} + +help () +{ +cat<