mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/lib/make-btrfs-fs: Use fakeroot and faketime (#265686)
This commit is contained in:
parent
9975ea9c37
commit
61bdb29a05
1 changed files with 4 additions and 2 deletions
|
@ -15,6 +15,8 @@
|
||||||
, volumeLabel
|
, volumeLabel
|
||||||
, uuid ? "44444444-4444-4444-8888-888888888888"
|
, uuid ? "44444444-4444-4444-8888-888888888888"
|
||||||
, btrfs-progs
|
, btrfs-progs
|
||||||
|
, libfaketime
|
||||||
|
, fakeroot
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -23,7 +25,7 @@ in
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.stdenv.mkDerivation {
|
||||||
name = "btrfs-fs.img${lib.optionalString compressImage ".zst"}";
|
name = "btrfs-fs.img${lib.optionalString compressImage ".zst"}";
|
||||||
|
|
||||||
nativeBuildInputs = [ btrfs-progs ] ++ lib.optional compressImage zstd;
|
nativeBuildInputs = [ btrfs-progs libfaketime fakeroot ] ++ lib.optional compressImage zstd;
|
||||||
|
|
||||||
buildCommand =
|
buildCommand =
|
||||||
''
|
''
|
||||||
|
@ -50,7 +52,7 @@ pkgs.stdenv.mkDerivation {
|
||||||
cp ${sdClosureInfo}/registration ./rootImage/nix-path-registration
|
cp ${sdClosureInfo}/registration ./rootImage/nix-path-registration
|
||||||
|
|
||||||
touch $img
|
touch $img
|
||||||
mkfs.btrfs -L ${volumeLabel} -U ${uuid} -r ./rootImage --shrink $img
|
faketime -f "1970-01-01 00:00:01" fakeroot mkfs.btrfs -L ${volumeLabel} -U ${uuid} -r ./rootImage --shrink $img
|
||||||
|
|
||||||
if ! btrfs check $img; then
|
if ! btrfs check $img; then
|
||||||
echo "--- 'btrfs check' failed for BTRFS image ---"
|
echo "--- 'btrfs check' failed for BTRFS image ---"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue