-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-63166 : Update device.properties file during runtime #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's Licenses.txt file the | ||
|
Check failure on line 2 in source/scripts/init/src/apply_system_defaults/apply_system_defaults.c
|
||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2015 RDK Management | ||
|
|
@@ -3317,6 +3317,50 @@ | |
| } | ||
| #endif | ||
|
|
||
| #if defined (ONESTACK_PRODUCT_REQ) | ||
|
|
||
| #define DEV_PROP_FILE "/etc/device.properties" | ||
| static const char *g_dev_prop_params[] = { | ||
| "IS_BCI=yes", | ||
| NULL | ||
| }; | ||
|
|
||
| static int addPartnerDefaultsToDevPropFile() | ||
| { | ||
| FILE *fp = NULL; | ||
| //check file for existence | ||
| if (access(DEV_PROP_FILE, F_OK) != 0) | ||
| { | ||
| APPLY_PRINT("[Utopia - %s]File %s does not exists\n",__FUNCTION__,DEV_PROP_FILE); | ||
| return 1; | ||
| } | ||
|
|
||
| //open for writing | ||
| fp = fopen(DEV_PROP_FILE, "a"); | ||
| if (fp == NULL) | ||
| { | ||
| APPLY_PRINT("[Utopia - %s]File %s could not open for writing\n",__FUNCTION__,DEV_PROP_FILE); | ||
| return 1; | ||
| } | ||
|
|
||
| int i = 0; | ||
| for (i = 0; g_dev_prop_params[i] != NULL; i++) | ||
| { | ||
| if (fprintf(fp, "%s\n", g_dev_prop_params[i]) < 0) | ||
| { | ||
|
Comment on lines
+3346
to
+3350
|
||
| APPLY_PRINT("[Utopia - %s]File %s write failed\n",__FUNCTION__,DEV_PROP_FILE); | ||
| fclose(fp); | ||
| return 1; | ||
| } | ||
| } | ||
|
|
||
| APPLY_PRINT("[Utopia - %s]File %s write successful\n",__FUNCTION__,DEV_PROP_FILE); | ||
|
|
||
| fclose(fp); | ||
|
|
||
| return 0; | ||
| } | ||
| #endif | ||
| /* | ||
| * main() | ||
| */ | ||
|
|
@@ -3531,6 +3575,16 @@ | |
|
|
||
| sysevent_close(global_fd, global_id); | ||
|
|
||
| #if defined (ONESTACK_PRODUCT_REQ) | ||
| if (0 == strcasecmp (PartnerID, "comcast-business")) | ||
| { | ||
| if ( 1 == addPartnerDefaultsToDevPropFile()) | ||
| { | ||
| APPLY_PRINT("%s - Failed to write default props to '%s'\n", __FUNCTION__, DEV_PROP_FILE); | ||
|
Comment on lines
+3578
to
+3583
|
||
| } | ||
| } | ||
| #endif | ||
|
|
||
| return(0); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log message text "File %s does not exists" is grammatically incorrect; it should be "does not exist". Please fix the wording in this message to avoid shipping a user-visible typo.