This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
forked from RebornOS-Team/calamares-configuration
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rippanda12
committed
Dec 4, 2022
1 parent
87d1927
commit d544320
Showing
9 changed files
with
109 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-FileCopyrightText: no | ||
# SPDX-License-Identifier: CC0-1.0 | ||
# | ||
# packages with pre-install scripts | ||
# | ||
--- | ||
# package: | ||
# pre-install: command/script | ||
|
||
package: tde-tdebase | ||
pre-install: | ||
- /usr/bin/sh /usr/bin/setup-trinity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Maintainer: shivanandvp <[email protected], [email protected]> | ||
|
||
pkgname=calamares-configuration-rpi-local | ||
pkgver=v0.0.18.r4.ga540bee | ||
pkgver=r499.87d1927 | ||
pkgrel=1 | ||
|
||
arch=('aarch64') | ||
arch=('any') | ||
pkgdesc='Configuration for the RebornOS Calamares installer.' | ||
url='https://github.com/RebornOS-Developers/calamares-configuration' | ||
license=('GPL3') | ||
|
@@ -103,13 +103,12 @@ package() { | |
-exec \ | ||
install -Dm 700 "{}" "${pkgdir}/$TARGET_DIRECTORY_STUB/{}" \; | ||
) | ||
( # ------------------- | ||
# Copy local packages | ||
# ------------------- | ||
cd "$DIST_DIRECTORY" && \ | ||
find local_packages \ | ||
( | ||
cd "$PROJECT_DIRECTORY" && \ | ||
find pre_install \ | ||
-type f \ | ||
-exec \ | ||
install -Dm 700 "{}" "${pkgdir}/$TARGET_DIRECTORY_STUB/{}" \; | ||
install -Dm 755 "{}" "${pkgdir}/usr/lib/calamares/modules/pre_install/{}" \; | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import os | ||
import shutil | ||
from typing import Optional, Union, Dict, List | ||
|
||
import libcalamares | ||
from libcalamares.utils import gettext_path, gettext_languages | ||
|
||
|
||
import gettext | ||
_ = gettext.translation("calamares-python", | ||
localedir=libcalamares.utils.gettext_path(), | ||
languages=libcalamares.utils.gettext_languages(), | ||
fallback=True).gettext | ||
|
||
|
||
def pretty_name(): | ||
return _("Running pre-install commands") | ||
|
||
def pick_out_packages(item: Union[Dict, List, str], cumulative_package_list: List[str]): | ||
if isinstance(item, dict): | ||
for key in item: | ||
if key == "packages": | ||
for package in item["packages"]: | ||
if isinstance(package, dict): | ||
if "name" in package: | ||
if package["name"] is not None: | ||
cumulative_package_list.append(package["name"]) | ||
elif isinstance(package, str): | ||
cumulative_package_list.append(package) | ||
else: | ||
pick_out_packages(item= item[key], cumulative_package_list= cumulative_package_list) | ||
elif isinstance(item, list): | ||
for list_item in item: | ||
pick_out_packages(item= list_item, cumulative_package_list= cumulative_package_list) | ||
|
||
cumulative_package_list: list[str] = [] | ||
|
||
def run(): | ||
packagechooser = libcalamares.globalstorage.value("netinstallAdd") | ||
package = libcalamares.job.configuration["package"] | ||
pre_commands = libcalamares.job.configuration["pre_install"] | ||
netinstall = libcalamares.globalstorage.value("packageOperations") | ||
print(netinstall) | ||
pick_out_packages(item= packagechooser, cumulative_package_list= cumulative_package_list) | ||
print(pre_commands) | ||
if package in cumulative_package_list: | ||
libcalamares.utils.debug("Match found") | ||
for command in pre_commands: | ||
command_ = command.split(' ') | ||
libcalamares.utils.debug("Running command: {}".format(command)) | ||
libcalamares.utils.target_env_call(command_) | ||
else: | ||
libcalamares.utils.debug("Match not found") | ||
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-FileCopyrightText: no | ||
# SPDX-License-Identifier: CC0-1.0 | ||
# Module metadata file for dummy python jobmodule | ||
# Syntax is YAML 1.2 | ||
--- | ||
type: "job" | ||
name: "pre_install" | ||
interface: "python" | ||
script: "main.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-FileCopyrightText: no | ||
# SPDX-License-Identifier: CC0-1.0 | ||
# | ||
# packages with pre-install scripts | ||
# | ||
--- | ||
# package: | ||
# pre-install: command/script | ||
|
||
package: tde-tdebase | ||
pre-install: /usr/bin/notify-send "asaddddddddddddddddddddd" |