cleanup: remove redundant shutdown.elf, update shell help/completions

This commit is contained in:
2026-08-29 19:10:35 +02:00
parent 70fa2016d1
commit 21828990c4
3 changed files with 9 additions and 27 deletions
+2 -2
View File
@@ -66,8 +66,8 @@ void cmd_help() {
montauk::print(" uptime Show uptime\n"); montauk::print(" uptime Show uptime\n");
montauk::print(" clear Clear the screen\n"); montauk::print(" clear Clear the screen\n");
montauk::print(" fontscale [n] Set terminal font scale (1-8)\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 (poweroff, halt)\n");
montauk::print(" shutdown Shut down the system\n"); montauk::print(" reboot Reboot the system (reset)\n");
montauk::print(" suspend Suspend the system\n"); montauk::print(" suspend Suspend the system\n");
montauk::print("\n"); montauk::print("\n");
montauk::print("Network commands:\n"); montauk::print("Network commands:\n");
+7 -1
View File
@@ -145,5 +145,11 @@ constexpr const char* shell_builtins[] = {
"unset", "unset",
"true", "true",
"false", "false",
"exit" "exit",
"shutdown",
"poweroff",
"halt",
"reboot",
"reset",
"suspend"
}; };
-24
View File
@@ -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);
}