gen_initramfs: embed btrfs-progs utils in initramfs

This patch comes from Dennis 'dlan' Lan through bug #481116.
master
Fabio Erculiani 12 years ago
parent 9d8560729f
commit 7b5a70a29e

@ -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

@ -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}"

Loading…
Cancel
Save