From 7b5a70a29ebdedf9fdd87538ede3b752a4e9fb15 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 18 Aug 2013 13:05:56 +0200 Subject: [PATCH] gen_initramfs: embed btrfs-progs utils in initramfs This patch comes from Dennis 'dlan' Lan through bug #481116. --- gen_determineargs.sh | 1 + gen_initramfs.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 4e016d6..35ab701 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -125,6 +125,7 @@ determine_real_args() { set_config_with_override STRING MDADM_CONFIG CMD_MDADM_CONFIG set_config_with_override BOOL E2FSPROGS CMD_E2FSPROGS "no" set_config_with_override BOOL ZFS CMD_ZFS + set_config_with_override BOOL BTRFS CMD_BTRFS set_config_with_override BOOL VIRTIO CMD_VIRTIO "no" set_config_with_override BOOL MULTIPATH CMD_MULTIPATH set_config_with_override BOOL FIRMWARE CMD_FIRMWARE diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 2527dca..f7881c8 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -367,6 +367,23 @@ append_zfs(){ rm -rf "${TEMP}/initramfs-zfs-temp" > /dev/null } +append_btrfs() { + if [ -d "${TEMP}/initramfs-btrfs-temp" ] + then + rm -r "${TEMP}/initramfs-btrfs-temp" + fi + + # Copy binaries + copy_binaries "${TEMP}/initramfs-btrfs-temp" /sbin/{btrfs,btrfsck,mkfs.btrfs} + + cd "${TEMP}/initramfs-btrfs-temp/" + log_future_cpio_content + find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ + || gen_die "compressing btrfs cpio" + cd "${TEMP}" + rm -rf "${TEMP}/initramfs-btrfs-temp" > /dev/null +} + append_splash(){ splash_geninitramfs=`which splash_geninitramfs 2>/dev/null` if [ -x "${splash_geninitramfs}" ] @@ -922,6 +939,8 @@ create_initramfs() { append_data 'zfs' "${ZFS}" + append_data 'btrfs' "${BTRFS}" + append_data 'blkid' "${DISKLABEL}" append_data 'splash' "${SPLASH}"