Skip to content

Commit 36a29fe

Browse files
committed
[core] Fix RTC if date is not set.
Sets date to January 1, 2025.
1 parent 1a72a14 commit 36a29fe

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

resources/lua/startup.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ local DreamShell = {
7979

8080
os.execute("env USER Default");
8181
local path = os.getenv("PATH");
82+
local time = os.time();
8283

8384
print(os.getenv("HOST") .. " " .. os.getenv("VERSION") .. "\n");
8485
print(os.getenv("ARCH") .. ": " .. os.getenv("BOARD_ID") .. "\n");
@@ -105,6 +106,11 @@ local DreamShell = {
105106
end
106107
end);
107108

109+
-- RTC validity check and fix.
110+
if time < 946684800 or time > 3471292800 then
111+
os.execute("rtc --set --unix 1735689600");
112+
end
113+
108114
self:InstallingApps(path .. "/apps");
109115
self.initialized = true;
110116
OpenApp(os.getenv("APP"));

0 commit comments

Comments
 (0)