@@ -74,3 +74,50 @@ with the `root=` parameter set to the correct UUID.
74
74
Note that this file is being loaded as a configuration using the ` configfile `
75
75
command. Do not include a ` menuentry ` , otherwise it will result in
76
76
a submenu. (Good for advanced cases?).
77
+
78
+ # Development Notes
79
+
80
+ ## Root Lifecycle
81
+
82
+ The root lifecycle is composed of 2 stages:
83
+
84
+ - ** Current** : The root which is currently being used by the system.
85
+ - ** Future** : The root which will be used by the system after an update.
86
+
87
+ The "current" root should never be modified, in any way. The "future" root is
88
+ the root which is being modified by the update process and any other process
89
+ which may require root modification (e.g. kargs, fstab..).
90
+
91
+ ## System Update / Root Re-generation
92
+
93
+ When developing new features which does not envolve the update process, it is
94
+ important to consider the possibility of regenerating the root, as opposed to
95
+ performing a specific update. This may be necessary, for example, when updating
96
+ a kernel flag or fstab entry. To regenerate the root, developers should use the
97
+ Containerfile and avoid taking data from the current root.
98
+
99
+ It is important to note that regenerating the root does not require pulling a
100
+ new image; rather, the latest image in the storage can be used. In ABRoot,
101
+ Prometheus (the container runtime used) makes this process easier, as
102
+ generating an image from the Containerfile does not execute a pull if the image
103
+ is already present in the store. During the update process, however, it is
104
+ necessary to force the pull to take the updated image (this may not happen
105
+ during the development process).
106
+
107
+ In the case of a rollback, the AtomicSwap function should be used to swap the
108
+ current grub configuration with the future one.
109
+
110
+ ## Function Data Files
111
+
112
+ Some functions like kargs, fstab and pkg, need to store data to be used in the
113
+ future. Those should always be placed in the current ` /etc/abroot/.. ` path.
114
+
115
+ If you are concerned that the current root should never be changed, you are
116
+ correct but in this case the ` /etc ` path is a combined overlay of the root and
117
+ respective ` /etc ` path files in the var partition:
118
+
119
+ ```
120
+ /etc -> /var/lib/abroot/etc/a
121
+ ```
122
+
123
+ Even if the root is read-only, the ` /etc ` path is not.
0 commit comments