Comments (1)
The quickest fix would be to replace this function with something better suited to handling JSON than sed, such as:
...
# $1 = key to look for in JSON payload, e.g.: "['parent']['child']"
get_json_string_val() {
python -c "import sys,json;sys.stdout.write(json.dumps(json.load(sys.stdin)$1))"
}
...
NOOBSFLAVOUR=$(cat /boot/os_config.json | get_json_string_val "['flavour']")
NOOBSLANGUAGE=$(cat /boot/os_config.json | get_json_string_val "['language']")
NOOBSKEYBOARD=$(cat /boot/os_config.json | get_json_string_val "['keyboard']")
...
Other than the fact that this adds additional run-time dependencies, which might be unwanted, such a fix would be pretty easy and relatively safe to add. However, I have not been able to find a lot of documentation on the topic of os_config.json.
The other advantage of using python instead of sed to parse the JSON payload is that it'll be more tolerant of weird JSON payloads, like:
{"flavour":"chocolate","language":"en_CA.UTF-8","keyboard":"US"}
from raspi-config.
Related Issues (20)
- do_update with nonint enters interactive mode HOT 6
- OverlayFS doesn't work, SD card still writes persistent changes HOT 2
- Manual page HOT 5
- Feature Request: Some means to configure DRM/KMS displays or perhaps all add-on dtoverlays. HOT 4
- Upgraded to bookworm (Raspbian 12), "Overlay File System" now fails to enable HOT 1
- memory overflow using overlayfs with 256 MB rpi HOT 11
- Disallow using more than 75% of RAM for GPU HOT 2
- Wait for network on boot, and the memory split command does not work on raspbian arm64. HOT 1
- Browsing Audio options without setting an option corrupts .asoundrc
- Enabling/disabling VNC for wayland desktop does nothing since wayvnc unit file does not exist HOT 2
- No "Audio" menu with raspi-config 20231216 in Zero W HOT 5
- feat: print out config values in nonint mode HOT 3
- What does this tool do? HOT 1
- Option to change username HOT 1
- A5 - Bootloader version. Update selection returns to default HOT 5
- Confusing messages when switching Bootloader version HOT 4
- Unable to enable overlayfs on a CM4 with eMMC and NVMe storage HOT 25
- Suggestion: Delete and restore unused kernels and initrds HOT 10
- raspi-config: warning: command substitution: ignored null byte in input HOT 1
- init_resize.sh always expands root partition to fill the entire block device HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspi-config.