cleanup: remove redundant shutdown.elf, update shell help/completions
This commit is contained in:
@@ -66,8 +66,8 @@ void cmd_help() {
|
||||
montauk::print(" uptime Show uptime\n");
|
||||
montauk::print(" clear Clear the screen\n");
|
||||
montauk::print(" fontscale [n] Set terminal font scale (1-8)\n");
|
||||
montauk::print(" reset Reboot the system\n");
|
||||
montauk::print(" shutdown Shut down the system\n");
|
||||
montauk::print(" shutdown Shut down the system (poweroff, halt)\n");
|
||||
montauk::print(" reboot Reboot the system (reset)\n");
|
||||
montauk::print(" suspend Suspend the system\n");
|
||||
montauk::print("\n");
|
||||
montauk::print("Network commands:\n");
|
||||
|
||||
@@ -145,5 +145,11 @@ constexpr const char* shell_builtins[] = {
|
||||
"unset",
|
||||
"true",
|
||||
"false",
|
||||
"exit"
|
||||
"exit",
|
||||
"shutdown",
|
||||
"poweroff",
|
||||
"halt",
|
||||
"reboot",
|
||||
"reset",
|
||||
"suspend"
|
||||
};
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* main.cpp
|
||||
* shutdown - Shut down the system
|
||||
* Copyright (c) 2025-2026 Daniel Hammer
|
||||
*/
|
||||
|
||||
#include <montauk/syscall.h>
|
||||
|
||||
extern "C" void _start() {
|
||||
montauk::print("Shutting down...\n");
|
||||
// This low-level utility bypasses the login graceful-shutdown view, so flush
|
||||
// pending writes and unmount disk-backed volumes here before powering off.
|
||||
int sync_rc = montauk::fs_sync();
|
||||
if (sync_rc == montauk::abi::SYS_ERR_PERMISSION) {
|
||||
montauk::print("shutdown: permission denied\n");
|
||||
montauk::exit(1);
|
||||
}
|
||||
int rc = montauk::shutdown();
|
||||
if (rc == montauk::abi::SYS_ERR_PERMISSION)
|
||||
montauk::print("shutdown: permission denied\n");
|
||||
else
|
||||
montauk::print("shutdown: power-off failed\n");
|
||||
montauk::exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user