diff --git a/build_file_system.sh b/01_build_file_system.sh similarity index 100% rename from build_file_system.sh rename to 01_build_file_system.sh diff --git a/build_image.sh b/02_build_image.sh similarity index 95% rename from build_image.sh rename to 02_build_image.sh index 60e97e2..b843809 100755 --- a/build_image.sh +++ b/02_build_image.sh @@ -21,7 +21,7 @@ cp "${ROOT_PATH}/files/grub/grub.cfg" "${IMAGE_PATH}"/isolinux/grub.cfg echo >&2 "===]> Info: Compress the chroot... " cd "${WORKING_PATH}" -mksquashfs chroot "${IMAGE_PATH}"/casper/filesystem.squashfs +mksquashfs "${CHROOT_PATH}" "${IMAGE_PATH}"/casper/filesystem.squashfs printf "%s" "$(du -sx --block-size=1 "${CHROOT_PATH}" | cut -f1)" >"${IMAGE_PATH}"/casper/filesystem.size echo >&2 "===]> Info: Create manifest... " diff --git a/prepare_iso.sh b/03_prepare_iso.sh similarity index 100% rename from prepare_iso.sh rename to 03_prepare_iso.sh diff --git a/create_iso.sh b/04_create_iso.sh similarity index 100% rename from create_iso.sh rename to 04_create_iso.sh diff --git a/README.md b/README.md index b10a79a..60b44a0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # mbp-ubuntu -The ISO in from this repo should allow you to install ubuntu without using an external keyboard or mouse on a MacBook Pro 16,1. It work in my MacBook Pro 16,1. +The ISO in from this repo should allow you to install ubuntu without using an external keyboard or mouse on a MacBook Pro. It work in my MacBook Pro 16,1. [![Build Status](https://travis-ci.com/marcosfad/mbp-ubuntu.svg?branch=master)](https://travis-ci.com/marcosfad/mbp-ubuntu) **If this repo helped you in any way, consider inviting a coffee to the people in the [credits](https://github.com/marcosfad/mbp-ubuntu#credits) or [me](https://paypal.me/marcosfad)** -UBUNTU 20.04 ISO with Apple T2 patches built-in (Macbooks produced >= 2018). +UBUNTU 20.04 ISO with Apple T2 patches built-in. Apple T2 drivers are integrated with this iso. @@ -20,6 +20,19 @@ Using additional drivers: Bootloader is configure correctly out of the box. No workaround needed. +## Before I begin, what version should I use "mbp" or "mbp-alt"? + +The difference between the two is that the mbp-alt includes the kernel with the 2001 Patch from the great Aunali1. +This patch made my screen blank, but it helped others to get rid of the blank screen. +So, here is a list, with what I know through discord members: + +MBP | mbp | mbp-alt +--- | --- | --- +16,1| x | +15,4| x | + +If your mbp is not listed, please try both version and tell me which one is working for you on the issue [Blank screen](https://github.com/marcosfad/mbp-ubuntu/issues/7) + ## Installation 1. Reduce the size of the mac partition in MacOS @@ -65,6 +78,11 @@ options hid_apple swap_opt_cmd=1 **IF YOU UPDATE THE KERNEL, REMEMBER TO ADD THE REQUIRED DRIVERS AGAIN.** ### The easy way: + +The live cd includes dkms and will automatically run when a new kernel is installed. You can use `dkms status` to see it. + +The step to install it from scratch would be: + ```bash sudo apt install dkms sudo apt install linux-headers--mbp linux-image--mbp @@ -78,8 +96,8 @@ modprobe apple-bce ``` ### Another way: -Check to see how it is done. +Check to see how it is done. ## Know issues diff --git a/build.sh b/build.sh index db62ce3..9ac3fd9 100755 --- a/build.sh +++ b/build.sh @@ -5,13 +5,16 @@ ROOT_PATH=$(pwd) WORKING_PATH=/root/work CHROOT_PATH="${WORKING_PATH}/chroot" IMAGE_PATH="${WORKING_PATH}/image" -#KERNEL_VERSION=5.4.0-29-generic -KERNEL_VERSION=5.6.19-mbp +KERNEL_VERSION=5.7.9 if [ -d "$WORKING_PATH" ]; then rm -rf "$WORKING_PATH" fi mkdir -p "$WORKING_PATH" +if [ -d "${ROOT_PATH}/output" ]; then + rm -rf "${ROOT_PATH}/output" +fi +mkdir -p "${ROOT_PATH}/output" echo >&2 "===]> Info: Build dependencies... " export DEBIAN_FRONTEND=noninteractive @@ -29,55 +32,59 @@ apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::=" isolinux \ syslinux -echo >&2 "===]> Info: Build Ubuntu FS... " -/bin/bash -c " - ROOT_PATH=${ROOT_PATH} \\ - WORKING_PATH=${WORKING_PATH} \\ - CHROOT_PATH=${CHROOT_PATH} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - KERNEL_VERSION=${KERNEL_VERSION} \\ - ${ROOT_PATH}/build_file_system.sh -" +echo >&2 "===]> Info: Start loop... " +for ALTERNATIVE in mbp mbp-alt +do + echo >&2 "===]> Info: Start building ${ALTERNATIVE}... " -echo >&2 "===]> Info: Build Image FS... " -/bin/bash -c " - ROOT_PATH=${ROOT_PATH} \\ - WORKING_PATH=${WORKING_PATH} \\ - CHROOT_PATH=${CHROOT_PATH} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - KERNEL_VERSION=${KERNEL_VERSION} \\ - ${ROOT_PATH}/build_image.sh -" + echo >&2 "===]> Info: Build Ubuntu FS... " + /bin/bash -c " + ROOT_PATH=${ROOT_PATH} \\ + WORKING_PATH=${WORKING_PATH} \\ + CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ + IMAGE_PATH=${IMAGE_PATH} \\ + KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ + ${ROOT_PATH}/01_build_file_system.sh + " -echo >&2 "===]> Info: Prepare Boot for ISO... " -/bin/bash -c " - IMAGE_PATH=${IMAGE_PATH} \\ - CHROOT_PATH=${CHROOT_PATH} \\ - ${ROOT_PATH}/prepare_iso.sh -" + echo >&2 "===]> Info: Build Image FS... " + /bin/bash -c " + ROOT_PATH=${ROOT_PATH} \\ + WORKING_PATH=${WORKING_PATH} \\ + CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ + IMAGE_PATH=${IMAGE_PATH} \\ + KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ + ${ROOT_PATH}/02_build_image.sh + " -echo >&2 "===]> Info: Create ISO... " -/bin/bash -c " - ROOT_PATH=${ROOT_PATH} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - CHROOT_PATH=${CHROOT_PATH} \\ - KERNEL_VERSION=${KERNEL_VERSION} \\ - ${ROOT_PATH}/create_iso.sh -" -livecd_exitcode=$? - -### 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}" -if [ -d "${ROOT_PATH}/output" ]; then - rm -rf "${ROOT_PATH}/output" -fi -mkdir -p "${ROOT_PATH}/output" -zip -s 1500m "${ROOT_PATH}/output/livecd.zip" ./*.iso + echo >&2 "===]> Info: Prepare Boot for ISO... " + /bin/bash -c " + IMAGE_PATH=${IMAGE_PATH} \\ + CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ + ${ROOT_PATH}/03_prepare_iso.sh + " + echo >&2 "===]> Info: Create ISO... " + /bin/bash -c " + ROOT_PATH=${ROOT_PATH} \\ + IMAGE_PATH=${IMAGE_PATH} \\ + CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ + KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ + ${ROOT_PATH}/04_create_iso.sh + " + livecd_exitcode=$? + if [ "${livecd_exitcode}" -ne 0 ]; then + echo "Error building ${KERNEL_VERSION}-${ALTERNATIVE}" + exit "${livecd_exitcode}" + 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" +done ### Calculate sha256 sums of built ISO sha256sum "${ROOT_PATH}"/*.iso >"${ROOT_PATH}/output/sha256" find ./ | grep ".iso" find ./ | grep ".zip" -exit "$livecd_exitcode" +exit "${livecd_exitcode}"