Add btrfs support.
This commit is contained in:
parent
3a43f3c1bc
commit
8589e0ca80
@ -57,8 +57,8 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH.
|
||||
are liable to be used by the new invocation.
|
||||
|
||||
--fs=fs Specify the filesystem type to use for the new guest.
|
||||
Valid choices are 'ext2', 'ext3', 'ext4', 'reiserfs', or
|
||||
'xfs'.
|
||||
Valid choices are 'ext2', 'ext3', 'ext4', 'reiserfs',
|
||||
'xfs' or 'btrfs'.
|
||||
|
||||
|
||||
--image=str Specify whether to create "sparse" or "full" disk images.
|
||||
@ -1403,6 +1403,7 @@ sub setupDefaultOptions
|
||||
$CONFIG{ 'make_fs_ext4' } = 'mkfs.ext4 -F';
|
||||
$CONFIG{ 'make_fs_xfs' } = 'mkfs.xfs -f';
|
||||
$CONFIG{ 'make_fs_reiserfs' } = 'mkfs.reiserfs -f -q';
|
||||
$CONFIG{ 'make_fs_btrfs' } = 'mkfs.btrfs';
|
||||
|
||||
#
|
||||
# Flags to pass to "mount" to mount our image.
|
||||
@ -1415,6 +1416,7 @@ sub setupDefaultOptions
|
||||
$CONFIG{ 'mount_fs_ext4' } = '-t ext4';
|
||||
$CONFIG{ 'mount_fs_xfs' } = '-t xfs';
|
||||
$CONFIG{ 'mount_fs_reiserfs' } = '-t reiserfs';
|
||||
$CONFIG{ 'mount_fs_btrfs' } = '-t btrfs';
|
||||
|
||||
#
|
||||
# Network options.
|
||||
@ -1558,8 +1560,8 @@ sub checkOption
|
||||
message => "must be a valid hostname.\n",
|
||||
},
|
||||
supportedFs => {
|
||||
check => qr/^(ext[234]|xfs|reiserfs)$/,
|
||||
message => "must be a supported filesystem (ext2, ext3, ext4, xfs or reiserfs).\n",
|
||||
check => qr/^(ext[234]|xfs|reiserfs|btrfs)$/,
|
||||
message => "must be a supported filesystem (ext2, ext3, ext4, xfs, reiserfs or btrfs).\n",
|
||||
},
|
||||
yesNo => {
|
||||
check => qr/^yes|no$/i,
|
||||
|
||||
2
debian/control
vendored
2
debian/control
vendored
@ -12,7 +12,7 @@ Package: xen-tools
|
||||
Architecture: all
|
||||
Depends: debootstrap | cdebootstrap, perl-modules, libtext-template-perl, libconfig-inifiles-perl, libfile-slurp-perl, ${misc:Depends}
|
||||
Recommends: xen-hypervisor-amd64 | xen-hypervisor-i386 | xen-hypervisor-i386-pae, rinse, xen-shell, libexpect-perl
|
||||
Suggests: reiserfsprogs, xfsprogs, xen-utils, cfengine2, evms-cli
|
||||
Suggests: reiserfsprogs, xfsprogs, xen-utils, cfengine2, evms-cli, btrfs-tools
|
||||
Description: Tools to manage Xen virtual servers
|
||||
This package contains tools to manage Debian based Xen virtual servers.
|
||||
.
|
||||
|
||||
@ -294,6 +294,7 @@ ext3_options = noatime,nodiratime,errors=remount-ro
|
||||
ext2_options = noatime,nodiratime,errors=remount-ro
|
||||
xfs_options = defaults
|
||||
reiserfs_options = defaults
|
||||
btrfs_options = defaults
|
||||
|
||||
#
|
||||
# Uncomment if you wish newly created images to boot once they've been
|
||||
|
||||
@ -63,6 +63,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -88,6 +89,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -108,6 +112,9 @@ done
|
||||
#if [ $has_reiserfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} reiserfsprogs
|
||||
#fi
|
||||
#if [ $has_btrfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} btrfs-tools
|
||||
#fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -64,6 +64,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -89,6 +90,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -109,6 +113,9 @@ done
|
||||
#if [ $has_reiserfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} reiserfsprogs
|
||||
#fi
|
||||
#if [ $has_btrfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} btrfs-tools
|
||||
#fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -60,6 +60,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -85,6 +86,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -105,6 +109,9 @@ fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
if [ $has_btrfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} btrfs-tools
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -59,6 +59,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -84,6 +85,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -104,6 +108,9 @@ fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
if [ $has_btrfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} btrfs-tools
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -60,6 +60,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -85,6 +86,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -105,6 +109,9 @@ fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
if [ $has_btrfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} btrfs-tools
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -63,6 +63,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -88,6 +89,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -108,6 +112,9 @@ done
|
||||
#if [ $has_reiserfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} reiserfsprogs
|
||||
#fi
|
||||
#if [ $has_btrfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} btrfs-tools
|
||||
#fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -60,6 +60,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -85,6 +86,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -105,6 +109,9 @@ done
|
||||
#if [ $has_reiserfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} reiserfsprogs
|
||||
#fi
|
||||
#if [ $has_btrfs -eq 1 ]; then
|
||||
# installDebianPackage ${prefix} btrfs-tools
|
||||
#fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -60,6 +60,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -85,6 +86,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -105,6 +109,9 @@ fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
if [ $has_btrfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} btrfs-tools
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -60,6 +60,7 @@ logMessage "Root device is /dev/$device"
|
||||
#
|
||||
has_xfs=0
|
||||
has_reiserfs=0
|
||||
has_btrfs=0
|
||||
cat <<E_O_FSTAB > ${prefix}/etc/fstab
|
||||
# /etc/fstab: static file system information.
|
||||
#
|
||||
@ -85,6 +86,9 @@ for part in `seq 1 ${NUMPARTITIONS}`; do
|
||||
reiserfs)
|
||||
has_reiserfs=1
|
||||
;;
|
||||
btrfs)
|
||||
has_btrfs=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${partdata2}" = "swap" ]; then
|
||||
@ -105,6 +109,9 @@ fi
|
||||
if [ $has_reiserfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} reiserfsprogs
|
||||
fi
|
||||
if [ $has_btrfs -eq 1 ]; then
|
||||
installDebianPackage ${prefix} btrfs-tools
|
||||
fi
|
||||
|
||||
|
||||
#
|
||||
|
||||
@ -111,7 +111,7 @@ _xen_create_image()
|
||||
return 0
|
||||
;;
|
||||
--fs)
|
||||
COMPREPLY=( $( compgen -W 'xfs ext3 reiserfs' -- "${COMP_WORDS[COMP_CWORD]}" ) )
|
||||
COMPREPLY=( $( compgen -W 'ext2 ext3 ext4 xfs reiserfs btrfs' -- "${COMP_WORDS[COMP_CWORD]}" ) )
|
||||
return 0
|
||||
;;
|
||||
--genpass)
|
||||
|
||||
@ -18,7 +18,9 @@ my @required = qw( /bin/ls /bin/dd /bin/mount /bin/cp /bin/tar );
|
||||
# Files that we might wish to use.
|
||||
#
|
||||
my @optional = qw( /usr/sbin/debootstrap /usr/bin/rpmstrap /usr/sbin/xm
|
||||
/sbin/mkfs.ext3 /sbin/mkfs.xfs /sbin/mkfs.reiserfs );
|
||||
/sbin/mkfs.ext3 /sbin/mkfs.xfs /sbin/mkfs.reiserfs
|
||||
/sbin/mkfs.btrfs
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user