From 2ee13b8682e06c4df089e5088faa8b4ce9cbc883 Mon Sep 17 00:00:00 2001 From: marcosfad Date: Sun, 18 Oct 2020 14:26:37 +0200 Subject: [PATCH 1/7] Network: Add iwd and use it as backend --- files/chroot_build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/files/chroot_build.sh b/files/chroot_build.sh index 4b3b5c0..604d0db 100755 --- a/files/chroot_build.sh +++ b/files/chroot_build.sh @@ -93,7 +93,8 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=" nano \ make \ gcc \ - dkms + dkms \ + iwd echo >&2 "===]> Info: Change initramfs format (for grub)... " sed -i "s/COMPRESS=lz4/COMPRESS=gzip/g" "/etc/initramfs-tools/initramfs.conf" @@ -178,9 +179,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 + +echo >&2 "===]> Info: Configure Network Manager to use iwd... " +mkdir -p /etc/NetworkManager/conf.d +printf '[device]\nwifi.backend=iwd\n' > /etc/NetworkManager/conf.d/wifi_backend.conf #systemctl enable iwd.service echo >&2 "===]> Info: Cleanup the chroot environment... " From 2f56be3ef0e38ca963614d863f291691ac5eb503 Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 17:46:51 +1000 Subject: [PATCH 2/7] linux5.10, update apple-bce and apple-ibridge The updated kernel is retrieved manually from mbp-ubuntu-kernel's github releases, which is a temporary solution and should be changed back once it's on the apt repo. I've tested building this, and it boots and installs correctly, but when booting into the installation it gets stuck after complaining about no firmware for brcmfmac, and there's a red/green line on my display. This is on a MacBookPro16,1. --- build.sh | 4 ++-- files/chroot_build.sh | 33 +++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/build.sh b/build.sh index 7cebfd6..708b5cc 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ ROOT_PATH=$(pwd) WORKING_PATH=/root/work CHROOT_PATH="${WORKING_PATH}/chroot" IMAGE_PATH="${WORKING_PATH}/image" -KERNEL_VERSION=5.9.6 +KERNEL_VERSION=5.10.47 if [ -d "$WORKING_PATH" ]; then rm -rf "$WORKING_PATH" @@ -33,7 +33,7 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=" syslinux echo >&2 "===]> Info: Start loop... " -for ALTERNATIVE in mbp mbp-alt +for ALTERNATIVE in mbp do echo >&2 "===]> Info: Start building ${ALTERNATIVE}... " diff --git a/files/chroot_build.sh b/files/chroot_build.sh index 604d0db..7cae309 100755 --- a/files/chroot_build.sh +++ b/files/chroot_build.sh @@ -63,11 +63,16 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=" linux-generic \ linux-headers-generic \ grub-efi-amd64-signed \ - "linux-image-${KERNEL_VERSION}" \ - "linux-headers-${KERNEL_VERSION}" \ intel-microcode \ thermald +# This is not ideal, but it should work until the apt repo gets updated. + +curl -L https://github.com/marcosfad/mbp-ubuntu-kernel/releases/download/v5.10.47/linux-headers-5.10.47-mbp_5.10.47-1_amd64.deb > /tmp/headers.deb +curl -L https://github.com/marcosfad/mbp-ubuntu-kernel/releases/download/v5.10.47/linux-image-5.10.47-mbp_5.10.47-1_amd64.deb > /tmp/image.deb +file /tmp/* +apt install /tmp/headers.deb /tmp/image.deb + echo >&2 "===]> Info: Install window manager... " apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ @@ -101,17 +106,17 @@ 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/marcosfad/mbp2018-bridge-drv.git +APPLE_BCE_DRIVER_GIT_URL=https://github.com/t2linux/apple-bce-drv.git APPLE_BCE_DRIVER_BRANCH_NAME=aur -APPLE_BCE_DRIVER_COMMIT_HASH=85347e71dd79e0be486a79af36862c96027c0836 +APPLE_BCE_DRIVER_COMMIT_HASH=f93c6566f98b3c95677de8010f7445fa19f75091 APPLE_BCE_DRIVER_MODULE_NAME=apple-bce -APPLE_BCE_DRIVER_MODULE_VERSION=0.1 +APPLE_BCE_DRIVER_MODULE_VERSION=0.2 -APPLE_IB_DRIVER_GIT_URL=https://github.com/roadrunner2/macbook12-spi-driver.git +APPLE_IB_DRIVER_GIT_URL=https://github.com/t2linux/apple-ib-drv APPLE_IB_DRIVER_BRANCH_NAME=mbp15 -APPLE_IB_DRIVER_COMMIT_HASH=90cea3e8e32db60147df8d39836bd1d2a5161871 +APPLE_IB_DRIVER_COMMIT_HASH=fc9aefa5a564e6f2f2bb0326bffb0cef0446dc05 APPLE_IB_DRIVER_MODULE_NAME=apple-ibridge -APPLE_IB_DRIVER_MODULE_VERSION=0.1 +APPLE_IB_DRIVER_MODULE_VERSION=0.2 # thunderbolt is working for me. #printf '\nblacklist thunderbolt' >>/etc/modprobe.d/blacklist.conf @@ -119,6 +124,18 @@ APPLE_IB_DRIVER_MODULE_VERSION=0.1 git clone --single-branch --branch ${APPLE_BCE_DRIVER_BRANCH_NAME} ${APPLE_BCE_DRIVER_GIT_URL} \ /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}" + +cat << EOF > /usr/src/${APPLE_BCE_DRIVER_MODULE_NAME}-${APPLE_BCE_DRIVER_MODULE_VERSION}/dkms.conf +PACKAGE_NAME=apple-bce +PACKAGE_VERSION=0.1 +CLEAN="make clean" +MAKE="make" +BUILT_MODULE_NAME[0]="apple-bce" +DEST_MODULE_LOCATION[0]="/updates" +AUTOINSTALL="yes" +REMAKE_INITRD="yes" +EOF + 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 From ad56eff73db759826e3ad38da4e4aee2aff7706a Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 18:04:18 +1000 Subject: [PATCH 3/7] add CI There may be issues if it can't upload a 1.6GB artifact. May have to use the split zip version if it fails. --- .github/workflows/CI.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..297d9ac --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,43 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + [push] + + # Allows you to run this workflow manually from the Actions tab + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Build + run: sudo ./build.sh + + # Runs a set of commands using the runners shell + - name: print sha256sum + run: cat output/sha256 + + - name: Generate Tag + id: tag + run: | + VER=$(egrep ^KERNEL_VERSION build.sh|cut -d= -f2) + echo Version is $VER + echo "::set-output name=tag::${VER}" + + - name: Upload iso artifact + uses: actions/upload-artifact@v2 + with: + name: mbp-ubuntu-${{ steps.tag.outputs.tag }} + path: ${{ github.workspace }}/*.iso + From 07e804afd00a47cb938d40593714342d524908f2 Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 19:14:24 +1000 Subject: [PATCH 4/7] split iso into 500mb parts, may fix artifact download --- .github/workflows/CI.yml | 27 ++++++++++++++++++++++++--- build.sh | 2 +- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 297d9ac..6944367 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -35,9 +35,30 @@ jobs: echo Version is $VER echo "::set-output name=tag::${VER}" - - name: Upload iso artifact + - name: Upload iso artifact part 1 uses: actions/upload-artifact@v2 with: - name: mbp-ubuntu-${{ steps.tag.outputs.tag }} - path: ${{ github.workspace }}/*.iso + name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z01 + path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.z01 + + - name: Upload iso artifact part 2 + uses: actions/upload-artifact@v2 + with: + name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z02 + path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.z02 + + - name: Upload iso artifact part 3 + uses: actions/upload-artifact@v2 + with: + name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z03 + path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.z03 + + - name: Upload iso artifact part 4 + uses: actions/upload-artifact@v2 + with: + name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.zip + path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.zip + + - name: Instructions for putting it back together + run: echo cat livecd-${{ steps.tag.outputs.tag }}-mbp.z01 livecd-${{ steps.tag.outputs.tag }}-mbp.z02 livecd-${{ steps.tag.outputs.tag }}-mbp.z03 livecd-${{ steps.tag.outputs.tag }}-mbp.zip diff --git a/build.sh b/build.sh index 708b5cc..1598463 100755 --- a/build.sh +++ b/build.sh @@ -79,7 +79,7 @@ do fi ### Zip iso and split it into multiple parts - github max size of release attachment is 2GB, where ISO is sometimes bigger than that cd "${ROOT_PATH}" - zip -s 1500m "${ROOT_PATH}/output/livecd-${KERNEL_VERSION}-${ALTERNATIVE}.zip" "${ROOT_PATH}/ubuntu-20.04-${KERNEL_VERSION}-${ALTERNATIVE}.iso" + zip -s 500m "${ROOT_PATH}/output/livecd-${KERNEL_VERSION}-${ALTERNATIVE}.zip" "${ROOT_PATH}/ubuntu-20.04-${KERNEL_VERSION}-${ALTERNATIVE}.iso" done ### Calculate sha256 sums of built ISO sha256sum "${ROOT_PATH}"/*.iso >"${ROOT_PATH}/output/sha256" From be42bfb034effe59b6f252b542ccb227bb6450ea Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 19:48:02 +1000 Subject: [PATCH 5/7] fix unzip instructions --- .github/workflows/CI.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6944367..fe99dfd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -60,5 +60,9 @@ jobs: path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.zip - name: Instructions for putting it back together - run: echo cat livecd-${{ steps.tag.outputs.tag }}-mbp.z01 livecd-${{ steps.tag.outputs.tag }}-mbp.z02 livecd-${{ steps.tag.outputs.tag }}-mbp.z03 livecd-${{ steps.tag.outputs.tag }}-mbp.zip + run: | + echo Download all the artifacts, and put them in a folder without other files. Then run: + echo "for i in *; do file $i; done" + echo "cat livecd-${{ steps.tag.outputs.tag }}-mbp.z01 livecd-${{ steps.tag.outputs.tag }}-mbp.z02 livecd-${{ steps.tag.outputs.tag }}-mbp.z03 livecd-${{ steps.tag.outputs.tag }}-mbp.zip > cd.zip" + echo unzip cd.zip From e438ad4b521ba9dcc257992161e6080b75cc02be Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 21:08:31 +1000 Subject: [PATCH 6/7] Update CI.yml --- .github/workflows/CI.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fe99dfd..d828422 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -53,7 +53,8 @@ jobs: name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z03 path: ${{ github.workspace }}/output/livecd-${{ steps.tag.outputs.tag }}-mbp.z03 - - name: Upload iso artifact part 4 + - name: Upload iso artifact final part + if: always() uses: actions/upload-artifact@v2 with: name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.zip @@ -62,7 +63,7 @@ jobs: - name: Instructions for putting it back together run: | echo Download all the artifacts, and put them in a folder without other files. Then run: - echo "for i in *; do file $i; done" - echo "cat livecd-${{ steps.tag.outputs.tag }}-mbp.z01 livecd-${{ steps.tag.outputs.tag }}-mbp.z02 livecd-${{ steps.tag.outputs.tag }}-mbp.z03 livecd-${{ steps.tag.outputs.tag }}-mbp.zip > cd.zip" + echo 'unzip "*.z??.zip"' + echo 'cat livecd-${{ steps.tag.outputs.tag }}-mbp.z?? > cd.zip' echo unzip cd.zip From 1e245d20d37a255588f90cfb1f1e8b234f7e8ea8 Mon Sep 17 00:00:00 2001 From: Redecorating <69827514+Redecorating@users.noreply.github.com> Date: Sat, 10 Jul 2021 21:09:18 +1000 Subject: [PATCH 7/7] revert zip part size to 1.5GB --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1598463..708b5cc 100755 --- a/build.sh +++ b/build.sh @@ -79,7 +79,7 @@ do fi ### Zip iso and split it into multiple parts - github max size of release attachment is 2GB, where ISO is sometimes bigger than that cd "${ROOT_PATH}" - zip -s 500m "${ROOT_PATH}/output/livecd-${KERNEL_VERSION}-${ALTERNATIVE}.zip" "${ROOT_PATH}/ubuntu-20.04-${KERNEL_VERSION}-${ALTERNATIVE}.iso" + zip -s 1500m "${ROOT_PATH}/output/livecd-${KERNEL_VERSION}-${ALTERNATIVE}.zip" "${ROOT_PATH}/ubuntu-20.04-${KERNEL_VERSION}-${ALTERNATIVE}.iso" done ### Calculate sha256 sums of built ISO sha256sum "${ROOT_PATH}"/*.iso >"${ROOT_PATH}/output/sha256"