[arkdep] On layer lock root if required
This commit is contained in:
parent
f5819bcf95
commit
839cf12126
1 changed files with 16 additions and 3 deletions
19
arkdep
19
arkdep
|
@ -1323,14 +1323,27 @@ layer () {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Unlock the partition
|
# Check if root should be locked again after running
|
||||||
btrfs property set -f -ts / ro false ||
|
if btrfs property get / 2> /dev/null | grep -q 'ro=true'; then
|
||||||
cleanup_and_quit 'Failed to unlock root partition'
|
declare -r lock_when_done=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Unlock root
|
||||||
|
if [[ $lock_when_done -eq 1 ]]; then
|
||||||
|
btrfs property set -f -ts / ro false ||
|
||||||
|
cleanup_and_quit 'Failed to unlock root partition'
|
||||||
|
fi
|
||||||
|
|
||||||
# Install the packages
|
# Install the packages
|
||||||
$package_layer_command ${progs_clean[@]} ||
|
$package_layer_command ${progs_clean[@]} ||
|
||||||
cleanup_and_quit 'Failed to install requested packages'
|
cleanup_and_quit 'Failed to install requested packages'
|
||||||
|
|
||||||
|
# Lock root if it was previously locked
|
||||||
|
if [[ $lock_when_done -eq 1 ]]; then
|
||||||
|
btrfs property set -f -ts / ro true ||
|
||||||
|
cleanup_and_quit 'Failed to unlock root partition'
|
||||||
|
fi
|
||||||
|
|
||||||
# If installation was successful add to layer tracker file
|
# If installation was successful add to layer tracker file
|
||||||
printf "%s\n" "${progs_clean[@]}" >> $arkdep_dir/layer
|
printf "%s\n" "${progs_clean[@]}" >> $arkdep_dir/layer
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue