Skip to content

Commit 8d5abcd

Browse files
committed
nixos/install-grub: use more modern make_path
mkpath is a legacy interface. <!-- ps-id: 0f1e0583-9cc5-4006-a4a2-fd413fe8117e -->
1 parent effa0dc commit 8d5abcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nixos/modules/system/boot/loader/grub/install-grub.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use Class::Struct;
44
use XML::LibXML;
55
use File::Basename;
6-
use File::Path;
6+
use File::Path qw(make_path);
77
use File::stat;
88
use File::Copy;
99
use File::Copy::Recursive qw(rcopy pathrm);
@@ -98,7 +98,7 @@ sub runCommand {
9898

9999
print STDERR "updating GRUB 2 menu...\n";
100100

101-
mkpath("$bootPath/grub", 0, 0700);
101+
make_path("$bootPath/grub", { mode => 0700 });
102102

103103
# Discover whether the bootPath is on the same filesystem as / and
104104
# /nix/store. If not, then all kernels and initrds must be copied to
@@ -438,7 +438,7 @@ sub GrubFs {
438438
$conf .= "\n";
439439

440440
my %copied;
441-
mkpath("$bootPath/kernels", 0, 0755) if $copyKernels;
441+
make_path("$bootPath/kernels", { mode => 0755 }) if $copyKernels;
442442

443443
sub copyToKernelsDir {
444444
my ($path) = @_;
@@ -471,7 +471,7 @@ sub addEntry {
471471
my $systemName = basename(Cwd::abs_path("$path"));
472472
my $initrdSecretsPath = "$bootPath/kernels/$systemName-secrets";
473473

474-
mkpath(dirname($initrdSecretsPath), 0, 0755);
474+
make_path(dirname($initrdSecretsPath), { mode => 0755 });
475475
my $oldUmask = umask;
476476
# Make sure initrd is not world readable (won't work if /boot is FAT)
477477
umask 0137;

0 commit comments

Comments
 (0)