liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 601bb289eeb21b44c4be1eb063bf35844e39a5ff
parent 876bd7d8ce244bb6b68144ae3262cb94d7725a95
Author: Daniel Barlow <dan@telent.net>
Date:   Mon, 11 Dec 2023 19:04:34 +0000

rename diskimage to mbrimage

Diffstat:
Mdevices/turris-omnia/default.nix | 2+-
Dmodules/outputs/diskimage.nix | 51---------------------------------------------------
Amodules/outputs/mbrimage.nix | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/devices/turris-omnia/default.nix b/devices/turris-omnia/default.nix @@ -15,7 +15,7 @@ imports = [ ../../modules/arch/arm.nix ../modules/outputs/tftpboot.nix - ../modules/outputs/diskimage.nix + ../modules/outputs/mbrimage.nix ../modules/outputs/extlinux.nix ../modules/outputs/ext4fs.nix ]; diff --git a/modules/outputs/diskimage.nix b/modules/outputs/diskimage.nix @@ -1,51 +0,0 @@ -{ - config -, pkgs -, lib -, ... -}: -let - inherit (lib) mkOption types concatStringsSep; - o = config.system.outputs; - phram_address = lib.toHexString (config.hardware.ram.startAddress + 256 * 1024 * 1024); -in { - options.system.outputs = { - diskimage = mkOption { - type = types.package; - description = '' - diskimage - ********* - - This creates a disk image file with a partition table containing - the contents of ``outputs.rootfs`` as its only partition. - ''; - }; - vmdisk = mkOption { type = types.package; }; - }; - - config = { - system.outputs = { - diskimage = - let - o = config.system.outputs; - in pkgs.runCommand "diskimage" { - depsBuildBuild = [ pkgs.pkgsBuildBuild.util-linux ]; - } '' - # leave 4 sectors at start for partition table - # and alignment to 2048 bytes (does that help?) - dd if=${o.rootfs} of=$out bs=512 seek=4 conv=sync - echo '4,-,L,*' | sfdisk $out - ''; - vmdisk = pkgs.runCommand "vmdisk" {} '' - mkdir $out - cd $out - ln -s ${o.diskimage} ./diskimage - cat > run.sh <<EOF - #!${pkgs.runtimeShell} - ${pkgs.pkgsBuildBuild.run-liminix-vm}/bin/run-liminix-vm --arch ${pkgs.stdenv.hostPlatform.qemuArch} --u-boot ${pkgs.ubootQemuArm}/u-boot.bin --phram-address 0x${phram_address} --disk-image ${o.diskimage} /dev/null /dev/null - EOF - chmod +x run.sh - ''; - }; - }; -} diff --git a/modules/outputs/mbrimage.nix b/modules/outputs/mbrimage.nix @@ -0,0 +1,51 @@ +{ + config +, pkgs +, lib +, ... +}: +let + inherit (lib) mkOption types concatStringsSep; + o = config.system.outputs; + phram_address = lib.toHexString (config.hardware.ram.startAddress + 256 * 1024 * 1024); +in { + options.system.outputs = { + mbrimage = mkOption { + type = types.package; + description = '' + mbrimage + ********* + + This creates a disk image file with a partition table containing + the contents of ``outputs.rootfs`` as its only partition. + ''; + }; + vmdisk = mkOption { type = types.package; }; + }; + + config = { + system.outputs = { + mbrimage = + let + o = config.system.outputs; + in pkgs.runCommand "mbrimage" { + depsBuildBuild = [ pkgs.pkgsBuildBuild.util-linux ]; + } '' + # leave 4 sectors at start for partition table + # and alignment to 2048 bytes (does that help?) + dd if=${o.rootfs} of=$out bs=512 seek=4 conv=sync + echo '4,-,L,*' | sfdisk $out + ''; + vmdisk = pkgs.runCommand "vmdisk" {} '' + mkdir $out + cd $out + ln -s ${o.mbrimage} ./mbrimage + cat > run.sh <<EOF + #!${pkgs.runtimeShell} + ${pkgs.pkgsBuildBuild.run-liminix-vm}/bin/run-liminix-vm --arch ${pkgs.stdenv.hostPlatform.qemuArch} --u-boot ${pkgs.ubootQemuArm}/u-boot.bin --phram-address 0x${phram_address} --disk-image ${o.mbrimage} /dev/null /dev/null + EOF + chmod +x run.sh + ''; + }; + }; +}