Skip to content

Commit

Permalink
Merge pull request #10 from marcosfad/feature/alternativeRelease
Browse files Browse the repository at this point in the history
Create multiple releases
  • Loading branch information
marcosfad authored Jul 20, 2020
2 parents c0a929e + ba065dd commit 0824faa
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 48 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion build_image.sh → 02_build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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... "
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
Expand Down Expand Up @@ -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-kernel-release>-mbp linux-image-<mbp-kernel-release>-mbp
Expand All @@ -78,8 +96,8 @@ modprobe apple-bce
```

### Another way:
Check <https://github.com/marcosfad/mbp-ubuntu/blob/master/files/chroot_build.sh> to see how it is done.

Check <https://github.com/marcosfad/mbp-ubuntu/blob/master/files/chroot_build.sh> to see how it is done.

## Know issues

Expand Down
95 changes: 51 additions & 44 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: 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: Start loop... "
for ALTERNATIVE in mbp mbp-alt
do
echo >&2 "===]> Info: Start building ${ALTERNATIVE}... "

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 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: 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=$?
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
"

### 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}"

0 comments on commit 0824faa

Please sign in to comment.