#include #include #define STARTUP_FILE_PATH "sys/startup.rc" #define CMD_BUF_LEN 1024 char cmdbuf[CMD_BUF_LEN]; void main() { struct file *f = open_file(STARTUP_FILE_PATH); if (!f) { _system_log("Could not open " STARTUP_FILE_PATH ".\n"); return; } while (read_line_from_file(f, cmdbuf, CMD_BUF_LEN - 1)) { if (cmdbuf[0] == '#') continue; //syslogf(run_command(cmdbuf) // ? "[init] Started %s." // : "[init] Could not run %s." //, cmdbuf); run_command(cmdbuf, 0); } close_file(f); _system_log("Done starting startup tasks."); }