-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Headers install: write new module, remove old and doubled
- Loading branch information
1 parent
3769d0f
commit 94ff0e0
Showing
9 changed files
with
76 additions
and
138 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,55 @@ | ||
module_options+=( | ||
["module_headers,author"]="@armbian" | ||
["module_headers,feature"]="module_headers" | ||
["module_headers,desc"]="Install headers container" | ||
["module_headers,example"]="install remove status help" | ||
["module_headers,port"]="" | ||
["module_headers,status"]="Active" | ||
["module_headers,arch"]="" | ||
) | ||
# | ||
# Mmodule_headers | ||
# | ||
function module_headers () { | ||
local title="headers" | ||
local condition=$(which "$title" 2>/dev/null) | ||
|
||
if [[ -f /etc/armbian-release ]]; then | ||
source /etc/armbian-release | ||
local install_pkg="linux-headers-${BRANCH}-${LINUXFAMILY}" | ||
else | ||
local install_pkg="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')" | ||
fi | ||
|
||
local commands | ||
IFS=' ' read -r -a commands <<< "${module_options["module_headers,example"]}" | ||
|
||
case "$1" in | ||
"${commands[0]}") | ||
apt_install_wrapper apt-get -y install ${install_pkg} build-essential git || exit 1 | ||
;; | ||
"${commands[1]}") | ||
apt_install_wrapper apt-get -y autopurge ${install_pkg} build-essential || exit 1 | ||
rm -rf /usr/src/linux-headers* | ||
;; | ||
"${commands[2]}") | ||
if check_if_installed ${install_pkg}; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
;; | ||
"${commands[3]}") | ||
echo -e "\nUsage: ${module_options["module_headers,feature"]} <command>" | ||
echo -e "Commands: ${module_options["module_headers,example"]}" | ||
echo "Available commands:" | ||
echo -e "\tinstall\t- Install $title." | ||
echo -e "\tstatus\t- Installation status $title." | ||
echo -e "\tremove\t- Remove $title." | ||
echo | ||
;; | ||
*) | ||
${module_options["module_headers,feature"]} ${commands[3]} | ||
;; | ||
esac | ||
} |
This file was deleted.
Oops, something went wrong.
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