Skip to content

Commit 0ccfe46

Browse files
authored
fix: Remove rd.luks.options=discard karg & use --append-if-missing for kargs (#453)
* fix: Remove rd.luks.options=discard karg There is no need for it since it will be applied automatically with initramfs LUKS workaround. * Use --append-if-missing instead of --append for rpm-ostree kargs
1 parent 15c4fdd commit 0ccfe46

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

system_files/desktop/shared/usr/bin/bazzite-hardware-setup

+14-18
Original file line numberDiff line numberDiff line change
@@ -33,69 +33,69 @@ if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then
3333
echo "Checking for needed karg changes (Jupiter)"
3434

3535
if [[ ! $KARGS =~ "amd_pstate" ]]; then
36-
NEEDED_KARGS="$NEEDED_KARGS --append=amd_pstate=active"
36+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amd_pstate=active"
3737
fi
3838

3939
if [[ ! $KARGS =~ "amd_iommu" ]]; then
40-
NEEDED_KARGS="$NEEDED_KARGS --append=amd_iommu=off"
40+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amd_iommu=off"
4141
fi
4242

4343
if [[ ! $KARGS =~ "amdgpu.gttsize" ]]; then
4444
if [[ "$(awk '/MemTotal/{print $(NF-1)}' /proc/meminfo)" == "31664740" ]]; then
4545
echo "32GB RAM Steam Deck detected"
46-
NEEDED_KARGS="$NEEDED_KARGS --append=amdgpu.gttsize=16256"
46+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amdgpu.gttsize=16256"
4747
sed -i 's/zram-size=1024/zram-size=2048/g' /etc/systemd/zram-generator.conf
4848

4949
else
50-
NEEDED_KARGS="$NEEDED_KARGS --append=amdgpu.gttsize=8128"
50+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amdgpu.gttsize=8128"
5151
fi
5252
fi
5353

5454
if [[ ! $KARGS =~ "spi_amd.speed_dev" ]]; then
55-
NEEDED_KARGS="$NEEDED_KARGS --append=spi_amd.speed_dev=1"
55+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=spi_amd.speed_dev=1"
5656
fi
5757

5858
if [[ ! $KARGS =~ "initcall_blacklist" ]]; then
59-
NEEDED_KARGS="$NEEDED_KARGS --append=initcall_blacklist=simpledrm_platform_driver_init"
59+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=initcall_blacklist=simpledrm_platform_driver_init"
6060
fi
6161

6262
if [[ ! $KARGS =~ "modprobe.blacklist=sp5100_tco" ]]; then
63-
NEEDED_KARGS="$NEEDED_KARGS --append=modprobe.blacklist=sp5100_tco"
63+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=modprobe.blacklist=sp5100_tco"
6464
fi
6565
fi
6666

6767
if grep -qz "Kernel driver in use: radeon" <<< $GPU_ID; then
6868
echo "Legacy AMD hardware detected, enabling CIK and SI support in AMDGPU"
6969
if [[ ! $KARGS =~ "radeon.si_support" ]]; then
70-
NEEDED_KARGS="$NEEDED_KARGS --append=radeon.si_support=0"
70+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=radeon.si_support=0"
7171
fi
7272

7373
if [[ ! $KARGS =~ "radeon.cik_support" ]]; then
74-
NEEDED_KARGS="$NEEDED_KARGS --append=radeon.cik_support=0"
74+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=radeon.cik_support=0"
7575
fi
7676

7777
if [[ ! $KARGS =~ "amdgpu.si_support" ]]; then
78-
NEEDED_KARGS="$NEEDED_KARGS --append=amdgpu.si_support=1"
78+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amdgpu.si_support=1"
7979
fi
8080

8181
if [[ ! $KARGS =~ "amdgpu.cik_support" ]]; then
82-
NEEDED_KARGS="$NEEDED_KARGS --append=amdgpu.cik_support=1"
82+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=amdgpu.cik_support=1"
8383
fi
8484
fi
8585

8686
if [[ $IMAGE_FLAVOR =~ "nvidia" ]]; then
8787
echo "Checking for needed karg changes (Nvidia)"
8888

8989
if [[ ! $KARGS =~ "rd.driver.blacklist=nouveau" ]]; then
90-
NEEDED_KARGS="$NEEDED_KARGS --append=rd.driver.blacklist=nouveau"
90+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=rd.driver.blacklist=nouveau"
9191
fi
9292

9393
if [[ ! $KARGS =~ "modprobe.blacklist=nouveau" ]]; then
94-
NEEDED_KARGS="$NEEDED_KARGS --append=modprobe.blacklist=nouveau"
94+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=modprobe.blacklist=nouveau"
9595
fi
9696

9797
if [[ ! $KARGS =~ "nvidia-drm.modeset" ]]; then
98-
NEEDED_KARGS="$NEEDED_KARGS --append=nvidia-drm.modeset=1"
98+
NEEDED_KARGS="$NEEDED_KARGS --append-if-missing=nvidia-drm.modeset=1"
9999
fi
100100
else
101101
echo "Checking for needed karg changes"
@@ -118,10 +118,6 @@ if [[ $KARGS =~ "nomodeset" ]]; then
118118
NEEDED_KARGS="$NEEDED_KARGS --delete-if-present=nomodeset"
119119
fi
120120

121-
if [[ ! $KARGS =~ "rd.luks.options" ]]; then
122-
NEEDED_KARGS="$NEEDED_KARGS --append=rd.luks.options=discard"
123-
fi
124-
125121
if [[ $INITRAMFS =~ "disabled" ]]; then
126122
echo "Found needed initramfs changes, applying."
127123
plymouth display-message --text="Updating initramfs - Please wait, this may take a while" || true

0 commit comments

Comments
 (0)