Skip to content

Commit

Permalink
always add newline first when writing to /boot/config.txt
Browse files Browse the repository at this point in the history
also give user choice in Geekbench 6 and QEMU which are 16K pagesize incompatible
  • Loading branch information
theofficialgman committed Oct 31, 2023
1 parent be1d706 commit 8b67f28
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions apps/Box86/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Would you like to automatically switch to a 4K PageSize Linux Kernel?"
if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
error "User error: Your current running kernel is built with 16K PageSize and is incompatible with Box86. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing Box86."
fi
echo "" | sudo tee --append /boot/config.txt >/dev/null
echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
"${DIRECTORY}/manage" uninstall "Box64"
Expand Down
13 changes: 11 additions & 2 deletions apps/Geekbench 6/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ PAGE_SIZE="$(getconf PAGE_SIZE)"
if [[ "$PAGE_SIZE" == "16384" ]]; then
#switch to 4K pagesize kernel
if [ -f /boot/config.txt ]; then
text="Raspberry Pi 5 PiOS images ship by default with a 16K PageSize Linux Kernel.
This kernel causes incompatibilities with some software including Geekbench 6 https://github.com/raspberrypi/bookworm-feedback/issues/107
Would you like to automatically switch to a 4K PageSize Linux Kernel?"
userinput_func "$text" "No, keep 16K PageSize Kernel and Exit" "Yes, switch to 4K PageSize Kernel"
if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
error "User error: Your current running kernel is built with 16K PageSize and is incompatible with Geekbench 6. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing Geekbench 6."
fi
echo "" | sudo tee --append /boot/config.txt >/dev/null
echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the Geekbench6 app again."
echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the Geekbench 6 app again."
sleep infinity
else
error "User error (reporting allowed): Your current running kernel is build with 16K PageSize and is incompatible with Geekbench6. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
error "User error (reporting allowed): Your current running kernel is built with 16K PageSize and is incompatible with Geekbench 6. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
fi
fi

Expand Down
11 changes: 10 additions & 1 deletion apps/QEMU/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@ PAGE_SIZE="$(getconf PAGE_SIZE)"
if [[ "$PAGE_SIZE" == "16384" ]]; then
#switch to 4K pagesize kernel
if [ -f /boot/config.txt ]; then
text="Raspberry Pi 5 PiOS images ship by default with a 16K PageSize Linux Kernel.
This kernel causes incompatibilities with some software including QEMU https://github.com/raspberrypi/bookworm-feedback/issues/107
Would you like to automatically switch to a 4K PageSize Linux Kernel?"
userinput_func "$text" "No, keep 16K PageSize Kernel and Exit" "Yes, switch to 4K PageSize Kernel"
if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
error "User error: Your current running kernel is built with 16K PageSize and is incompatible with QEMU. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing QEMU."
fi
echo "" | sudo tee --append /boot/config.txt >/dev/null
echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
echo -e "The 4K PageSize Kernel has been enabled by adding 'kernel=kernel8.img' to /boot/config.txt\nPlease reboot and install the QEMU app again."
sleep infinity
else
error "User error (reporting allowed): Your current running kernel is build with 16K PageSize and is incompatible with QEMU. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
error "User error (reporting allowed): Your current running kernel is built with 16K PageSize and is incompatible with QEMU. Changing kernels automatically cannot be done since no /boot/config.txt file was found."
fi
fi

Expand Down
1 change: 1 addition & 0 deletions apps/Wine (x64)/install-64
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Would you like to automatically switch to a 4K PageSize Linux Kernel?"
if [ "$output" == "No, keep 16K PageSize Kernel and Exit" ]; then
error "User error: Your current running kernel is built with 16K PageSize and is incompatible with Wine (x64) with Box64. You must switch to a 4K PageSize kernel (and chose to not do so automatically) before installing Wine (x64)."
fi
echo "" | sudo tee --append /boot/config.txt >/dev/null
echo "[pi5]" | sudo tee --append /boot/config.txt >/dev/null
echo "kernel=kernel8.img" | sudo tee --append /boot/config.txt >/dev/null
"${DIRECTORY}/manage" uninstall "Box64"
Expand Down

0 comments on commit 8b67f28

Please sign in to comment.