Merge pull request #5484 from dvdhrm/convertible

hostname: support 'convertible' chassis
This commit is contained in:
Lennart Poettering
2017-02-28 15:11:36 +01:00
committed by GitHub
5 changed files with 8 additions and 2 deletions
+1
View File
@@ -173,6 +173,7 @@
defined:
<literal>desktop</literal>,
<literal>laptop</literal>,
<literal>convertible</literal>,
<literal>server</literal>,
<literal>tablet</literal>,
<literal>handset</literal>,
+1
View File
@@ -120,6 +120,7 @@
chassis types are defined:
<literal>desktop</literal>,
<literal>laptop</literal>,
<literal>convertible</literal>,
<literal>server</literal>,
<literal>tablet</literal>,
<literal>handset</literal>,
+1 -1
View File
@@ -52,7 +52,7 @@ _hostnamectl() {
if [[ -z $verb ]]; then
comps=${VERBS[*]}
elif __contains_word "$verb" ${VERBS[CHASSIS]}; then
comps='desktop laptop server tablet handset watch embedded vm container'
comps='desktop laptop convertible server tablet handset watch embedded vm container'
elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[ICONS]} ${VERBS[NAME]}; then
comps=''
fi
+1 -1
View File
@@ -18,7 +18,7 @@ _hostnamectl_set-icon-name() {
_hostnamectl_set-chassis() {
if (( CURRENT <= 3 )); then
_chassis=( desktop laptop server tablet handset watch embedded vm container )
_chassis=( desktop laptop convertible server tablet handset watch embedded vm container )
_describe chassis _chassis
else
_message "no more options"
+4
View File
@@ -133,6 +133,7 @@ static bool valid_chassis(const char *chassis) {
"container\0"
"desktop\0"
"laptop\0"
"convertible\0"
"server\0"
"tablet\0"
"handset\0"
@@ -199,6 +200,9 @@ static const char* fallback_chassis(void) {
case 0x1E: /* Tablet */
return "tablet";
case 0x1F: /* Convertible */
return "convertible";
}
try_acpi: