summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2009-01-12 15:19:12 -0600
committerJeremy Katz <katzj@redhat.com>2009-01-19 13:38:06 -0500
commit198bf1b216f78bb2bdc09c5622aa9ab7f076ddc8 (patch)
treea87c67c6f987135b9901b6f092e649b399675f86
parentd6c57672439d9393d06dfb20870fd6429d749d95 (diff)
downloadanaconda-198bf1b216f78bb2bdc09c5622aa9ab7f076ddc8.tar.gz
anaconda-198bf1b216f78bb2bdc09c5622aa9ab7f076ddc8.tar.xz
anaconda-198bf1b216f78bb2bdc09c5622aa9ab7f076ddc8.zip
btrfs install support
Now that btrfs is in mainline, let's let anaconda play with it too ;) We still need btrfs.ko in the kernel, and btrfs support in e2fsprogs. I've got the latter patch submitted upstream, and it's in rawhide now. Note that the below is 100% totally untested and may even have typos, my track record with python is not too good, sorry. :) So review would be appreciated.... Updated to address Radek's review, as well as adding the requisite witty (commandline-space-eating) boot option... (And stopped trying to use parted fs identification -- katzj) Signed-off-by: Eric Sandeen <sandeen@redhat.com>
-rw-r--r--fsset.py65
-rw-r--r--liveinst/liveinst.sh2
-rw-r--r--loader/loader.c2
-rwxr-xr-xscripts/mk-images2
-rwxr-xr-xscripts/upd-instroot5
5 files changed, 72 insertions, 4 deletions
diff --git a/fsset.py b/fsset.py
index 3972094f0..bb8b2a24d 100644
--- a/fsset.py
+++ b/fsset.py
@@ -727,6 +727,71 @@ class ext4FileSystem(extFileSystem):
fileSystemTypeRegister(ext4FileSystem())
+class btrfsFileSystem(FileSystemType):
+ def __init__(self):
+ FileSystemType.__init__(self)
+ self.formattable = 1
+ self.checked = 1
+ self.linuxnativefs = 1
+ self.bootable = False
+ self.maxLabelChars = 256
+ # Wow, you must be brave!
+ # this is totally, 100% unsupported. Boot with "linux btrfs"
+ # at the boot: prompt will let you make new btrfs filesystems
+ # in the installer.
+ if flags.cmdline.has_key("icantbelieveitsnotbtr"):
+ self.supported = -1
+ else:
+ self.supported = 0
+
+ self.name = "btrfs"
+ self.packages = [ "btrfs-progs" ]
+ self.needProgram = [ "mkfs.btrfs", "btrfsctl" ]
+
+ # Bigger, really, depending on machine
+ self.maxSizeMB = 16 * 1024 * 1024
+
+ # We'll sneakily label it here, too.
+ def formatDevice(self, entry, progress, chroot='/'):
+ devicePath = entry.device.setupDevice(chroot)
+ label = self.createLabel(entry.mountpoint, self.maxLabelChars,
+ kslabel = entry.label)
+
+ rc = iutil.execWithRedirect("mkfs.btrfs",
+ ["-L", label, devicePath],
+ stdout = "/dev/tty5",
+ stderr = "/dev/tty5", searchPath = 1)
+
+ if rc:
+ raise SystemError
+ entry.setLabel(label)
+ def labelDevice(self, entry, chroot):
+ # We did this on the initial format; no standalone labeler yet
+ pass
+
+ def resize(self, entry, size, progress, chroot='/'):
+ devicePath = entry.device.setupDevice(chroot)
+ log.info("resizing %s" %(devicePath,))
+
+ w = None
+ if progress:
+ w = progress(_("Resizing"),
+ _("Resizing filesystem on %s...") %(devicePath),
+ 100, pulse = True)
+
+ rc = iutil.execWithPulseProgress("btrfsctl",
+ ["-r", "%sM" %(size,), devicePath],
+ stdout="/tmp/resize.out",
+ stderr="/tmp/resize.out",
+ progress = w)
+ if progress:
+ w.pop()
+ if rc:
+ raise ResizeError, ("Resize of %s failed: %s" %(devicePath, rc), devicePath)
+
+
+fileSystemTypeRegister(btrfsFileSystem())
+
class raidMemberDummyFileSystem(FileSystemType):
def __init__(self):
FileSystemType.__init__(self)
diff --git a/liveinst/liveinst.sh b/liveinst/liveinst.sh
index 36c977252..8e18b43c6 100644
--- a/liveinst/liveinst.sh
+++ b/liveinst/liveinst.sh
@@ -32,7 +32,7 @@ if [ ! -b $LIVE_BLOCK ]; then
fi
# load modules that would get loaded by the loader... (#230945)
-for i in raid0 raid1 raid5 raid6 raid456 raid10 fat msdos gfs2 reiserfs ext2 ext3 jfs xfs dm-mod dm-zero dm-mirror dm-snapshot dm-multipath dm-round-robin vfat ; do /sbin/modprobe $i ; done
+for i in raid0 raid1 raid5 raid6 raid456 raid10 fat msdos gfs2 reiserfs ext2 ext3 jfs xfs btrfs dm-mod dm-zero dm-mirror dm-snapshot dm-multipath dm-round-robin vfat ; do /sbin/modprobe $i ; done
export ANACONDA_PRODUCTNAME=$( cat /etc/system-release | cut -d ' ' -f 1 )
export ANACONDA_PRODUCTVERSION=$( cat /etc/system-release | sed -r -e 's/^.*([0-9]+) *\(.*$/\1/' )
diff --git a/loader/loader.c b/loader/loader.c
index 4a2c2e6c3..10ac30756 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2044,7 +2044,7 @@ int main(int argc, char ** argv) {
stop_fw_loader(&loaderData);
start_fw_loader(&loaderData);
- mlLoadModuleSet("raid0:raid1:raid5:raid6:raid456:raid10:linear:fat:msdos:gfs2:reiserfs:jfs:xfs:dm-mod:dm-zero:dm-mirror:dm-snapshot:dm-multipath:dm-round-robin:dm-crypt:cbc:sha256:lrw:xts");
+ mlLoadModuleSet("raid0:raid1:raid5:raid6:raid456:raid10:linear:fat:msdos:gfs2:reiserfs:jfs:xfs:btrfs:dm-mod:dm-zero:dm-mirror:dm-snapshot:dm-multipath:dm-round-robin:dm-crypt:cbc:sha256:lrw:xts");
if (!access("/mnt/runtime/usr/lib/libunicode-lite.so.1", R_OK))
setenv("LD_PRELOAD", "/mnt/runtime/usr/lib/libunicode-lite.so.1", 1);
diff --git a/scripts/mk-images b/scripts/mk-images
index 401c15a91..d745c7f58 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -112,7 +112,7 @@ FIREWIREMODS="ohci1394 sbp2 fw-ohci fw-sbp2 firewire-sbp2 firewire-ohci"
SDMODS="mmc-block sdhci sdhci-pci"
IDEMODS="ide-cd ide-cd_mod"
SCSIMODS="sr_mod sg st sd_mod scsi_mod iscsi_tcp iscsi_ibft"
-FSMODS="fat msdos vfat ext2 ext3 ext4 reiserfs jfs xfs gfs2 cifs fuse"
+FSMODS="fat msdos vfat ext2 ext3 ext4 reiserfs jfs xfs gfs2 cifs fuse btrfs"
LVMMODS="dm-mod dm-zero dm-snapshot dm-mirror dm-multipath dm-round-robin dm-crypt"
RAIDMODS="raid0 raid1 raid5 raid6 raid456 raid10 linear"
CRYPTOMODS="sha256_generic cbc xts lrw aes_generic crypto_blkcipher crc32c ecb arc4"
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index f0edce841..ae37ab64f 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -150,7 +150,7 @@ die () {
PACKAGES="GConf2 NetworkManager ORBit2 PolicyKit VLGothic-fonts acl anaconda
anaconda-yum-plugins at-spi atk attr audit-libs bash bitmap-fonts-cjk
- booty busybox-anaconda bzip2 bzip2-libs cairo cjkunifonts-uming
+ booty btrfs-progs busybox-anaconda bzip2 bzip2-libs cairo cjkunifonts-uming
comps-extras coreutils cpio cracklib cracklib-dicts cracklib-python
cryptsetup-luks db4 dbus dbus-python dejavu-sans-fonts
dejavu-sans-mono-fonts device-mapper
@@ -345,6 +345,8 @@ lib/udev
sbin/*gfs*
sbin/arping
sbin/badblocks
+sbin/btrfsctl
+sbin/btrfsck
sbin/busybox.anaconda
sbin/clock
sbin/consoletype
@@ -379,6 +381,7 @@ sbin/lvm*
sbin/mdadm
sbin/mkdosfs
sbin/mke2fs
+sbin/mkfs.btrfs
sbin/mkfs.ext2
sbin/mkfs.ext3
sbin/mkfs.gfs2