summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Brunel2015-10-17 12:59:34 +0200
committerOlivier Brunel2015-11-11 19:44:57 +0100
commitb4e7f85866f9f3b34c97f9225136945e9434bc37 (patch)
tree32f6be06f721d6d4a4aff4785ab4a14d7e35d200
parent63c15cbc85b0a37751daa70bb9da655676ed71d4 (diff)
downloadaur-b4e7f85866f9f3b34c97f9225136945e9434bc37.tar.gz
xlsh-without-x: Add new patches re: commands
"shutdown" becomes "halt" & "poweroff" and uses corresponding binaries. Signed-off-by: Olivier Brunel <jjk@jjacky.com>
-rw-r--r--.SRCINFO22
-rw-r--r--0001-Add-compilation-option-for-login-completion.patch4
-rw-r--r--0002-Remove-X-support.patch4
-rw-r--r--0003-config.h-Tweak-prompt.patch4
-rw-r--r--0004-Makefile-Switch-prefix-to-usr.patch4
-rw-r--r--0005-Don-t-block-signals-as-it-caused-issues.patch4
-rw-r--r--0006-Set-environment-from-PAM.patch4
-rw-r--r--0007-Add-.gitignore.patch4
-rw-r--r--0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch4
-rw-r--r--0009-config-Use-better-commands-to-reboot-halt.patch32
-rw-r--r--0010-Replace-command-shutdown-with-halt-poweroff.patch109
-rw-r--r--PKGBUILD27
12 files changed, 187 insertions, 35 deletions
diff --git a/.SRCINFO b/.SRCINFO
index babc7dee3267..23186c1d766a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = xlsh-without-x
pkgdesc = eXtended Login Shell - fast, minimalistic login replacement (without X support)
pkgver = 0.2.2
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/Nadrin/xlsh/wiki
arch = i686
arch = x86_64
@@ -18,15 +18,19 @@ pkgbase = xlsh-without-x
source = 0006-Set-environment-from-PAM.patch
source = 0007-Add-.gitignore.patch
source = 0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch
+ source = 0009-config-Use-better-commands-to-reboot-halt.patch
+ source = 0010-Replace-command-shutdown-with-halt-poweroff.patch
sha256sums = ffc8c31503d252d104f98259842a8da5163862870bfdfe0a07ffc0833b6a1102
- sha256sums = 7c690c750fcb18d888782014f30109d5ed44b578f524a3cdae1ecaa3ae4fd6ae
- sha256sums = e293e25e9a8cbbe15249efce8f1300a83b7f35396666aca0d300363146fd013a
- sha256sums = 5fa5f298015fda12b67914a255dc1d6988716959ea1400eaa8fd9773ce42c435
- sha256sums = 94b539e8efa4158c19c0ff950f45a157b7d412cd56e86194d790f76912f19da5
- sha256sums = d6b8c6a83dbc95040200dc3b718f74be3922bf8b90db5683683adf12bd6f63de
- sha256sums = fdf1af691da9be4278be4b51727bd9eb07b4c9b244b8a772adc8b85482679cbe
- sha256sums = 33000c592e06a518c4893d4d95209ba809dca97ae8115e22bc784d4c67a84cab
- sha256sums = 6d9f1a050fc46264cdcb7d7bc05325dc44fb94d0213be10acf0c51ca9d8c7da9
+ sha256sums = 7ff3d8a1c3489229aac8d5c1447a9d5781b00682098f703b70a61e5fb38d7d5b
+ sha256sums = ae8bb3edb173f41572f77e64b24485cab8805ac92bdfe4f6989c2bce0c1ce021
+ sha256sums = da5793bc553731e5c65a6583d086af4b5b86b1df5d03dac9d0b48d10cb506d0c
+ sha256sums = 13df8bdf21d3ae7e9b7efc5d800ae2c4e596c9ff2fae6326d0b2fdcb66b2b89c
+ sha256sums = 102b5123fd60a8331c856a4fc8b50d3332455cb4f4e38b962eb6057345fa4f8e
+ sha256sums = 069dee189df6de6f8a3459a42ad30afb14ecfb306e31d59283f99fd48ae68298
+ sha256sums = 049601322afdcc621c9c340bcb5376cfc54f624391dffa9829d25b5b71181251
+ sha256sums = a46ac173fb130bd88ba706255bb0ff15815cdb770196a01a3fb433340ac742f3
+ sha256sums = 9684b8e822bfaba8e7213bafea89929a6c2834a43fb0b3223f07b6e8a71b8f8a
+ sha256sums = 4c8c5304a649bcb1d1d522614a0ac6fdc468f69ed00c02e002b620d9076165b7
pkgname = xlsh-without-x
diff --git a/0001-Add-compilation-option-for-login-completion.patch b/0001-Add-compilation-option-for-login-completion.patch
index 2032ff11ebef..eb5a55c475d7 100644
--- a/0001-Add-compilation-option-for-login-completion.patch
+++ b/0001-Add-compilation-option-for-login-completion.patch
@@ -1,7 +1,7 @@
From 1ee25d8e41581ac178545bde6dfa00229e3f809a Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Tue, 15 Nov 2011 15:02:59 +0100
-Subject: [PATCH 1/8] Add compilation option for login completion
+Subject: [PATCH 01/10] Add compilation option for login completion
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -55,5 +55,5 @@ index b8181e2..b22b4e4 100644
int xlsh_cmd_loop(void)
--
-2.1.3
+2.6.1
diff --git a/0002-Remove-X-support.patch b/0002-Remove-X-support.patch
index 44d4b9ae2d6f..d41c3b832433 100644
--- a/0002-Remove-X-support.patch
+++ b/0002-Remove-X-support.patch
@@ -1,7 +1,7 @@
From 45ea617f995180bf704a760709efa86401b9394a Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Tue, 15 Nov 2011 15:42:46 +0100
-Subject: [PATCH 2/8] Remove X support
+Subject: [PATCH 02/10] Remove X support
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -595,5 +595,5 @@ index 3c79581..0000000
- return retval;
-}
--
-2.1.3
+2.6.1
diff --git a/0003-config.h-Tweak-prompt.patch b/0003-config.h-Tweak-prompt.patch
index bde0b6720b7d..70845c4eeb78 100644
--- a/0003-config.h-Tweak-prompt.patch
+++ b/0003-config.h-Tweak-prompt.patch
@@ -1,7 +1,7 @@
From 46d3104ffba1ffc66e085597c25475cd0ff0cb9c Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:02:26 +0100
-Subject: [PATCH 3/8] config.h: Tweak prompt
+Subject: [PATCH 03/10] config.h: Tweak prompt
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -22,5 +22,5 @@ index ec20fc5..9e00c4a 100644
#define XLSH_SHELLS "/etc/shells"
#define XLSH_ISSUE "/etc/issue"
--
-2.1.3
+2.6.1
diff --git a/0004-Makefile-Switch-prefix-to-usr.patch b/0004-Makefile-Switch-prefix-to-usr.patch
index 14530505ce6a..babf25d99aeb 100644
--- a/0004-Makefile-Switch-prefix-to-usr.patch
+++ b/0004-Makefile-Switch-prefix-to-usr.patch
@@ -1,7 +1,7 @@
From 00915458dd640b9d3cf538ae48f308d9ff65448e Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:02:38 +0100
-Subject: [PATCH 4/8] Makefile: Switch prefix to /usr
+Subject: [PATCH 04/10] Makefile: Switch prefix to /usr
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -22,5 +22,5 @@ index 8fae9a2..f4fd67c 100644
exec_prefix = $(prefix)
sbindir = $(exec_prefix)/sbin
--
-2.1.3
+2.6.1
diff --git a/0005-Don-t-block-signals-as-it-caused-issues.patch b/0005-Don-t-block-signals-as-it-caused-issues.patch
index 79e0c83a2304..d601de9e1ec0 100644
--- a/0005-Don-t-block-signals-as-it-caused-issues.patch
+++ b/0005-Don-t-block-signals-as-it-caused-issues.patch
@@ -1,7 +1,7 @@
From b3f9bdb405acef29cefd4b3f3d02a1903ba80d09 Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:09:28 +0100
-Subject: [PATCH 5/8] Don't block signals, as it caused issues
+Subject: [PATCH 05/10] Don't block signals, as it caused issues
Blocking signals doesn't seem to be required (xlsh will be restarted
automatically anyways, just as when using command exit (login doesn't
@@ -92,5 +92,5 @@ index ab20703..e4fbf7c 100644
xlsh_config_init(opt_exec);
xlsh_sys_issue(xlsh_config[XLSH_ID_ISSUE].value);
--
-2.1.3
+2.6.1
diff --git a/0006-Set-environment-from-PAM.patch b/0006-Set-environment-from-PAM.patch
index b668bdf9ca6a..d70a9d860ccb 100644
--- a/0006-Set-environment-from-PAM.patch
+++ b/0006-Set-environment-from-PAM.patch
@@ -1,7 +1,7 @@
From bdfd5079433180aac28b68be796d52c5bfbd7c8c Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:13:27 +0100
-Subject: [PATCH 6/8] Set environment from PAM
+Subject: [PATCH 06/10] Set environment from PAM
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -88,5 +88,5 @@ index e4fbf7c..3fc1711 100644
}
else if(proc_shell == -1)
--
-2.1.3
+2.6.1
diff --git a/0007-Add-.gitignore.patch b/0007-Add-.gitignore.patch
index 25827c196170..134584eeda1a 100644
--- a/0007-Add-.gitignore.patch
+++ b/0007-Add-.gitignore.patch
@@ -1,7 +1,7 @@
From 9fcf959b7b3634ea7496e7cd141a34db449550d8 Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:18:54 +0100
-Subject: [PATCH 7/8] Add .gitignore
+Subject: [PATCH 07/10] Add .gitignore
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -21,5 +21,5 @@ index 0000000..542369b
+*.swp
+/xlsh
--
-2.1.3
+2.6.1
diff --git a/0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch b/0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch
index a571f2fceaae..f1dfe6453a86 100644
--- a/0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch
+++ b/0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch
@@ -1,7 +1,7 @@
From 99969e2f933da2131fc21db94d2792d90072f4b8 Mon Sep 17 00:00:00 2001
From: Olivier Brunel <jjk@jjacky.com>
Date: Sun, 16 Nov 2014 18:23:42 +0100
-Subject: [PATCH 8/8] Makefile: Install in $prefix/bin not $prefix/sbin
+Subject: [PATCH 08/10] Makefile: Install in $prefix/bin not $prefix/sbin
Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
@@ -43,5 +43,5 @@ index f4fd67c..12364ef 100644
clean:
rm -f $(PROGRAMS)
--
-2.1.3
+2.6.1
diff --git a/0009-config-Use-better-commands-to-reboot-halt.patch b/0009-config-Use-better-commands-to-reboot-halt.patch
new file mode 100644
index 000000000000..64d1c15def95
--- /dev/null
+++ b/0009-config-Use-better-commands-to-reboot-halt.patch
@@ -0,0 +1,32 @@
+From aacb57c775088b29f2331dba835c7d5ea2ec3343 Mon Sep 17 00:00:00 2001
+From: Olivier Brunel <jjk@jjacky.com>
+Date: Wed, 14 Oct 2015 18:49:11 +0200
+Subject: [PATCH 09/10] config: Use "better" commands to reboot/halt
+
+Those make more sense, also allows easier use with other init system
+that provides those commands. (I especially don't like `shutdown -h` to
+halt.)
+
+Signed-off-by: Olivier Brunel <jjk@jjacky.com>
+---
+ include/config.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/config.h b/include/config.h
+index 9e00c4a..301f09f 100644
+--- a/include/config.h
++++ b/include/config.h
+@@ -15,8 +15,8 @@
+ #define XLSH_SHELLS "/etc/shells"
+ #define XLSH_ISSUE "/etc/issue"
+ #define XLSH_PATH "/bin:/usr/bin:/usr/local/bin"
+-#define XLSH_REBOOT "/sbin/shutdown -r now"
+-#define XLSH_HALT "/sbin/shutdown -h now"
++#define XLSH_REBOOT "/sbin/reboot"
++#define XLSH_HALT "/sbin/halt"
+ #define XLSH_XTTY "/dev/console"
+ #define XLSH_DATEFMT "%Y-%m-%d"
+ #define XLSH_TIMEFMT "%H:%M"
+--
+2.6.1
+
diff --git a/0010-Replace-command-shutdown-with-halt-poweroff.patch b/0010-Replace-command-shutdown-with-halt-poweroff.patch
new file mode 100644
index 000000000000..2e6196a3f523
--- /dev/null
+++ b/0010-Replace-command-shutdown-with-halt-poweroff.patch
@@ -0,0 +1,109 @@
+From fd7c3159988cb56e2cb703be23e8a4302331f338 Mon Sep 17 00:00:00 2001
+From: Olivier Brunel <jjk@jjacky.com>
+Date: Sat, 17 Oct 2015 12:53:10 +0200
+Subject: [PATCH 10/10] Replace command "shutdown" with "halt" & "poweroff"
+
+Signed-off-by: Olivier Brunel <jjk@jjacky.com>
+---
+ include/config.h | 1 +
+ include/xlsh.h | 4 +++-
+ src/xlsh.c | 21 ++++++++++++++++++---
+ 3 files changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/include/config.h b/include/config.h
+index 301f09f..1844bd3 100644
+--- a/include/config.h
++++ b/include/config.h
+@@ -17,6 +17,7 @@
+ #define XLSH_PATH "/bin:/usr/bin:/usr/local/bin"
+ #define XLSH_REBOOT "/sbin/reboot"
+ #define XLSH_HALT "/sbin/halt"
++#define XLSH_POWEROFF "/sbin/poweroff"
+ #define XLSH_XTTY "/dev/console"
+ #define XLSH_DATEFMT "%Y-%m-%d"
+ #define XLSH_TIMEFMT "%H:%M"
+diff --git a/include/xlsh.h b/include/xlsh.h
+index a536996..0a131db 100644
+--- a/include/xlsh.h
++++ b/include/xlsh.h
+@@ -11,6 +11,7 @@ typedef enum xlsh_config_id_e {
+ XLSH_ID_EXEC = 0,
+ XLSH_ID_REBOOT,
+ XLSH_ID_HALT,
++ XLSH_ID_POWEROFF,
+ XLSH_ID_ISSUE,
+ XLSH_ID_DATEFMT,
+ XLSH_ID_TIMEFMT,
+@@ -67,6 +68,7 @@ int xlsh_func_help(int argc, char** argv);
+ int xlsh_func_version(int argc, char** argv);
+ int xlsh_func_login(int argc, char** argv);
+ int xlsh_func_reboot(int argc, char** argv);
+-int xlsh_func_shutdown(int argc, char** argv);
++int xlsh_func_halt(int argc, char** argv);
++int xlsh_func_poweroff(int argc, char** argv);
+
+ #endif
+diff --git a/src/xlsh.c b/src/xlsh.c
+index 3fc1711..7a3ceb9 100644
+--- a/src/xlsh.c
++++ b/src/xlsh.c
+@@ -32,6 +32,7 @@ static xlsh_config_item_t xlsh_config[] = {
+ { "XLSH_EXEC", XLSH_EXEC, NULL },
+ { "XLSH_REBOOT", XLSH_REBOOT, NULL },
+ { "XLSH_HALT", XLSH_HALT, NULL },
++ { "XLSH_POWEROFF", XLSH_POWEROFF, NULL },
+ { "XLSH_ISSUE", XLSH_ISSUE, NULL },
+ { "XLSH_DATEFMT", XLSH_DATEFMT, NULL },
+ { "XLSH_TIMEFMT", XLSH_TIMEFMT, NULL },
+@@ -44,7 +45,8 @@ static xlsh_config_item_t xlsh_config[] = {
+ static xlsh_command_t xlsh_commands[] = {
+ { "login", " : Logins specified user into the system", xlsh_func_login },
+ { "reboot", " : Reboots the system", xlsh_func_reboot },
+- { "shutdown", ": Halts the system", xlsh_func_shutdown },
++ { "halt", " : Halts the system", xlsh_func_halt },
++ { "poweroff", ": Powers off the system", xlsh_func_poweroff },
+ { "exit", " : Exits (reloads) login shell", xlsh_func_exit },
+ { "help", " : Prints all available commands", xlsh_func_help },
+ { "version", " : Prints copyright and version information", xlsh_func_version },
+@@ -114,9 +116,9 @@ int xlsh_func_reboot(int argc, char** argv)
+ return XLSH_EDONE;
+ }
+
+-int xlsh_func_shutdown(int argc, char** argv)
++int xlsh_func_halt(int argc, char** argv)
+ {
+- printf("Initiating system shutdown ...\n");
++ printf("Halting system ...\n");
+ if(libxlsh_proc_exec(XLSH_HALT, XLSH_DETACH) == -1) {
+ fprintf(stderr, "Failed to execute: %s\n", XLSH_HALT);
+ return XLSH_ERROR;
+@@ -126,6 +128,18 @@ int xlsh_func_shutdown(int argc, char** argv)
+ return XLSH_EDONE;
+ }
+
++int xlsh_func_poweroff(int argc, char** argv)
++{
++ printf("Powering off system ...\n");
++ if(libxlsh_proc_exec(XLSH_POWEROFF, XLSH_DETACH) == -1) {
++ fprintf(stderr, "Failed to execute: %s\n", XLSH_POWEROFF);
++ return XLSH_ERROR;
++ }
++
++ pause();
++ return XLSH_EDONE;
++}
++
+ // Session management helpers
+ static int xlsh_session_conv(int num_msg, const struct pam_message** msg,
+ struct pam_response** resp, void* appdata_ptr)
+@@ -379,6 +393,7 @@ void xlsh_config_init(char* exec_arg)
+
+ xlsh_config_set(&xlsh_config[XLSH_ID_REBOOT], NULL);
+ xlsh_config_set(&xlsh_config[XLSH_ID_HALT], NULL);
++ xlsh_config_set(&xlsh_config[XLSH_ID_POWEROFF], NULL);
+ xlsh_config_set(&xlsh_config[XLSH_ID_ISSUE], NULL);
+ xlsh_config_set(&xlsh_config[XLSH_ID_TIMEFMT], NULL);
+ xlsh_config_set(&xlsh_config[XLSH_ID_DATEFMT], NULL);
+--
+2.6.1
+
diff --git a/PKGBUILD b/PKGBUILD
index fda9ec5d50a6..df7957402236 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: MichaƂ Siejak <my_fistname@my_lastname.pl>
pkgname=xlsh-without-x
pkgver=0.2.2
-pkgrel=3
+pkgrel=4
pkgdesc="eXtended Login Shell - fast, minimalistic login replacement (without X support)"
arch=('i686' 'x86_64')
url="https://github.com/Nadrin/xlsh/wiki"
@@ -17,16 +17,21 @@ source=("xlsh-$pkgver.tar.gz::https://github.com/Nadrin/xlsh/tarball/master"
'0005-Don-t-block-signals-as-it-caused-issues.patch'
'0006-Set-environment-from-PAM.patch'
'0007-Add-.gitignore.patch'
- '0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch')
+ '0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch'
+ '0009-config-Use-better-commands-to-reboot-halt.patch'
+ '0010-Replace-command-shutdown-with-halt-poweroff.patch'
+ )
sha256sums=('ffc8c31503d252d104f98259842a8da5163862870bfdfe0a07ffc0833b6a1102'
- '7c690c750fcb18d888782014f30109d5ed44b578f524a3cdae1ecaa3ae4fd6ae'
- 'e293e25e9a8cbbe15249efce8f1300a83b7f35396666aca0d300363146fd013a'
- '5fa5f298015fda12b67914a255dc1d6988716959ea1400eaa8fd9773ce42c435'
- '94b539e8efa4158c19c0ff950f45a157b7d412cd56e86194d790f76912f19da5'
- 'd6b8c6a83dbc95040200dc3b718f74be3922bf8b90db5683683adf12bd6f63de'
- 'fdf1af691da9be4278be4b51727bd9eb07b4c9b244b8a772adc8b85482679cbe'
- '33000c592e06a518c4893d4d95209ba809dca97ae8115e22bc784d4c67a84cab'
- '6d9f1a050fc46264cdcb7d7bc05325dc44fb94d0213be10acf0c51ca9d8c7da9')
+ '7ff3d8a1c3489229aac8d5c1447a9d5781b00682098f703b70a61e5fb38d7d5b'
+ 'ae8bb3edb173f41572f77e64b24485cab8805ac92bdfe4f6989c2bce0c1ce021'
+ 'da5793bc553731e5c65a6583d086af4b5b86b1df5d03dac9d0b48d10cb506d0c'
+ '13df8bdf21d3ae7e9b7efc5d800ae2c4e596c9ff2fae6326d0b2fdcb66b2b89c'
+ '102b5123fd60a8331c856a4fc8b50d3332455cb4f4e38b962eb6057345fa4f8e'
+ '069dee189df6de6f8a3459a42ad30afb14ecfb306e31d59283f99fd48ae68298'
+ '049601322afdcc621c9c340bcb5376cfc54f624391dffa9829d25b5b71181251'
+ 'a46ac173fb130bd88ba706255bb0ff15815cdb770196a01a3fb433340ac742f3'
+ '9684b8e822bfaba8e7213bafea89929a6c2834a43fb0b3223f07b6e8a71b8f8a'
+ '4c8c5304a649bcb1d1d522614a0ac6fdc468f69ed00c02e002b620d9076165b7')
prepare() {
mv Nadrin-xlsh-* xlsh
@@ -40,6 +45,8 @@ prepare() {
patch -p1 -i ../0006-Set-environment-from-PAM.patch
patch -p1 -i ../0007-Add-.gitignore.patch
patch -p1 -i ../0008-Makefile-Install-in-prefix-bin-not-prefix-sbin.patch
+ patch -p1 -i ../0009-config-Use-better-commands-to-reboot-halt.patch
+ patch -p1 -i ../0010-Replace-command-shutdown-with-halt-poweroff.patch
}
build() {