Commit 4ff5356
committed
system/nxinit: add fallback service option
Add an SVC_FALLBACK flag and a "fallback" service option, the semantic
opposite of "override", to resolve same-name service conflicts:
- override: the new definition replaces the old one.
- fallback: the definition marked fallback yields to the other one, so a
board-level init.rc can provide a default service that is silently
dropped when another init.rc defines a service with the same name (and
vice versa).
If neither flag is set, duplicate service names still produce -EEXIST as
before. init_service_check() now resolves the conflict by, in order:
override wins, otherwise the fallback side is disabled, otherwise error.
Assisted-by: opencode-agent/claude-opus-4-8
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>1 parent 63ff083 commit 4ff5356
2 files changed
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
131 | 134 | | |
132 | 135 | | |
133 | 136 | | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
256 | 270 | | |
257 | 271 | | |
258 | 272 | | |
| |||
649 | 663 | | |
650 | 664 | | |
651 | 665 | | |
652 | | - | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
653 | 685 | | |
654 | 686 | | |
655 | 687 | | |
656 | 688 | | |
657 | 689 | | |
658 | 690 | | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | 691 | | |
664 | 692 | | |
665 | 693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
0 commit comments