Skip to content

Commit

Permalink
orange flavor can now use either snapper or pure btrfs snapshotter,
Browse files Browse the repository at this point in the history
need to fix test-cli and more checks for error handling.
install, reset and upgrade is tested and working on green/orange

Changelog:
- reintroduced state directories variables, it makes code simpler,
- changed grub configuration. It should allow downgrades,
- snapper configuration is now created using a chroot in the snapshot,
- snapper initial snapshot bootstrap has changed (rely on snapper chroot initial snapshot creation),
- removed snapper xml code (handled by snapper itself),
- fixed old snapshot deletion,
- added snapper wrappers to run inside chroot or in current context,
- default btrfs subvolume is always updated
  • Loading branch information
rdesaintleger committed Oct 25, 2024
1 parent ef3cdd0 commit b19d09f
Show file tree
Hide file tree
Showing 3 changed files with 473 additions and 447 deletions.
6 changes: 2 additions & 4 deletions examples/orange/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ ARG KBD=2.6.4
RUN curl -L https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-${KBD}.tar.xz --output kbd-${KBD}.tar.xz && \
tar xaf kbd-${KBD}.tar.xz && mkdir -p /usr/share/keymaps && cp -Rp kbd-${KBD}/data/keymaps/* /usr/share/keymaps/

# Symlink grub2-editenv and snapper global config
RUN mkdir -p /etc/sysconfig && \
ln -sf //etc/default/snapper /etc/sysconfig/snapper && \
ln -sf /usr/bin/grub-editenv /usr/bin/grub2-editenv
# Symlink grub2-editenv
RUN ln -sf /usr/bin/grub-editenv /usr/bin/grub2-editenv

# Just add the elemental cli
COPY --from=toolkit /usr/bin/elemental /usr/bin/elemental
Expand Down
8 changes: 5 additions & 3 deletions pkg/features/embedded/grub-config/etc/elemental/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ function source_bootargs {
## Defines the volume and image to boot from for active or passive boots
function set_volume {
if [ "${snapshotter}" == "btrfs" ]; then
# apply btrfs default subvolume if applicable
set btrfs_relative_path="y"
set volume="${root}"
# check if active snap is defined with default top level volume
if [ -d "@/.snapshots/${active_snap}/snapshot" ]; then
set volume="${root}"
if [ -n "${1}" ]; then
set img="@/.snapshots/${1}/snapshot"
else
set img="@/.snapshots/${active_snap}/snapshot"
fi
set root_subpath="${img}/"
else
set btrfs_relative_path="y"
set volume="${root}"
# if not in top level use subvolume based mounts
set root_subpath=""
if [ -n "${1}" ]; then
set img="@/.snapshots/${1}/snapshot"
Expand Down
Loading

0 comments on commit b19d09f

Please sign in to comment.