Skip to content

Commit

Permalink
Boot procedure updates with runparts
Browse files Browse the repository at this point in the history
  • Loading branch information
bill88t committed Sep 2, 2023
1 parent c96a2ca commit 59904fd
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 32 deletions.
1 change: 0 additions & 1 deletion LjinuxRoot/bin/_earlyconnection.lja

This file was deleted.

2 changes: 2 additions & 0 deletions LjinuxRoot/bin/runparts.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
for pv[get_pid()]["j"] in vr("drl"):
if vr("j").endswith(".py"):
ljinux.based.command.fpexec(vr("i") + "/" + vr("j"))
elif vr("j").endswith(".lja"):
ljinux.based.command.exec(vr("i") + "/" + vr("j"))
31 changes: 0 additions & 31 deletions bootcfg/Init.lja
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
# Detect early serial connections and make logging immediately available
_earlyconnection

# Add /lib to path
pexec from sys import path as syspath
pexec syspath.append("/LjinuxRoot/lib")
pexec del syspath
pexec systemprints(1, "System path updated")

# Connect to a network on boot (example uses wifi driver)
#modprobe driver_wifi as network
#pexec systemprints(2, "Connecting wifi")
#iwctl station wifi auto # Configure connections in &/settings.toml
#pexec systemprints(1, "Connecting wifi")
#pexec systemprints(2, "Sync time via ntp")
#timesync
#pexec systemprints(1, "Sync time via ntp")

# Uncomment this to activate telnet serial
# Depends on network being up
#pexec systemprints(2, "Activate telnet")
#telnet setup -q # quiet
#terminal activate ttyTELNET0
#pexec systemprints(1, "Activate telnet")

# This will advance the date if it's before than build time
advance_build_date

# Clear the dmesg log on low-end boards
#_ndmesg

# Clear boot buffer
# clear

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Detect early serial connections and make logging immediately available
rename_process("earlyconnection")
vr("found", False)
for pv[get_pid()]["i"] in pv[0]["consoles"].keys():
Expand Down
6 changes: 6 additions & 0 deletions bootcfg/boot.d/02-path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add /lib to path
from sys import path as syspath

syspath.append("/LjinuxRoot/lib")
del syspath
systemprints(1, "System path updated")
6 changes: 6 additions & 0 deletions bootcfg/boot.d/03-wifi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Connect to a network on boot (example uses wifi driver)
ljinux.based.run("modprobe driver_wifi as network")
systemprints(2, "Connecting wifi")
ljinux.based.run("iwctl station wifi auto") # Configure connections in &/settings.toml
systemprints(1, "Connecting wifi")
ljinux.based.command.fpexec("/bin/timesync.py")
2 changes: 2 additions & 0 deletions bootcfg/boot.d/04-advance-time.lja
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Advance system time to build time, if the clock is behind
advance_build_date
3 changes: 3 additions & 0 deletions bootcfg/boot.d/05-telnet.lja
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Uncomment this to activate telnet serial
# Depends on network being up
telnet setup -q
2 changes: 2 additions & 0 deletions bootcfg/boot.d/06-reload-hostname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Reload the stored hostname
ljinux.based.command.fpexec("/LjinuxRoot/etc/hostname-reload.py")
2 changes: 2 additions & 0 deletions bootcfg/boot.d/07-no-dmesg.lja
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Clear the dmesg log on low-end boards
#_ndmesg
Empty file removed bootcfg/login.d/1-ljinux.lja
Empty file.
Empty file removed bootcfg/logout.d/1-ljinux.lja
Empty file.
Empty file removed bootcfg/quit.d/1-ljinux.lja
Empty file.

0 comments on commit 59904fd

Please sign in to comment.