Allow using upper-cased "Y" to answer questions (#45)

This commit is contained in:
FLGX
2020-08-15 19:18:32 +02:00
committed by GitHub
parent 0c8886a2b2
commit ec0fcc15d2
6 changed files with 37 additions and 37 deletions

View File

@@ -57,7 +57,7 @@ _tkg_initscript() {
warning "Something is wrong with your cpusched selection. Do you want to fallback to CFS (default)?"
read -rp "`echo $' > N/y : '`" _fallback;
fi
if [ "$_fallback" == "y" ] || [ "$_nofallback" == "true" ]; then
if [[ "$_fallback" =~ [yY] ]] || [ "$_nofallback" == "true" ]; then
echo "_cpusched=\"cfs\"" > "$_where"/cpuschedset
else
error "Exiting..."
@@ -77,7 +77,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi
if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then
for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then
msg2 "######################################################"
@@ -99,7 +99,7 @@ user_patcher() {
printf '%s\n' "${_patches[@]}"
read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION;
fi
if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then
if [[ "$_CONDITION" =~ [yY] ]] || [ "$_user_patches_no_confirm" == "true" ]; then
for _f in "${_patches[@]}"; do
if [ -e "${_f}" ]; then
msg2 "######################################################"
@@ -610,7 +610,7 @@ _tkg_srcprep() {
plain "and analyzing of kernel functions."
read -rp "`echo $' > N/y : '`" CONDITION2;
fi
if [ "$CONDITION2" == "y" ] || [ "$_ftracedisable" == "true" ]; then
if [[ "$CONDITION2" =~ [yY] ]] || [ "$_ftracedisable" == "true" ]; then
sed -i -e 's/CONFIG_FUNCTION_TRACER=y/# CONFIG_FUNCTION_TRACER is not set/' ./.config
sed -i -e 's/CONFIG_FUNCTION_GRAPH_TRACER=y/# CONFIG_FUNCTION_GRAPH_TRACER is not set/' ./.config
fi
@@ -622,7 +622,7 @@ _tkg_srcprep() {
plain "https://bbs.archlinux.org/viewtopic.php?id=239174"
read -rp "`echo $' > N/y : '`" CONDITION3;
fi
if [ "$CONDITION3" == "y" ] || [ "$_numadisable" == "true" ]; then
if [[ "$CONDITION3" =~ [yY] ]] || [ "$_numadisable" == "true" ]; then
# disable NUMA since 99.9% of users do not have multiple CPUs but do have multiple cores in one CPU
sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
-i -e '/CONFIG_AMD_NUMA=y/d' \
@@ -689,7 +689,7 @@ _tkg_srcprep() {
plain "and improve throughput on other schedulers (at the cost of latency)"
read -rp "`echo $' > N/y : '`" CONDITION5;
fi
if [ "$CONDITION5" == "y" ] || [ "$_voluntary_preempt" == "true" ]; then
if [[ "$CONDITION5" =~ [yY] ]] || [ "$_voluntary_preempt" == "true" ]; then
sed -i -e 's/CONFIG_PREEMPT=y/# CONFIG_PREEMPT is not set/' ./.config
sed -i -e 's/CONFIG_PREEMPT_LL=y/# CONFIG_PREEMPT_LL is not set/' ./.config
sed -i -e 's/# CONFIG_PREEMPT_VOLUNTARY is not set/CONFIG_PREEMPT_VOLUNTARY=y/' ./.config
@@ -701,7 +701,7 @@ _tkg_srcprep() {
plain "Enable Device Tree and Open Firmware support?"
read -rp "`echo $' > N/y : '`" CONDITION6;
fi
if [ "$CONDITION6" == "y" ] || [ "$_OFenable" == "true" ]; then
if [[ "$CONDITION6" =~ [yY] ]] || [ "$_OFenable" == "true" ]; then
sed -i -e 's/# CONFIG_OF is not set/CONFIG_OF=y/' ./.config
fi
@@ -712,7 +712,7 @@ _tkg_srcprep() {
plain "https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#Bypassing_the_IOMMU_groups_.28ACS_override_patch.29"
read -rp "`echo $' > N/y : '`" CONDITION7;
fi
if [ "$CONDITION7" == "y" ] || [ "$_acs_override" == "true" ]; then
if [[ "$CONDITION7" =~ [yY] ]] || [ "$_acs_override" == "true" ]; then
msg2 "Patching ACS override"
patch -Np1 -i "$srcdir"/0006-add-acs-overrides_iommu.patch
fi
@@ -724,7 +724,7 @@ _tkg_srcprep() {
plain "https://bcachefs.org/"
read -rp "`echo $' > N/y : '`" CONDITION8;
fi
if [ "$CONDITION8" == "y" ] || [ "$_bcachefs" == "true" ]; then
if [[ "$CONDITION8" =~ [yY] ]] || [ "$_bcachefs" == "true" ]; then
msg2 "Patching Bcache filesystem support override"
patch -Np1 -i "$srcdir"/0008-5.7-bcachefs.patch
@@ -743,7 +743,7 @@ _tkg_srcprep() {
plain "https://steamcommunity.com/games/221410/announcements/detail/2957094910196249305"
read -rp "`echo $' > N/y : '`" CONDITION9;
fi
if [ "$CONDITION9" == "y" ] || [ "$_fsync" == "true" ]; then
if [[ "$CONDITION9" =~ [yY] ]] || [ "$_fsync" == "true" ]; then
msg2 "Patching Fsync support"
patch -Np1 -i "$srcdir"/0007-v5.7-fsync.patch
fi
@@ -755,7 +755,7 @@ _tkg_srcprep() {
plain "https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch"
read -rp "`echo $' > N/y : '`" CONDITION11;
fi
if [ "$CONDITION11" == "y" ] || [ "$_zfsfix" == "true" ]; then
if [[ "$CONDITION11" =~ [yY] ]] || [ "$_zfsfix" == "true" ]; then
msg2 "Patching missing symbol for AES-NI/AVX support on ZFS"
patch -Np1 -i "$srcdir"/0011-ZFS-fix.patch
fi
@@ -800,7 +800,7 @@ _tkg_srcprep() {
plain "!!!! Make sure to have a well populated db !!!!"
read -rp "`echo $' > N/y : '`" CONDITIONMPDB;
fi
if [ "$CONDITIONMPDB" == "y" ] || [ "$_modprobeddb" == "true" ]; then
if [[ "$CONDITIONMPDB" =~ [yY] ]] || [ "$_modprobeddb" == "true" ]; then
sudo modprobed-db recall
make localmodconfig
fi