index : mkinitcpio-archiso32 | |
Archlinux32 initcpio scripts used by archiso | 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 | b79eaf302dc387c8ed80fa3d935c069c4576b583 (patch) | |
tree | 08fa24a2168c0ec01c65755ce1f1236694856be4 /hooks | |
parent | 25dd3aba62f0fe28f76c6a3c2ab1bba3cd479199 (diff) |
-rw-r--r-- | hooks/archiso | 18 |
diff --git a/hooks/archiso b/hooks/archiso index 3ef4eb1..9d38f07 100644 --- a/hooks/archiso +++ b/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 |