summaryrefslogtreecommitdiff
path: root/archiso/initcpio
diff options
context:
space:
mode:
Diffstat (limited to 'archiso/initcpio')
-rw-r--r--archiso/initcpio/hooks/archiso18
-rw-r--r--archiso/initcpio/install/archiso1
2 files changed, 17 insertions, 2 deletions
diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso
index 3ef4eb1..9d38f07 100644
--- a/archiso/initcpio/hooks/archiso
+++ b/archiso/initcpio/hooks/archiso
@@ -1,5 +1,5 @@
# args: source, newroot, mountpoint
-_mnt_fs() {
+_mnt_dmsnapshot() {
local img="${1}"
local newroot="${2}"
local mnt="${3}"
@@ -37,6 +37,16 @@ _mnt_fs() {
echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices
}
+# args: source, newroot, mountpoint
+_mnt_overlayfs() {
+ local src="${1}"
+ local newroot="${2}"
+ local mnt="${3}"
+ mkdir -p /run/archiso/cowspace/${cow_directory}/upperdir /run/archiso/cowspace/${cow_directory}/workdir
+ mount -t overlay -o lowerdir=${src},upperdir=/run/archiso/cowspace/${cow_directory}/upperdir,workdir=/run/archiso/cowspace/${cow_directory}/workdir airootfs "${newroot}${mnt}"
+}
+
+
# args: /path/to/image_file, mountpoint
_mnt_sfs() {
local img="${1}"
@@ -165,7 +175,11 @@ archiso_mount_handler() {
mkdir -p "/run/archiso/cowspace/${cow_directory}"
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs" "/run/archiso/sfs/airootfs"
- _mnt_fs "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/"
+ if [[ -f "/run/archiso/sfs/airootfs/airootfs.img" ]]; then
+ _mnt_dmsnapshot "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/"
+ else
+ _mnt_overlayfs "/run/archiso/sfs/airootfs" "${newroot}" "/"
+ fi
if [[ "${copytoram}" == "y" ]]; then
umount /run/archiso/bootmnt
diff --git a/archiso/initcpio/install/archiso b/archiso/initcpio/install/archiso
index e506271..300dfef 100644
--- a/archiso/initcpio/install/archiso
+++ b/archiso/initcpio/install/archiso
@@ -4,6 +4,7 @@ build() {
add_module "cdrom"
add_module "loop"
add_module "dm-snapshot"
+ add_module "overlay"
add_runscript