index : archiso32 | |
Archlinux32 iso tools | gitolite user |
summaryrefslogtreecommitdiff |
author | Gerardo Exequiel Pozzi <vmlinuz386@gmail.com> | 2015-01-27 14:37:05 -0300 |
---|---|---|
committer | Gerardo Exequiel Pozzi <vmlinuz386@gmail.com> | 2015-01-27 14:37:05 -0300 |
commit | a637bdb8574168ab4cddef13d5de7f458650bda5 (patch) | |
tree | ec3b5bb312b9c1f987d6a14a3e996a1dad4eef3d /archiso/initcpio | |
parent | fe29d5f334608f5ae93a40d4947aab1cb8517340 (diff) |
-rw-r--r-- | archiso/initcpio/hooks/archiso | 18 | ||||
-rw-r--r-- | archiso/initcpio/install/archiso | 1 |
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 |