From b0d35ad798d72ec5d9ca8fd5edc21456f7565ec0 Mon Sep 17 00:00:00 2001 From: Nikhil Jha Date: Jun 16 2020 04:16:48 +0000 Subject: release 5 --- diff --git a/.env b/.env index 4eae1cb..65e118e 100644 --- a/.env +++ b/.env @@ -9,7 +9,7 @@ OUT_NAME=fedora.img # Only needed if you want a custom file, otherwise do not change. # FEDORA_RAW_FILE=Fedora-Minimal-Rawhide-20200302.n.1.aarch64.raw.xz FEDORA_RAW_SOURCE=https://dl.fedoraproject.org/pub/fedora-secondary/development/rawhide/Spins/aarch64/images -KERNEL_RAW_DIR=pp-5.6 +KERNEL_RAW_DIR=pp1-5.7 export PP_IMAGE export PP_PARTA diff --git a/00-create-empty-image.sh b/00-create-empty-image.sh index c514901..5ef9492 100755 --- a/00-create-empty-image.sh +++ b/00-create-empty-image.sh @@ -14,5 +14,5 @@ echo if [[ $REPLY =~ ^[Yy]$ ]] then echo "Creating blank 3GB file called $OUT_NAME." - dd if=/dev/zero of=$OUT_NAME iflag=fullblock bs=1M count=3400 && sync + dd if=/dev/zero of=$OUT_NAME iflag=fullblock bs=1M count=4400 && sync fi diff --git a/02-install-rootfs.sh b/02-install-rootfs.sh index eb339f6..a8b858e 100755 --- a/02-install-rootfs.sh +++ b/02-install-rootfs.sh @@ -49,6 +49,9 @@ then infecho "Copying files..." rsync -a --progress imgfs/* rootfs/ + infecho "Deleting contents of /boot..." + rm -rf rootfs/boot/* + infecho "Unmounting everything..." umount /dev/loop0p3 losetup -d /dev/loop0 diff --git a/03-install-kernel.sh b/03-install-kernel.sh index 33c57d1..30bd840 100755 --- a/03-install-kernel.sh +++ b/03-install-kernel.sh @@ -37,11 +37,7 @@ read -p "Continue? [y/N] " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then - infecho "Changing directory..." - cd pp-5.6 - - # infecho "Generating boot.scr..." - # mkimage -A arm64 -T script -C none -d boot.cmd boot.scr + cd uboot infecho "Writing bootloader..." dd if=uboot.bin of=$PP_IMAGE bs=1024 seek=8 @@ -51,20 +47,12 @@ then infecho "Mounting SD card partitions..." mkdir -p bootfs - mkdir -p rootfs mount $PP_PARTA bootfs - mount $PP_PARTB rootfs - infecho "Copying boot.scr board.itb..." + infecho "Copying boot.scr..." cp files/boot.scr bootfs/ - cp pp-5.6/board.itb bootfs/ - - infecho "Installing kernel modules..." - rsync -a --progress pp-5.6/modules/lib/modules/* rootfs/lib/modules/ infecho "Unmounting SD card partitions..." umount $PP_PARTA - umount $PP_PARTB rmdir bootfs - rmdir rootfs fi diff --git a/04-edit-fstab.sh b/04-edit-fstab.sh index a544232..d85947c 100755 --- a/04-edit-fstab.sh +++ b/04-edit-fstab.sh @@ -40,8 +40,8 @@ then infecho "Fixing /etc/fstab..." cat files/fstab > rootfs/etc/fstab - infecho "Disabling kernel updates..." - cat files/dnf.conf > rootfs/etc/dnf/dnf.conf + infecho "Ensuring kernel updates won't break everything..." + cat files/yum/fedora.repo > /etc/yum.repos.d/fedora.repo infecho "Tweaking gschemas..." mkdir -p rootfs/usr/share/glib-2.0/schemas/files/ diff --git a/05-setup-user.sh b/05-setup-user.sh index ce2b686..8e0ec69 100755 --- a/05-setup-user.sh +++ b/05-setup-user.sh @@ -33,10 +33,14 @@ read -p "Continue? [y/N] " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then - infecho "Mounting rootfs..." + infecho "Mounting rootfs..." mkdir -p rootfs mount $PP_PARTB rootfs + infecho "Mounting bootfs..." + mkdir -p rootfs/boot + mount $PP_PARTA rootfs/boot + infecho "Installing qemu in rootfs..." cp /usr/bin/qemu-aarch64-static rootfs/usr/bin cp phone-scripts/* rootfs/root diff --git a/download-files.sh b/download-files.sh index 9fa0ff6..cd5fba3 100755 --- a/download-files.sh +++ b/download-files.sh @@ -11,7 +11,7 @@ echo if [[ $REPLY =~ ^[Yy]$ ]] then # Download kernel - wget https://xff.cz/kernels/5.6/pp.tar.gz -O pp.tar.gz + wget https://xff.cz/kernels/5.7/pp1.tar.gz -O pp.tar.gz tar xf pp.tar.gz # Get latest rawhide from repo when not set in .env diff --git a/files/yum/fedora.repo b/files/yum/fedora.repo new file mode 100644 index 0000000..bd059d4 --- /dev/null +++ b/files/yum/fedora.repo @@ -0,0 +1,37 @@ +[fedora] +name=Fedora $releasever - $basearch +#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ +metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch +enabled=0 +countme=1 +priority=20 +#metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[fedora-debuginfo] +name=Fedora $releasever - $basearch - Debug +#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/tree/ +metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch +enabled=0 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False + +[fedora-source] +name=Fedora $releasever - Source +#baseurl=http://download.example/pub/fedora/linux/releases/$releasever/Everything/source/tree/ +metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch +enabled=0 +metadata_expire=7d +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch +skip_if_unavailable=False diff --git a/phone-scripts/02-install-packages.sh b/phone-scripts/02-install-packages.sh index e58ce2f..dde0d8a 100644 --- a/phone-scripts/02-install-packages.sh +++ b/phone-scripts/02-install-packages.sh @@ -21,15 +21,27 @@ infecho "HEAVY WIP, untested" infecho "Enabling COPR repository..." dnf copr enable njha/mobile +infecho "Removing old kernel..." +infecho "THIS WILL FAIL, DON'T WORRY ITS PROBABLY OK" +dnf remove kernel || rpm -e --noscripts kernel-core +dnf install linux-firmware + +infecho "Installing kernel..." +dnf --disablerepo="*" --enablerepo="copr:copr.fedorainfracloud.org:njha:mobile" install kernel + infecho "Installing recommended packages..." -dnf install feedbackd phoc phosh squeekboard gdm ModemManager gnome-terminal rtl8723cs-firmware \ +dnf install feedbackd phoc phosh squeekboard gnome-shell ModemManager rtl8723cs-firmware \ f2fs-tools chatty calls carbons purple-mm-sms pinephone-helpers evolution-data-server \ - f31-backgrounds-gnome kgx epiphany gnome-contacts evolution cheese NetworkManager-wwan + f32-backgrounds-gnome kgx epiphany gnome-contacts evolution cheese NetworkManager-wwan \ + lightdm-mobile-greeter -infecho "Enabling graphical boot and GDM..." +infecho "Enabling graphical boot and lightdm..." systemctl disable initial-setup.service -systemctl enable gdm +systemctl enable lightdm systemctl set-default graphical.target +infecho "Making COPR higher priority for kernel updates..." +echo "priority=10" >> /etc/yum.repos.d/_copr\:copr.fedorainfracloud.org\:njha\:mobile.repo + infecho "Upgrading packages..." -dnf update --exclude="kernel kernel-core kernel-modules" +dnf update diff --git a/phone-scripts/03-enable-autoboot.sh b/phone-scripts/03-enable-autoboot.sh deleted file mode 100644 index 4d6ae1f..0000000 --- a/phone-scripts/03-enable-autoboot.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -e - -echo "===================" -echo "02-install-packages.sh" -echo "===================" - -# Functions -infecho () { - echo "[Info] $1" -} -errecho () { - echo "[Error] $1" 1>&2 - exit 1 -} - -infecho "This DELETES the gnome-shell desktop file so that gdm boots" -infecho "to phosh instead. This means you're wasting space keeping gnome-shell" -infecho "on your sdcard. It's inefficient but it'll do for now." - -infecho "Deleting all xorg based sessions..." -rm -fr /usr/share/xsessions/* - -infecho "Deleting gnome for wayland..." -rm /usr/share/wayland-sessions/gnome.desktop - -infecho "Installing autologin (ASSUMING DEFAULT SCRIPT USERNAME = PINE)..." -cat /root/gdm-custom.conf > /etc/gdm/custom.conf diff --git a/phone-scripts/all.sh b/phone-scripts/all.sh index b258287..f155e59 100755 --- a/phone-scripts/all.sh +++ b/phone-scripts/all.sh @@ -3,4 +3,3 @@ set -e bash /root/01-create-sudo-user.sh bash /root/02-install-packages.sh -bash /root/03-enable-autoboot.sh diff --git a/uboot/README b/uboot/README new file mode 100644 index 0000000..1f1bda5 --- /dev/null +++ b/uboot/README @@ -0,0 +1,7 @@ +Yes, there's a binary file in here. + +It's from a really old version (Feb 9, 2020) of Megi's 5.6 uboot build. + +The newer builds no longer contain u-boot :( + +This will be removed when the issue is fixed. diff --git a/uboot/uboot.bin b/uboot/uboot.bin new file mode 100644 index 0000000..6a955aa Binary files /dev/null and b/uboot/uboot.bin differ