| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/dracut/modules.d/90btrfs/ |
Upload File : |
#!/usr/bin/bash
# called by dracut
check() {
# if we don't have btrfs installed on the host system,
# no point in trying to support it in the initramfs.
require_binaries btrfs || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
[[ $fs == "btrfs" ]] && return 0
done
return 255
}
return 0
}
# called by dracut
depends() {
echo udev-rules
return 0
}
# called by dracut
cmdline() {
# Hack for slow machines
# see https://github.com/dracutdevs/dracut/issues/658
printf " rd.driver.pre=btrfs"
}
# called by dracut
installkernel() {
instmods btrfs
printf "%s\n" "$(cmdline)" > "${initdir}/etc/cmdline.d/00-btrfs.conf"
}
# called by dracut
install() {
if ! inst_rules 64-btrfs.rules; then
inst_rules "$moddir/80-btrfs.rules"
case "$(btrfs --help)" in
*device\ ready*)
inst_script "$moddir/btrfs_device_ready.sh" /sbin/btrfs_finished
;;
*)
inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished
;;
esac
else
inst_rules 64-btrfs-dm.rules
fi
if ! dracut_module_included "systemd"; then
inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh"
fi
inst_multiple -o btrfsck btrfs-zero-log
inst "$(command -v btrfs)" /sbin/btrfs
}