From ab0e7c0399d4db4a1c7cbc3168e196511fe2b9d4 Mon Sep 17 00:00:00 2001 From: Nikhil Jha Date: Mar 03 2020 03:47:35 +0000 Subject: install phosh by default :party: --- diff --git a/.env b/.env index 4a7147f..9d01943 100644 --- a/.env +++ b/.env @@ -7,7 +7,7 @@ PP_PARTA=/dev/sdc1 PP_PARTB=/dev/sdc2 # Only needed if you want a custom file, otherwise do not change. -FEDORA_RAW_FILE=Fedora-Workstation-Rawhide-20200224.n.0.aarch64.raw.xz +FEDORA_RAW_FILE=Fedora-Minimal-Rawhide-20200302.n.1.aarch64.raw.xz KERNEL_RAW_DIR=pp-5.6 export PP_SD_DEVICE diff --git a/00-download-files.sh b/00-download-files.sh index e5f4214..ef45212 100755 --- a/00-download-files.sh +++ b/00-download-files.sh @@ -4,7 +4,7 @@ set -e source .env echo "This may fail! This is because it is set to download a file that is too old." -echo "Please visit https://dl.fedoraproject.org/pub/fedora-secondary/development/rawhide/Workstation/aarch64/images/ and update the file name in .env with the new file name on that website." +echo "Please visit https://dl.fedoraproject.org/pub/fedora-secondary/development/rawhide/Spins/aarch64/images/ and update the file name in .env with the new file name on that website." echo "This script will download a few GB of Fedora and a few MB of Kernel into the current directory." echo "Look inside the script if you would rather download manually." @@ -18,6 +18,6 @@ then tar xf pp.tar.gz # Download fedora - wget https://dl.fedoraproject.org/pub/fedora-secondary/development/rawhide/Workstation/aarch64/images/$FEDORA_RAW_FILE -O rawhide.raw.xz + wget https://dl.fedoraproject.org/pub/fedora-secondary/development/rawhide/Spins/aarch64/images/$FEDORA_RAW_FILE -O rawhide.raw.xz xz --decompress rawhide.raw.xz fi diff --git a/05-setup-user.sh b/05-setup-user.sh index 93f832a..0d68f31 100755 --- a/05-setup-user.sh +++ b/05-setup-user.sh @@ -41,9 +41,17 @@ then cp /usr/bin/qemu-aarch64-static rootfs/usr/bin cp phone-scripts/* rootfs/root + infecho "Mounting your /dev into the rootfs..." + infecho "This is neccesary for dnf to work, because reasons." + mount --bind /dev rootfs/dev + infecho "Chrooting with qemu into rootfs..." chroot rootfs qemu-aarch64-static /bin/bash /root/all.sh + infecho "Unmounting your /dev from the rootfs..." + sleep 3 + umount rootfs/dev + infecho "Unmounting rootfs..." sleep 3 umount $PP_PARTB diff --git a/phone-scripts/02-disable-tracker.sh b/phone-scripts/02-disable-tracker.sh deleted file mode 100755 index 195d7c6..0000000 --- a/phone-scripts/02-disable-tracker.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e - -echo "=====================" -echo "02-disable-tracker.sh" -echo "=====================" - -echo "This disables GNOME Tracker." -systemctl mask tracker-store.service tracker-miner-fs.service tracker-miner-rss.service tracker-extract.service tracker-miner-apps.service tracker-writeback.service diff --git a/phone-scripts/02-install-packages.sh b/phone-scripts/02-install-packages.sh new file mode 100644 index 0000000..c7558fb --- /dev/null +++ b/phone-scripts/02-install-packages.sh @@ -0,0 +1,29 @@ +#!/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 adds my COPR repository (njha/mobile) and installs phone related packages." +infecho "Only functional on Fedora Rawhide." +infecho "HEAVY WIP, untested" + +infecho "Enabling COPR repository..." +dnf copr enable njha/mobile + +infecho "Installing recommended packages..." +dnf install feedbackd phoc phosh squeekboard gdm ModemManager + +infecho "Enabling graphical boot and GDM..." +systemctl enable gdm +systemctl enable graphical.target diff --git a/phone-scripts/03-enable-autoboot.sh b/phone-scripts/03-enable-autoboot.sh new file mode 100644 index 0000000..4d6ae1f --- /dev/null +++ b/phone-scripts/03-enable-autoboot.sh @@ -0,0 +1,28 @@ +#!/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 3f5f6e7..b258287 100755 --- a/phone-scripts/all.sh +++ b/phone-scripts/all.sh @@ -1,4 +1,6 @@ #!/bin/bash set -e -bash /root/01-create-sudo-user.sh \ No newline at end of file +bash /root/01-create-sudo-user.sh +bash /root/02-install-packages.sh +bash /root/03-enable-autoboot.sh diff --git a/phone-scripts/gdm-custom.conf b/phone-scripts/gdm-custom.conf new file mode 100644 index 0000000..25d9473 --- /dev/null +++ b/phone-scripts/gdm-custom.conf @@ -0,0 +1,18 @@ +# GDM configuration storage + +[daemon] +AutomaticLoginEnable=True +AutomaticLogin=pine +# Uncomment the line below to force the login screen to use Xorg +#WaylandEnable=false + +[security] + +[xdmcp] + +[chooser] + +[debug] +# Uncomment the line below to turn on debugging +#Enable=true +