Un fedoraize
This commit is contained in:
parent
ee72e3b09c
commit
4d9a1c39fb
29
.github/workflows/build-fc40-x86_64.yml
vendored
29
.github/workflows/build-fc40-x86_64.yml
vendored
@ -1,29 +0,0 @@
|
||||
name: RPM Build (Fedora 40 - x86-64)
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: fedora:40
|
||||
volumes:
|
||||
- /proc:/proc
|
||||
options: --privileged -it
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup RPM Source
|
||||
run: mkdir -p ./SOURCES && tar -pczf ./SOURCES/fedora-kernel-manager.tar.gz --exclude="../$(basename "$PWD")/SOURCES/fedora-kernel-manager.tar.gz" ../$(basename "$PWD")
|
||||
|
||||
- name: Get RPM Spec BuildRequires
|
||||
run: dnf install wget cpio mock tar pykickstart fedpkg libvirt fedora-packager rpmdevtools 'dnf-command(builddep)' -y && dnf builddep fedora-kernel-manager.spec -y
|
||||
|
||||
- name: Build RPM package
|
||||
run: rpmbuild -bb fedora-kernel-manager.spec --define "_rpmdir $(pwd)/packages" --define "_topdir $(pwd)/"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v1.0.0
|
||||
with:
|
||||
name: Binary RPM
|
||||
path: packages/x86_64/
|
5
.idea/.gitignore
vendored
5
.idea/.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="EMPTY_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/fedora-kernel-manager.iml" filepath="$PROJECT_DIR$/.idea/fedora-kernel-manager.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
40
Cargo.lock
generated
40
Cargo.lock
generated
@ -349,26 +349,6 @@ version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
|
||||
|
||||
[[package]]
|
||||
name = "fedora-kernel-manager"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"duct",
|
||||
"glib",
|
||||
"glib-build-tools",
|
||||
"gtk4",
|
||||
"homedir",
|
||||
"libadwaita",
|
||||
"linux-version",
|
||||
"os_pipe",
|
||||
"reqwest",
|
||||
"rust-i18n",
|
||||
"serde_json",
|
||||
"textwrap",
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "field-offset"
|
||||
version = "0.3.6"
|
||||
@ -1446,6 +1426,26 @@ version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "pika-kernel-manager"
|
||||
version = "0.1.4"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"duct",
|
||||
"glib",
|
||||
"glib-build-tools",
|
||||
"gtk4",
|
||||
"homedir",
|
||||
"libadwaita",
|
||||
"linux-version",
|
||||
"os_pipe",
|
||||
"reqwest",
|
||||
"rust-i18n",
|
||||
"serde_json",
|
||||
"textwrap",
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.14"
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "fedora-kernel-manager"
|
||||
name = "pika-kernel-manager"
|
||||
version = "0.1.4"
|
||||
edition = "2021"
|
||||
|
||||
|
60
Makefile
60
Makefile
@ -11,50 +11,50 @@ build_debug:
|
||||
|
||||
install_no_build:
|
||||
mkdir -p $(DESTDIR)/usr/bin/
|
||||
cp -vf target/release/fedora-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/fedora-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/fedora-kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf target/release/pika-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pika-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/pika/kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
mkdir -p $(DESTDIR)/usr/share/applications
|
||||
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -rvf data/polkit-1 $(DESTDIR)/usr/share/
|
||||
|
||||
install_no_build_debug:
|
||||
mkdir -p $(DESTDIR)/usr/bin/
|
||||
cp -vf target/debug/fedora-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/fedora-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/fedora-kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf target/debug/pika-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pika-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/pika/kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
mkdir -p $(DESTDIR)/usr/share/applications
|
||||
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -rvf data/polkit-1 $(DESTDIR)/usr/share/
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)/usr/bin/
|
||||
cargo fetch
|
||||
cargo build --release
|
||||
cp -vf target/release/fedora-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/fedora-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/fedora-kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/fedora-kernel-manager/
|
||||
cp -vf target/release/pika-kernel-manager $(DESTDIR)/usr/bin/
|
||||
chmod 755 $(DESTDIR)/usr/bin/pika-kernel-manager
|
||||
mkdir -p $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/scripts $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
chmod 755 $(DESTDIR)/usr/lib/pika/kernel-manager/scripts/*.sh
|
||||
cp -rvf data/locales $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -rvf data/kernel_branches $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
cp -vf data/scx_scheds.json $(DESTDIR)/usr/lib/pika/kernel-manager/
|
||||
mkdir -p $(DESTDIR)/usr/share/applications
|
||||
mkdir -p $(DESTDIR)/usr/share/icons/hicolor/scalable/apps
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.cosmicfusion.fedora-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/apps/
|
||||
cp -vf data/com.github.pikaos-linux.pika-kernel-manager.desktop $(DESTDIR)/usr/share/applications/
|
||||
cp -rvf data/polkit-1 $(DESTDIR)/usr/share/
|
136
README.MD
136
README.MD
@ -1,136 +0,0 @@
|
||||
![APP ICON](https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/data/com.github.cosmicfusion.fedora-kernel-manager.svg)
|
||||
|
||||
### Intro
|
||||
|
||||
Fedora Kernel Manager is a rust written libadwaita app that allows installing/uninstalling kernel packages from "Kernel Branch Providers" and Selecting SCX Schedulers.
|
||||
|
||||
These kernel branches are json files in ```/usr/lib/fedora-kernel-manager/kernel_branches/```
|
||||
|
||||
## Example of Kernel Branch
|
||||
|
||||
```xpath
|
||||
/usr/lib/fedora-kernel-manager/kernel_branches/kernel-cachyos.json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"name": "kernel-cachyos",
|
||||
"db_url": "https://raw.githubusercontent.com/sirlucjan/copr-linux-cachyos/master/sources/cachyos-fkm-config/db_kernel_cachy.json",
|
||||
"init_script": "pkexec /usr/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh"
|
||||
}
|
||||
```
|
||||
|
||||
`name` obviously refers to branch name shown to users
|
||||
|
||||
`db_url` the url to this branch DB that gets downloaded at run time when users open the app
|
||||
|
||||
`init_script` a command to run upon reading the branch json usually this has a repo check and repo addition with policykit rule to not ask for a password
|
||||
|
||||
See:
|
||||
|
||||
```xpath
|
||||
/usr/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh
|
||||
```
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
YUM_CHANGED=false
|
||||
KERNEL_CACHYOS_REPO_FILE='/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:bieszczaders:kernel-cachyos.repo'
|
||||
KERNEL_CACHYOS_ADDONS_REPO_FILE='/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:bieszczaders:kernel-cachyos-addons.repo'
|
||||
|
||||
if [ ! -f $KERNEL_CACHYOS_REPO_FILE ]
|
||||
then
|
||||
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-fedora-$(rpm -E %fedora).repo -O $KERNEL_CACHYOS_REPO_FILE
|
||||
YUM_CHANGED=true
|
||||
fi
|
||||
|
||||
if [ ! -f $KERNEL_CACHYOS_ADDONS_REPO_FILE ]
|
||||
then
|
||||
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-addons/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-addons-fedora-$(rpm -E %fedora).repo -O $KERNEL_CACHYOS_ADDONS_REPO_FILE
|
||||
YUM_CHANGED=true
|
||||
fi
|
||||
if [ YUM_CHANGED == true ]
|
||||
then
|
||||
dnf repoquery
|
||||
fi
|
||||
```
|
||||
|
||||
### Kernel Branch DB
|
||||
This is the json file the db_url references, it is not to be packaged only hosted and maintained by the kernel branch providers
|
||||
|
||||
## Example of Kernel Branch DB
|
||||
|
||||
```xpath
|
||||
https://raw.githubusercontent.com/sirlucjan/copr-linux-cachyos/master/sources/cachyos-fkm-config/db_kernel_cachy.json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"latest_kernel_version_deter_pkg": "kernel-cachyos",
|
||||
"kernels": [
|
||||
{
|
||||
"name": "CachyOS Default Kernel",
|
||||
"main_package": "kernel-cachyos",
|
||||
"packages": "kernel-cachyos kernel-cachyos-devel-matched",
|
||||
"min_x86_march": "3"
|
||||
},
|
||||
{
|
||||
"name": "CachyOS LTS Kernel",
|
||||
"main_package": "kernel-cachyos-lts",
|
||||
"packages": "kernel-cachyos-lts kernel-cachyos-lts-devel-matched",
|
||||
"min_x86_march": "2"
|
||||
},
|
||||
{
|
||||
"name": "Sched EXT SCX",
|
||||
"main_package": "sched-ext-scx",
|
||||
"packages": "sched-ext-scx",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "UKSMD Daemon",
|
||||
"main_package": "uksmd",
|
||||
"packages": "uksmd",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "CachyOS-Settings",
|
||||
"main_package": "cachyos-settings",
|
||||
"packages": "cachyos-settings",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "Ananicy-CPP",
|
||||
"main_package": "ananicy-cpp",
|
||||
"packages": "ananicy-cpp",
|
||||
"min_x86_march": "1"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
`latest_kernel_version_deter_pkg` The kernel manager informs the user of what is the latest version hosted by their selected branch.
|
||||
This is done by reading the version of the rpm package set in this json value.
|
||||
|
||||
`kernels` The array where the branch provider input all the "Kernels"/Packages to be shown to the user each should have the following values:
|
||||
|
||||
* `name` The Pretty name of the package.
|
||||
* `main_package` The primary package (only 1) of entry it is used to get the description and version of the entry.
|
||||
* `packages` One or more package, it refers to what actually gets installed and removed.
|
||||
* `min_x86_march` The minimum x86 micro-architecture needed, if the user has `x86-64-v3` and this value is set to `4` the entry will not be displayed to the user.
|
||||
|
||||
### Translation
|
||||
|
||||
Contribute translations to this project via [Weblate](https://hosted.weblate.org/projects/cosmicfusion/fedora-kernel-manager/)
|
||||
|
||||
### GUI
|
||||
|
||||
## Primary Page
|
||||
![Primary Page](https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/assets/main_page.png)
|
||||
|
||||
## Branch Selection
|
||||
![Branch Selection](https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/assets/branch_select.png)
|
||||
|
||||
## SCX Sched Selection Page
|
||||
![SCX Sched Selection Page](https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/assets/scx_select.png)
|
||||
|
||||
## Kernel Install Page
|
||||
![Kernel Install Page](https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/assets/kernel_install.png)
|
Binary file not shown.
Before Width: | Height: | Size: 47 KiB |
Binary file not shown.
Before Width: | Height: | Size: 59 KiB |
Binary file not shown.
Before Width: | Height: | Size: 44 KiB |
Binary file not shown.
Before Width: | Height: | Size: 41 KiB |
@ -1,7 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Name=Fedora Kernel Manager
|
||||
Exec=fedora-kernel-manager
|
||||
Icon=com.github.cosmicfusion.fedora-kernel-manager
|
||||
Name=PikaOS Kernel Manager
|
||||
Exec=pika-kernel-manager
|
||||
Icon=com.github.pikaos-linux.pika-kernel-manager
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Encoding=UTF-8
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@ -1,11 +0,0 @@
|
||||
{
|
||||
"latest_kernel_version_deter_pkg": "kernel",
|
||||
"kernels": [
|
||||
{
|
||||
"name": "Default Kernel",
|
||||
"main_package": "kernel",
|
||||
"packages": "kernel kernel-devel-matched",
|
||||
"min_x86_march": "1"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
"latest_kernel_version_deter_pkg": "kernel-cachyos",
|
||||
"kernels": [
|
||||
{
|
||||
"name": "CachyOS Default Kernel",
|
||||
"main_package": "kernel-cachyos",
|
||||
"packages": "kernel-cachyos kernel-cachyos-devel-matched",
|
||||
"min_x86_march": "3"
|
||||
},
|
||||
{
|
||||
"name": "CachyOS LTS Kernel",
|
||||
"main_package": "kernel-cachyos-lts",
|
||||
"packages": "kernel-cachyos-lts kernel-cachyos-lts-devel-matched",
|
||||
"min_x86_march": "2"
|
||||
},
|
||||
{
|
||||
"name": "Sched EXT SCX",
|
||||
"main_package": "sched-ext-scx",
|
||||
"packages": "sched-ext-scx",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "UKSMD Daemon",
|
||||
"main_package": "uksmd",
|
||||
"packages": "uksmd",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "CachyOS-Settings",
|
||||
"main_package": "cachyos-settings",
|
||||
"packages": "cachyos-settings",
|
||||
"min_x86_march": "1"
|
||||
},
|
||||
{
|
||||
"name": "Ananicy-CPP",
|
||||
"main_package": "ananicy-cpp",
|
||||
"packages": "ananicy-cpp",
|
||||
"min_x86_march": "1"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "kernel-cachyos",
|
||||
"db_url": "https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/data/db_kernel_cachy.json",
|
||||
"init_script": "pkexec /usr/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh"
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "kernel (RPM Default)",
|
||||
"db_url": "https://raw.githubusercontent.com/CosmicFusion/fedora-kernel-manager/main/data/db_kernel.json",
|
||||
"init_script": "true"
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"application_name": "Fedora Kernel Manager",
|
||||
"application_name": "PikaOS Kernel Manager",
|
||||
"developer_name": "Cosmo",
|
||||
"banner_text_no_internet": "Warning: No internet connection",
|
||||
"banner_text_url_error": "Kernel Database URL Error: Please Restart!",
|
||||
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC
|
||||
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="fkm.kernel.cachyos.init">
|
||||
<message>Authentication is required to initialize the Cachyos kernel repo</message>
|
||||
<icon_name>com.github.cosmicfusion.fedora-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
||||
</policyconfig>
|
@ -4,15 +4,15 @@
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="fkm.change.scx">
|
||||
<action id="pkm.change.scx">
|
||||
<message>Authentication is required to change the SCX Scheduler</message>
|
||||
<icon_name>com.github.cosmicfusion.fedora-kernel-manager</icon_name>
|
||||
<icon_name>com.github.pikaos-linux.pika-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/fedora-kernel-manager/scripts/change_scx.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/pika/kernel-manager/scripts/change_scx.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
@ -4,15 +4,15 @@
|
||||
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
|
||||
<policyconfig>
|
||||
|
||||
<action id="fkm.modify.package">
|
||||
<action id="pkm.modify.package">
|
||||
<message>Authentication is required to modify system packages</message>
|
||||
<icon_name>com.github.cosmicfusion.fedora-kernel-manager</icon_name>
|
||||
<icon_name>com.github.pikaos-linux.pika-kernel-manager</icon_name>
|
||||
<defaults>
|
||||
<allow_any>auth_admin</allow_any>
|
||||
<allow_inactive>auth_admin</allow_inactive>
|
||||
<allow_active>auth_admin</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/fedora-kernel-manager/scripts/modify_package.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/usr/lib/pika/kernel-manager/scripts/modify_package.sh</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
|
@ -1,6 +0,0 @@
|
||||
/* Allow passwordless auth for fkm.kernel.cachyos.init
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (action.id == "fkm.kernel.cachyos.init") {
|
||||
return polkit.Result.YES;
|
||||
}
|
||||
});
|
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/com/github/cosmicfusion/fedora-kernel-manager/icons/scalable/actions/">
|
||||
<gresource prefix="/com/github/cosmicfusion/pika-kernel-manager/icons/scalable/actions/">
|
||||
<file compressed="true" preprocess="xml-stripblanks">tux-symbolic.svg</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">tux-download-symbolic.svg</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">tux-settings-symbolic.svg</file>
|
||||
</gresource>
|
||||
<gresource prefix="/com/github/cosmicfusion/fedora-kernel-manager/css/">
|
||||
<gresource prefix="/com/github/cosmicfusion/pika-kernel-manager/css/">
|
||||
<file compressed="true">style.css</file>
|
||||
</gresource>
|
||||
</gresources>
|
@ -2,10 +2,8 @@
|
||||
|
||||
if [[ $1 == "version" ]]
|
||||
then
|
||||
#apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1
|
||||
dnf info $2 2> /dev/null | grep Version | cut -d":" -f2 | head -n1
|
||||
apt-cache show $2 | grep Version: | cut -d":" -f2 | head -n1
|
||||
elif [[ $1 == "description" ]]
|
||||
then
|
||||
#apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
|
||||
dnf info $2 2> /dev/null | sed -n '/Description/,/^$/p' | awk 'NR==1,/^$/ {if (/^$/ && printed) exit; if (NF) printed=1; if (NR==1) sub(/Description *: */, ""); else sub(/^ *: */, ""); print}'
|
||||
apt-cache show $2 | grep 'Description*' | cut -d":" -f2 | head -n1
|
||||
fi
|
@ -1,22 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
YUM_CHANGED=false
|
||||
KERNEL_CACHYOS_REPO_FILE='/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:bieszczaders:kernel-cachyos.repo'
|
||||
KERNEL_CACHYOS_ADDONS_REPO_FILE='/etc/yum.repos.d/_copr:copr.fedorainfracloud.org:bieszczaders:kernel-cachyos-addons.repo'
|
||||
|
||||
if [ ! -f $KERNEL_CACHYOS_REPO_FILE ]
|
||||
then
|
||||
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-fedora-$(rpm -E %fedora).repo -O $KERNEL_CACHYOS_REPO_FILE
|
||||
YUM_CHANGED=true
|
||||
fi
|
||||
|
||||
if [ ! -f $KERNEL_CACHYOS_ADDONS_REPO_FILE ]
|
||||
then
|
||||
wget https://copr.fedorainfracloud.org/coprs/bieszczaders/kernel-cachyos-addons/repo/fedora-$(rpm -E %fedora)/bieszczaders-kernel-cachyos-addons-fedora-$(rpm -E %fedora).repo -O $KERNEL_CACHYOS_ADDONS_REPO_FILE
|
||||
YUM_CHANGED=true
|
||||
fi
|
||||
|
||||
if [ YUM_CHANGED == true ]
|
||||
then
|
||||
dnf repoquery
|
||||
fi
|
@ -2,10 +2,11 @@
|
||||
|
||||
set -e
|
||||
|
||||
if rpm -q "$1"
|
||||
if dpkg -s "$1"
|
||||
then
|
||||
dnf remove -y "$1"
|
||||
apt remove -y "$1"
|
||||
apt autremove -y
|
||||
else
|
||||
dnf install -y "$1"
|
||||
apt install -y "$1"
|
||||
fi
|
||||
exit 0
|
@ -1,67 +0,0 @@
|
||||
%define pkg_release 0.1.4
|
||||
|
||||
|
||||
Name: fedora-kernel-manager
|
||||
Version: %{pkg_release}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Libraries
|
||||
Summary: A Libadwaita rust based application for managing and installing kernels.
|
||||
|
||||
|
||||
URL: https://github.com/CosmicFusion/fedora-kernel-manager
|
||||
Source0: %{URL}/releases/download/%{pkg_release}/fedora-kernel-manager.tar.gz
|
||||
|
||||
BuildRequires: wget
|
||||
BuildRequires: cargo
|
||||
BuildRequires: gdk-pixbuf2-devel
|
||||
BuildRequires: gtk4-devel
|
||||
BuildRequires: gtk3-devel
|
||||
BuildRequires: libadwaita-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: llvm-devel
|
||||
BuildRequires: clang-devel
|
||||
|
||||
Requires: /usr/bin/bash
|
||||
Requires: gtk4
|
||||
Requires: gtk3
|
||||
Requires: libadwaita
|
||||
Requires: glib2
|
||||
Requires: util-linux
|
||||
Requires: polkit
|
||||
Requires: iputils
|
||||
|
||||
Recommends: scx-scheds
|
||||
|
||||
%description
|
||||
A Libadwaita rust based application for managing and installing kernels.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n fedora-kernel-manager
|
||||
|
||||
%build
|
||||
DESTDIR=%{buildroot} make install
|
||||
|
||||
%files
|
||||
%{_prefix}/lib/fedora-kernel-manager/*
|
||||
%{_bindir}/*
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/icons/hicolor/scalable/apps/*.svg
|
||||
%{_datadir}/polkit-1/actions/fkm.change.scx.policy
|
||||
%{_datadir}/polkit-1/actions/fkm.modify.package.policy
|
||||
%{_prefix}/lib/fedora-kernel-manager/kernel_branches/kernel.json
|
||||
%exclude %{_prefix}/lib/fedora-kernel-manager/kernel_branches/kernel-cachyos.json
|
||||
%exclude %{_prefix}/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh
|
||||
|
||||
%package cachyos-config
|
||||
Summary: Config files to enable coprs/bieszczaders/kernel-cachyos in fedora-kernel-manager.
|
||||
Requires: fedora-kernel-manager
|
||||
|
||||
%description cachyos-config
|
||||
Config files to enable coprs/bieszczaders/kernel-cachyos in fedora-kernel-manager.
|
||||
|
||||
%files cachyos-config
|
||||
%{_prefix}/lib/fedora-kernel-manager/kernel_branches/kernel-cachyos.json
|
||||
%{_prefix}/lib/fedora-kernel-manager/scripts/kernel-cachyos-init.sh
|
||||
%{_datadir}/polkit-1/actions/fkm.kernel.cachyos.init.policy
|
||||
%{_datadir}/polkit-1/rules.d/99-fkm.kernel.cachyos.init.rules
|
@ -138,8 +138,8 @@ pub fn build_ui(app: &adw::Application) {
|
||||
fn load_icon_theme(window: &adw::ApplicationWindow) {
|
||||
let icon_theme = gtk::IconTheme::for_display(&WidgetExt::display(window));
|
||||
|
||||
icon_theme.add_resource_path("/com/github/cosmicfusion/fedora-kernel-manager/icons/");
|
||||
icon_theme.add_resource_path("/com/github/cosmicfusion/pika-kernel-manager/icons/");
|
||||
icon_theme.add_resource_path(
|
||||
"/com/github/cosmicfusion/fedora-kernel-manager/icons/scalable/actions/",
|
||||
"/com/github/cosmicfusion/pika-kernel-manager/icons/scalable/actions/",
|
||||
);
|
||||
}
|
||||
|
@ -268,8 +268,8 @@ fn kernel_branch_expandable(
|
||||
}),
|
||||
);
|
||||
|
||||
match get_my_home().unwrap().unwrap().join(".config/fedora-kernel-manager/branch").exists() {
|
||||
true if fs::read_to_string(get_my_home().unwrap().unwrap().join(".config/fedora-kernel-manager/branch")).unwrap().trim().eq(branch_clone1.name.trim()) =>
|
||||
match get_my_home().unwrap().unwrap().join(".config/pika-kernel-manager/branch").exists() {
|
||||
true if fs::read_to_string(get_my_home().unwrap().unwrap().join(".config/pika-kernel-manager/branch")).unwrap().trim().eq(branch_clone1.name.trim()) =>
|
||||
{
|
||||
branch_checkbutton.set_active(true)
|
||||
}
|
||||
@ -388,7 +388,7 @@ pub fn create_kernel_badge(
|
||||
|
||||
fn get_kernel_branches() -> Result<Vec<KernelBranch>, reqwest::Error> {
|
||||
let mut kernel_branches_array: Vec<KernelBranch> = Vec::new();
|
||||
let kernel_branch_files_dir = fs::read_dir("/usr/lib/fedora-kernel-manager/kernel_branches").expect("No Kernel json files found");
|
||||
let kernel_branch_files_dir = fs::read_dir("/usr/lib/pika/kernel-manager/kernel_branches").expect("No Kernel json files found");
|
||||
for kernel_branch_file in kernel_branch_files_dir {
|
||||
let kernel_branch_file_path = kernel_branch_file.expect("couldn't change dir entry to path").path();
|
||||
let kernel_branch_data = fs::read_to_string(kernel_branch_file_path).expect("some json is invalid");
|
||||
@ -511,7 +511,7 @@ fn create_kernel_badges(
|
||||
};
|
||||
|
||||
let kernel_version = match Command::new(
|
||||
"/usr/lib/fedora-kernel-manager/scripts/generate_package_info.sh",
|
||||
"/usr/lib/pika/kernel-manager/scripts/generate_package_info.sh",
|
||||
)
|
||||
.args(["version", &kernel_version_deter])
|
||||
.output()
|
||||
@ -576,7 +576,7 @@ fn save_branch_config(branch: &str) {
|
||||
let config_path = get_my_home()
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
.join(".config/fedora-kernel-manager");
|
||||
.join(".config/pika-kernel-manager");
|
||||
match &config_path.exists() {
|
||||
true => fs::write(config_path.join("branch"), branch).unwrap(),
|
||||
_ => {
|
||||
|
@ -190,7 +190,7 @@ fn add_package_rows(
|
||||
.parse::<u32>()
|
||||
.unwrap();
|
||||
let kernel_package_version = match Command::new(
|
||||
"/usr/lib/fedora-kernel-manager/scripts/generate_package_info.sh",
|
||||
"/usr/lib/pika/kernel-manager/scripts/generate_package_info.sh",
|
||||
)
|
||||
.args(["version", &kernel_main_package])
|
||||
.output()
|
||||
@ -199,7 +199,7 @@ fn add_package_rows(
|
||||
_ => "Error".to_owned(),
|
||||
};
|
||||
let kernel_description = match Command::new(
|
||||
"/usr/lib/fedora-kernel-manager/scripts/generate_package_info.sh",
|
||||
"/usr/lib/pika/kernel-manager/scripts/generate_package_info.sh",
|
||||
)
|
||||
.args(["description", &kernel_main_package])
|
||||
.output()
|
||||
@ -494,7 +494,7 @@ fn add_package_rows(
|
||||
const KERNEL_MODIFY_PROG: &str = r###"
|
||||
#! /bin/bash
|
||||
PACKAGE="$0"
|
||||
pkexec /usr/lib/fedora-kernel-manager/scripts/modify_package.sh "${PACKAGE}"
|
||||
pkexec /usr/lib/pika/kernel-manager/scripts/modify_package.sh "${PACKAGE}"
|
||||
"###;
|
||||
fn kernel_modify(
|
||||
log_loop_sender: async_channel::Sender<String>,
|
||||
|
10
src/main.rs
10
src/main.rs
@ -19,7 +19,7 @@ pub struct I18nBackend {
|
||||
impl I18nBackend {
|
||||
fn new() -> Self {
|
||||
let mut trs = HashMap::new();
|
||||
let locales_dir = fs::read_dir("/usr/lib/fedora-kernel-manager/locales").expect("No translation files found");
|
||||
let locales_dir = fs::read_dir("/usr/lib/pika/kernel-manager/locales").expect("No translation files found");
|
||||
for locale_file in locales_dir {
|
||||
let locale_file_path = locale_file.expect("couldn't change dir entry to path").path();
|
||||
let locale = String::from(locale_file_path.file_name().unwrap().to_str().unwrap().trim_end_matches(".json"));
|
||||
@ -48,10 +48,10 @@ impl Backend for I18nBackend {
|
||||
extern crate rust_i18n;
|
||||
i18n!(fallback = "en_US", backend = I18nBackend::new());
|
||||
|
||||
const APP_ID: &str = "com.github.cosmicfusion.fedora-kernel-manager";
|
||||
const APP_ID: &str = "com.github.pikaos-linux.pika-kernel-manager";
|
||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
pub const APP_ICON: &str = "com.github.cosmicfusion.fedora-kernel-manager";
|
||||
pub const APP_GITHUB: &str = "https://github.com/CosmicFusion/fedora-kernel-manager";
|
||||
pub const APP_ICON: &str = "com.github.pikaos-linux.pika-kernel-manager";
|
||||
pub const APP_GITHUB: &str = "https://github.com/CosmicFusion/pika-kernel-manager";
|
||||
|
||||
#[derive(Clone)]
|
||||
struct RunningKernelInfo {
|
||||
@ -106,7 +106,7 @@ fn load_gresource() {
|
||||
fn load_css() {
|
||||
// Load the CSS file and add it to the provider
|
||||
let provider = CssProvider::new();
|
||||
provider.load_from_resource("/com/github/cosmicfusion/fedora-kernel-manager/css/style.css");
|
||||
provider.load_from_resource("/com/github/cosmicfusion/pika-kernel-manager/css/style.css");
|
||||
|
||||
// Add the provider to the default screen
|
||||
gtk::style_context_add_provider_for_display(
|
||||
|
@ -177,7 +177,7 @@ fn scx_sched_expandable(
|
||||
.label(t!("sched_ext_null_checkbutton_label"))
|
||||
.build();
|
||||
|
||||
let data = fs::read_to_string("/usr/lib/fedora-kernel-manager/scx_scheds.json")
|
||||
let data = fs::read_to_string("/usr/lib/pika/kernel-manager/scx_scheds.json")
|
||||
.expect("Unable to read file");
|
||||
let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse");
|
||||
if let serde_json::Value::Array(scheds) = &res["scx_schedulers"] {
|
||||
@ -255,7 +255,7 @@ fn get_current_scx_scheduler() -> String {
|
||||
const CHANGE_SCX_PROG: &str = r###"
|
||||
#! /bin/bash
|
||||
SCX_SCHED="$0"
|
||||
pkexec /usr/lib/fedora-kernel-manager/scripts/change_scx.sh "${SCX_SCHED}"
|
||||
pkexec /usr/lib/pika/kernel-manager/scripts/change_scx.sh "${SCX_SCHED}"
|
||||
"###;
|
||||
|
||||
fn change_scx_scheduler(
|
||||
|
Loading…
Reference in New Issue
Block a user