Project

General

Profile

Actions

Feature #485

closed

Add support for config.txt editing in libpibox

Added by Hammel almost 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Target version:
Start date:
02 Jan 2016
Due date:
% Done:

100%

Estimated time:
Severity:
01 - Critical

Description

The config.txt for the Raspberry Pi is rather large, but it can be supported in phases, providing support for the most commonly edited features first.

Here is the complete config.txt. The API doesn't need to generate comments, just name=value pairs.

Actions #1

Updated by Hammel almost 9 years ago

  • Description updated (diff)
Actions #2

Updated by Hammel almost 9 years ago

Here is what the API should look like:

  • rpiInit(path) - load and parse the file into a list of name/value pairs. Returns 0 on success, 1 on failure. Does not validate existing names.
  • rpiSet(name, value) - Update the specified name with the specified value. If name does not exist, add it if its a valid name. Returns 0 on succes, 1 on failure (not a valid name).
  • rpiNames() - returns a list of supported names. This will not be the complete set of configuration options available to config.txt. It is only what is supported by the API.
  • rpiValues(name) - returns a list of support values for the specified name. Returns null if the name is not valid.
  • rpiGetValue(name) - returns the current value for the specified name
  • rpiSave(path) - save current configuration. Does not validate configuration when writing.
The initial set of valid names that will be supported are:
  • Overscan
    • disable_overscan
    • overscan_left
    • overscan_right
    • overscan_top
    • overscan_bottom
  • HDMI
    • hdmi_safe
    • hdmi_drive
    • hdmi_mode
  • decode_MPG2 (licensed code for MPEG-2 decoding)
  • display_rotate
  • Overclock
    • arm_freq - setting this automatically sets the others
    • core_freq
    • sdram_freq
    • over_voltage
  • Memory
    • gpu_mem_256 or gpu_mem_512
These values are preset to these values if not found in the config file.
  • hdmi_ignore_edid_audio=1
  • disable_splash=1
  • dtparam=act_led_trigger=heartbeat (instead of mmc, so I can see processor load)
Actions #3

Updated by Hammel almost 9 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10
Actions #4

Updated by Hammel almost 9 years ago

  • % Done changed from 10 to 20

Added stubs of rpi API and unit test framework to libpibox.

Actions #5

Updated by Hammel almost 9 years ago

  • % Done changed from 20 to 50

Most of this is done now although I still need to verify that required fields are included. I also need to add unit tests for each field to make sure I can only add valid values.

I dropped the gpu memory setting. That seems less like a user configurable item than the others.

Actions #6

Updated by Hammel over 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 50 to 100

Added unit tests for field values.

All changes committed and pushed.

Closing issue.

Actions #7

Updated by Hammel over 8 years ago

  • Status changed from Closed to In Progress
  • % Done changed from 100 to 80

Reopening issue: the use of a hash table was a bad idea. I can't guarantee the ordering of the output to match the input so I munge the input file.

I need to switch to using either singly-linked lists (which is what I started with) or queues. Since this isn't a high activity collection the penalties for using lists isn't really an issue. So I think I'll go back to using lists where the data is a structure with name/value that I can use for searching, replacing, etc.

Actions #8

Updated by Hammel over 8 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 80 to 100

Switched to GSList. Updated tests and verified working.

Committed and pushed.

Closing issue again.

Actions

Also available in: Atom PDF