This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xm-kernels
executable file
·53 lines (46 loc) · 1.89 KB
/
xm-kernels
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
#!/bin/bash
# -----------------------------------------------------------------------
# List kernels and base packages.
# Author: Mario Roy - http://github.com/marioroy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 or later of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# -----------------------------------------------------------------------
# Capture the active kernel release, to identify active kernel in output.
kversion="$(uname -r)" # e.g 6.1.54-100.xmbore
kvariant="${kversion}"
kvariant="${kvariant##*.}" # xmbore
kversion="${kversion%.*}" # 6.1.54-100
echo "XM boot-manager entries"
pattern1="^org\.clearlinux\.xm(clear|bore|echo|edge|main|lts|rt)"
for kernel in $(sudo clr-boot-manager list-kernels | sed "s/\*//" | sort); do
if [[ "$kernel" =~ $pattern1 ]]; then
if [[ "$kernel" == "org.clearlinux.${kvariant}.${kversion}" ]]; then
echo "* ${kernel}"
else
echo " ${kernel}"
fi
fi
done
echo
echo "XM installed packages (excluding dev,extra,license)"
pattern2="^linux-xm(clear|bore|echo|edge|main|lts|rt)"
for package in $(rpm -qa | grep -Ev -- "-(license|extra|dev|cpio)-" | sort); do
if [[ "$package" =~ $pattern2 ]]; then
if [[ "$package" == "linux-${kvariant}-${kversion}.x86_64" ]]; then
echo "* ${package//.x86_64/}"
else
echo " ${package//.x86_64/}"
fi
fi
done
echo