* Modularise vfat support. Also add fsck.vfat to the initrd. This
prevents errors when booting from VFAT (e.g. an ISO image converted using unetbootin). svn path=/nixos/trunk/; revision=32956
This commit is contained in:
parent
03ebb883d1
commit
9d89ca0c03
|
@ -259,4 +259,9 @@ in
|
||||||
touch /etc/NIXOS
|
touch /etc/NIXOS
|
||||||
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system
|
${config.environment.nix}/bin/nix-env -p /nix/var/nix/profiles/system --set /var/run/current-system
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Add vfat support to the initrd to enable people to copy the
|
||||||
|
# contents of the CD to a bootable USB stick.
|
||||||
|
boot.initrd.supportedFilesystems = [ "vfat" ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,6 +203,7 @@
|
||||||
./tasks/filesystems/ext.nix
|
./tasks/filesystems/ext.nix
|
||||||
./tasks/filesystems/nfs.nix
|
./tasks/filesystems/nfs.nix
|
||||||
./tasks/filesystems/reiserfs.nix
|
./tasks/filesystems/reiserfs.nix
|
||||||
|
./tasks/filesystems/vfat.nix
|
||||||
./tasks/kbd.nix
|
./tasks/kbd.nix
|
||||||
./tasks/lvm.nix
|
./tasks/lvm.nix
|
||||||
./tasks/network-interfaces.nix
|
./tasks/network-interfaces.nix
|
||||||
|
|
|
@ -41,10 +41,6 @@
|
||||||
|
|
||||||
# Virtio (QEMU, KVM etc.) support.
|
# Virtio (QEMU, KVM etc.) support.
|
||||||
"virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "virtio_console"
|
"virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "virtio_console"
|
||||||
|
|
||||||
# Add vfat to enable people to copy the contents of the CD to a
|
|
||||||
# bootable USB stick.
|
|
||||||
"vfat" "nls_cp437" "nls_iso8859-1"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.kernelModules =
|
boot.initrd.kernelModules =
|
||||||
|
|
|
@ -51,6 +51,6 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
# Include support for various filesystems.
|
# Include support for various filesystems.
|
||||||
boot.supportedFilesystems = [ "btrfs" "reiserfs" ];
|
boot.supportedFilesystems = [ "btrfs" "reiserfs" "vfat" ];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
25
modules/tasks/filesystems/vfat.nix
Normal file
25
modules/tasks/filesystems/vfat.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
inInitrd = any (fs: fs == "vfat") config.boot.initrd.supportedFilesystems;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = mkIf (any (fs: fs == "vfat") config.boot.supportedFilesystems) {
|
||||||
|
|
||||||
|
system.fsPackages = [ pkgs.dosfstools ];
|
||||||
|
|
||||||
|
boot.initrd.kernelModules = mkIf inInitrd [ "vfat" "nls_cp437" "nls_iso8859-1" ];
|
||||||
|
|
||||||
|
boot.initrd.extraUtilsCommands = mkIf inInitrd
|
||||||
|
''
|
||||||
|
cp -v ${pkgs.dosfstools}/sbin/dosfsck $out/bin
|
||||||
|
ln -sv dosfsck $out/bin/fsck.vfat
|
||||||
|
'';
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue