-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.sh
168 lines (137 loc) · 4.98 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
# kiwi functions
test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile
set -xe
is_nvidia=false
if [ "$kiwi_profiles" == "with-KDE-nvidia" ] || [ "$kiwi_profiles" == "with-GNOME-nvidia" ]
then
is_nvidia=true
fi
BUILD_PACKAGES=false
TEMP_PACKAGES="git rpm-build cargo cmake gcc-c++ fontconfig-devel rpm-build"
if $BUILD_PACKAGES
then
zypper -n --gpg-auto-import-keys install $TEMP_PACKAGES
fi
# build and install some packages
if $BUILD_PACKAGES
then
cd /
git clone --depth 1 https://github.com/Kethen/opensuse_deck.git
cd opensuse_deck
cp rpmmacros ~/.rpmmacros
rpmbuild -bb deck-adaptation-for-opensuse.spec
zypper -n --gpg-auto-import-keys install --allow-unsigned-rpm rpmbuild/rpms/x86_64/deck-adaptation-for-opensuse-0.1-0.x86_64.rpm
cd /
rm -r opensuse_deck
else
zypper -n --gpg-auto-import-keys install --allow-unsigned-rpm https://github.com/Kethen/opensuse_deck/releases/download/2024-10-21/deck-adaptation-for-opensuse-0.1-0.x86_64.rpm
fi
if $BUILD_PACKAGES
then
git clone --depth 1 https://github.com/Kethen/Simple-Steam-Deck-TDP-Slider.git
cd Simple-Steam-Deck-TDP-Slider
rpmbuild -bb deck-tdp-slider.spec
zypper -n --gpg-auto-import-keys install --allow-unsigned-rpm rpmbuild/rpms/x86_64/deck-tdp-slider-0.1-0.x86_64.rpm
cd /
rm -rf Simple-Steam-Deck-TDP-Slider
rm -rf /root/.cargo
else
zypper -n --gpg-auto-import-keys install --allow-unsigned-rpm https://github.com/Kethen/Simple-Steam-Deck-TDP-Slider/releases/download/2023-09-13/deck-tdp-slider-0.1-0.x86_64.rpm
fi
if $BUILD_PACKAGES
then
zypper -n remove --clean-deps $TEMP_PACKAGES
zypper -n clean -a
fi
# install input methods and some fonts for fallback
set +e
zypper -n --gpg-auto-import-keys install 'google-noto-*' 'ibus-*'
status_code=$?
if [ "$status_code" != "107" ] && [ "$status_code" != "0" ]
then
echo zypper -n --gpg-auto-import-keys install 'google-noto-*' 'noto-*-fonts' 'ibus-*' exited with $status_code
exit 1
fi
set -e
# manpages
zypper -n --gpg-auto-import-keys install man man-pages
# copy screen orientation from opensuse_deck
tar -C /etc/skel -cO .local/share/kscreen | tar -C /home/deck -xv
chown -R deck:deck /home/deck/.local
# install nvidia drivers
if $is_nvidia
then
zypper -n clean -a
zypper -n --gpg-auto-import-keys install --auto-agree-with-licenses nvidia-video-G06 nvidia-video-G06-32bit nvidia-gl-G06 nvidia-gl-G06-32bit nvidia-compute-G06 nvidia-compute-G06-32bit nvidia-compute-utils-G06 2>/dev/null 1>/dev/null
# mark all nvidia devices witih uaccess
idx=0
while [ $idx -lt 128 ]
do
echo "L /run/udev/static_node-tags/uaccess/nvidia${idx} - - - - /dev/nvidia${idx}" >> /usr/lib/tmpfiles.d/nvidia-logind-acl-trick-G06-ext.conf
idx=$((idx + 1))
done
fi
# disable root
passwd -l root
# steamos update dummys sudoer file is 99
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/98_deck_pw_sudo
sed -i'' '/^ALL ALL=(ALL) ALL/d' /usr/etc/sudoers
sed -i'' '/^Defaults targetpw/d' /usr/etc/sudoers
# configure snapper as https://build.opensuse.org/package/show/openSUSE:Factory/openSUSE-MicroOS would
cp /usr/share/snapper/config-templates/default /etc/snapper/configs/root
sed -i'' 's/^TIMELINE_CREATE=.*$/TIMELINE_CREATE="no"/g' /etc/snapper/configs/root
sed -i'' 's/^NUMBER_LIMIT=.*$/NUMBER_LIMIT="2-10"/g' /etc/snapper/configs/root
sed -i'' 's/^NUMBER_LIMIT_IMPORTANT=.*$/NUMBER_LIMIT_IMPORTANT="4-10"/g' /etc/snapper/configs/root
baseUpdateSysConfig /etc/sysconfig/snapper SNAPPER_CONFIGS root
# toggle some services
systemctl enable NetworkManager
systemctl disable sshd
systemctl disable firewalld
systemctl enable earlyoom
# disable autoupdate
systemctl mask transactional-update.service
# force ibus
echo 'export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus' >> /etc/skel/.profile
cp /etc/skel/.profile /home/deck/.profile
chown deck:deck /home/deck/.profile
# cups access from group wheel
sed -i'' 's/^SystemGroup root/SystemGroup wheel/' /etc/cups/cups-files.conf
# lock firefox
zypper -n addlock MozillaFirefox
if false
then
# install kernel-default
zypper -n --gpg-auto-import-keys install kernel-default
fi
if true
then
# lock kernel-default away
zypper -n addlock kernel-default
rm -f /boot/vmlinuz*
rm -f /boot/initrd*
fi
if true
then
# install kernel-longterm
zypper -n --gpg-auto-import-keys install kernel-longterm
fi
if false
then
# install steamos kernels
mkdir steamos_kernel
cd steamos_kernel
#wget "https://steamdeck-packages.steamos.cloud/archlinux-mirror/jupiter-3.6/os/x86_64/linux-neptune-61-6.1.52.valve9-1-x86_64.pkg.tar.zst" -O - | zstd -d -T0 | tar -xv
wget "https://steamdeck-packages.steamos.cloud/archlinux-mirror/jupiter-3.6/os/x86_64/linux-neptune-65-6.5.0.valve21-1-x86_64.pkg.tar.zst" -O - | zstd -d -T0 | tar -xv
#VERSION=6.1.52-valve9-1-neptune-61
VERSION=6.5.0-valve21-1-neptune-65-g33487bf05ed3
mv usr/lib/modules/$VERSION /usr/lib/modules/$VERSION
cp /usr/lib/modules/$VERSION/vmlinuz /boot/vmlinuz-$VERSION
kernel-install add $VERSION /usr/lib/modules/$VERSION/vmlinuz
cd /
rm -rf steamos_kernel
fi
zypper -n clean -a