From 0d8a64eb96ba3c971c292c1bfb14d8a2f38f596a Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Thu, 16 Jul 2015 12:25:12 +0200 Subject: [PATCH] Add support for multiple partitions --- vps2arch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vps2arch b/vps2arch index 8d80e52..2acfc8f 100755 --- a/vps2arch +++ b/vps2arch @@ -39,7 +39,7 @@ download() { } download_and_extract_bootstrap() { - local sha1 filename + local sha1 filename target download iso/latest/sha1sums.txt | fgrep "$cpu_type.tar.gz" > "sha1sums.txt" read -r sha1 filename < "sha1sums.txt" download "iso/latest/$filename" > "$filename" @@ -50,9 +50,9 @@ download_and_extract_bootstrap() { mount --rbind /dev "/root.$cpu_type/dev" mount -t proc proc "/root.$cpu_type/proc" mount -t sysfs sys "/root.$cpu_type/sys" - # FIXME support multiple partitions - mount --bind / "/root.$cpu_type/mnt" - findmnt /boot >/dev/null && mount --bind /boot "/root.$cpu_type/mnt/boot" + findmnt -nlo TARGET -t btrfs,ext2,ext3,ext4,f2fs,jfs,nilfs2,reiser4,reiserfs,vfat,xfs,zfs | sort -u | while read -r target; do + mount --bind "$target" "/root.$cpu_type/mnt$target" + done # Workaround for Debian mkdir -p "/root.$cpu_type/run/shm" # Workaround for OpenVZ