mirror of
https://gitlab.com/JBBgameich/halium-install
synced 2025-11-03 20:45:42 +08:00
dir mode: use dpkg-divert
This commit is contained in:
@@ -36,7 +36,12 @@ function inject_androidimage() {
|
||||
sudo mv "$IMAGE_DIR/system.img" "$ROOTFS_DIR/var/lib/lxc/android/"
|
||||
|
||||
# Make sure the mount path is correct
|
||||
sudo sed -i 's,/data/system.img,/var/lib/lxc/android/system.img,g' "$ROOTFS_DIR/lib/systemd/system/system.mount"
|
||||
if chroot_run "command -v dpkg-divert"; then # On debian distros, use dpkg-divert
|
||||
chroot_run "dpkg-divert --add --rename --divert /lib/systemd/system/system.mount.image /lib/systemd/system/system.mount"
|
||||
sed 's,/data/system.img,/var/lib/lxc/android/system.img,g' "$ROOTFS_DIR/lib/systemd/system/system.mount.image" | sudo tee -a "$ROOTFS_DIR/lib/systemd/system/system.mount" >/dev/null 2>&1
|
||||
else # Else just replace the path directly (not upgrade safe)
|
||||
sed -i 's,/data/system.img,/var/lib/lxc/android/system.img,g' "$ROOTFS_DIR/lib/systemd/system/system.mount.image"
|
||||
fi
|
||||
}
|
||||
|
||||
function unmount() {
|
||||
|
||||
@@ -65,7 +65,7 @@ function test_syntax() {
|
||||
|
||||
# Image mode
|
||||
function test_img_exit_success() {
|
||||
halium-install --mode img --test-mode -v -p debian-pm -u 1234 -r 1234 "${ROOTFS_PATH}" "${ANDROID_IMG_PATH}"
|
||||
halium-install --mode img --test-mode -v -p debian-pm -u 1234 -r 1234 "${ROOTFS_PATH}" "${ANDROID_IMG_PATH}" > "${TMP_PATH}/log" 2>&1
|
||||
}
|
||||
|
||||
function test_mount() {
|
||||
|
||||
Reference in New Issue
Block a user