radxa-pkg/rsetup

Support enabling overlays from command line

Closed this issue · 0 comments

Objective

Convert the following code to a separate function enable_overlays, so user can call from terminal:

https://github.com/radxa-pkg/rsetup/blob/main/src/usr/lib/rsetup/tui/overlay/overlay.sh#L140-L152

Interface

enable_overlays <list of file names>

Input specs and behaviors

  • Only handle files under $U_BOOT_FDT_OVERLAYS_DIR
  • Can be absolute path or only the file name
  • For file name only input, .disabled prefix can be omitted
  • Do not fail when an overlay is already enabled
  • Check input file exists before mv
  • Return different error codes (check mod/utils.sh)