Browse Source

Add extra params to kernel and stop blacklisting thunderbolt

pull/10/head
marcosfad 2 years ago
parent
commit
68f147ff84
  1. 4
      .travis.yml
  2. 4
      build_file_system.sh
  3. 48
      files/chroot_build.sh
  4. 10
      files/grub/grub.cfg
  5. 2
      files/preseed/mbp.seed

4
.travis.yml

@ -22,8 +22,8 @@ jobs:
script: |
docker run --rm -v $(pwd):/repo -it alpine:latest /bin/sh -c '
cd /repo
apk add --no-cache python3
pip3 install yamllint
apk add --no-cache python3 py-pip
pip install yamllint
yamllint .
'
- stage: test

4
build_file_system.sh

@ -38,5 +38,5 @@ chmod 755 "${CHROOT_PATH}"/etc/grub.d/30_os-prober
### Copy suspend fix
echo >&2 "===]> Info: Fix suspend... "
cp -rfv "${ROOT_PATH}"/files/suspend/rmmod_tb.sh ${CHROOT_PATH}/lib/systemd/system-sleep/rmmod_tb.sh
chmod +x ${CHROOT_PATH}/lib/systemd/system-sleep/rmmod_tb.sh
cp -rfv "${ROOT_PATH}"/files/suspend/rmmod_tb.sh "${CHROOT_PATH}"/lib/systemd/system-sleep/rmmod_tb.sh
chmod +x "${CHROOT_PATH}"/lib/systemd/system-sleep/rmmod_tb.sh

48
files/chroot_build.sh

@ -61,6 +61,7 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="
initramfs-tools \
binutils \
linux-generic \
linux-headers-generic \
grub-efi-amd64-signed \
"linux-image-${KERNEL_VERSION}" \
"linux-headers-${KERNEL_VERSION}" \
@ -91,44 +92,43 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="
curl \
nano \
make \
gcc
gcc \
dkms
echo >&2 "===]> Info: Change initramfs format (for grub)... "
sed -i "s/COMPRESS=lz4/COMPRESS=gzip/g" "/etc/initramfs-tools/initramfs.conf"
echo >&2 "===]> Info: Add drivers... "
APPLE_BCE_DRIVER_GIT_URL=https://github.com/aunali1/mbp2018-bridge-drv.git
APPLE_BCE_DRIVER_GIT_URL=https://github.com/marcosfad/mbp2018-bridge-drv.git
APPLE_BCE_DRIVER_BRANCH_NAME=aur
APPLE_BCE_DRIVER_COMMIT_HASH=c884d9ca731f2118a58c28bb78202a0007935998
APPLE_BCE_DRIVER_COMMIT_HASH=85347e71dd79e0be486a79af36862c96027c0836
APPLE_BCE_DRIVER_MODULE_NAME=apple-bce
APPLE_BCE_DRIVER_MODULE_VERSION=0.1
APPLE_IB_DRIVER_GIT_URL=https://github.com/roadrunner2/macbook12-spi-driver.git
APPLE_IB_DRIVER_BRANCH_NAME=mbp15
APPLE_IB_DRIVER_COMMIT_HASH=90cea3e8e32db60147df8d39836bd1d2a5161871
APPLE_IB_DRIVER_MODULE_NAME=apple-ibridge
APPLE_IB_DRIVER_MODULE_VERSION=0.1
mkdir -p /opt/drivers
mkdir -p "/lib/modules/${KERNEL_VERSION}/kernel/drivers"
printf '\nblacklist thunderbolt' >>/etc/modprobe.d/blacklist.conf
# thunderbolt is working for me.
#printf '\nblacklist thunderbolt' >>/etc/modprobe.d/blacklist.conf
git clone --single-branch --branch ${APPLE_BCE_DRIVER_BRANCH_NAME} ${APPLE_BCE_DRIVER_GIT_URL} \
/opt/drivers/apple-bce
git -C /opt/drivers/apple-bce/ checkout "${APPLE_BCE_DRIVER_COMMIT_HASH}"
PATH=/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin \
make -C /lib/modules/"${KERNEL_VERSION}"/build/ M=/opt/drivers/apple-bce modules
cp -rf /opt/drivers/apple-bce/*.ko /lib/modules/"${KERNEL_VERSION}"/kernel/drivers/
printf '\n# apple-bce\nhid-apple\nbcm5974\nsnd-seq\napple-bce' >>/etc/modules-load.d/apple-bce.conf
printf '\n# apple-bce\nhid-apple\nsnd-seq\napple-bce' >>/etc/initramfs-tools/modules
/usr/src/"${APPLE_BCE_DRIVER_MODULE_NAME}-${APPLE_BCE_DRIVER_MODULE_VERSION}"
git -C /usr/src/"${APPLE_BCE_DRIVER_MODULE_NAME}-${APPLE_BCE_DRIVER_MODULE_VERSION}" checkout "${APPLE_BCE_DRIVER_COMMIT_HASH}"
dkms install -m "${APPLE_BCE_DRIVER_MODULE_NAME}" -v "${APPLE_BCE_DRIVER_MODULE_VERSION}" -k "${KERNEL_VERSION}"
printf '\n### apple-bce start ###\nhid-apple\nbcm5974\nsnd-seq\napple-bce\n### apple-bce end ###' >>/etc/modules-load.d/apple-bce.conf
printf '\n### apple-bce start ###\nhid-apple\nsnd-seq\napple-bce\n### apple-bce end ###' >>/etc/initramfs-tools/modules
git clone --single-branch --branch ${APPLE_IB_DRIVER_BRANCH_NAME} ${APPLE_IB_DRIVER_GIT_URL} \
/opt/drivers/applespi
git -C /opt/drivers/applespi/ checkout "${APPLE_IB_DRIVER_COMMIT_HASH}"
PATH=/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin \
make -C /lib/modules/"${KERNEL_VERSION}"/build/ M=/opt/drivers/applespi modules
printf '\n# applespi\napple_ibridge\napple_ib_tb\napple_ib_als' >>/etc/modules-load.d/applespi.conf
printf '\n# display f* key in touchbar\noptions apple-ib-tb fnmode=2\n' >> /etc/modprobe.d/apple-tb.conf
cp -rf /opt/drivers/applespi/*.ko /lib/modules/"${KERNEL_VERSION}"/kernel/drivers/
/usr/src/"${APPLE_IB_DRIVER_MODULE_NAME}-${APPLE_IB_DRIVER_MODULE_VERSION}"
git -C /usr/src/"${APPLE_IB_DRIVER_MODULE_NAME}-${APPLE_IB_DRIVER_MODULE_VERSION}" checkout "${APPLE_IB_DRIVER_COMMIT_HASH}"
dkms install -m "${APPLE_IB_DRIVER_MODULE_NAME}" -v "${APPLE_IB_DRIVER_MODULE_VERSION}" -k "${KERNEL_VERSION}"
printf '\n### applespi start ###\napple_ibridge\napple_ib_tb\napple_ib_als\n### applespi end ###' >>/etc/modules-load.d/applespi.conf
printf '\n# display f* key in touchbar\noptions apple-ib-tb fnmode=2\n' >> /etc/modprobe.d/apple-touchbar.conf
rm -rf /opt/drivers
echo >&2 "===]> Info: Update initramfs... "
@ -178,6 +178,10 @@ dns=dnsmasq
managed=false
EOF
dpkg-reconfigure network-manager
#echo >&2 "===]> Info: Configure Network Manager to use iwd... "
#mkdir -p /etc/NetworkManager/conf.d
#printf '[device]\nwifi.backend=iwd' > /etc/NetworkManager/conf.d/wifi_backend.conf
#systemctl enable iwd.service
echo >&2 "===]> Info: Cleanup the chroot environment... "

10
files/grub/grub.cfg

@ -7,23 +7,23 @@ set default="0"
set timeout=30
menuentry "Try Ubuntu FS without installing" {
linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat ---
linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat acpi=force ---
initrd /casper/initrd
}
menuentry "Try Ubuntu FS without installing (blacklist=thunderbolt)" {
linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat --- modprobe.blacklist=thunderbolt
linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro efi=noruntime pcie_ports=compat acpi=force --- modprobe.blacklist=thunderbolt
initrd /casper/initrd
}
menuentry "Install Ubuntu FS" {
linux /casper/vmlinuz preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat ---
linux /casper/vmlinuz preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat acpi=force ---
initrd /casper/initrd
}
menuentry "Install Ubuntu FS (blacklist=thunderbolt)" {
linux /casper/vmlinuz preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat --- modprobe.blacklist=thunderbolt
linux /casper/vmlinuz preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity efi=noruntime pcie_ports=compat acpi=force --- modprobe.blacklist=thunderbolt
initrd /casper/initrd
}
menuentry "Check disc for defects" {
linux /casper/vmlinuz boot=casper integrity-check efi=noruntime enforcing=0 efi=noruntime pcie_ports=compat ---
linux /casper/vmlinuz boot=casper integrity-check efi=noruntime enforcing=0 efi=noruntime pcie_ports=compat acpi=force ---
initrd /casper/initrd
}
menuentry "Check disc for defects (blacklist=thunderbolt)" {

2
files/preseed/mbp.seed

@ -8,4 +8,4 @@
# well keep them installed.
#ubiquity ubiquity/keep-installed string icedtea6-plugin openoffice.org
d-i debian-installer/add-kernel-opts string efi=noruntime pcie_ports=compat
d-i debian-installer/add-kernel-opts string efi=noruntime pcie_ports=compat acpi=force

Loading…
Cancel
Save