Commit Graph

23 Commits

Author SHA1 Message Date
Colin L Rice
c861f8083d sd-image: Add the compressed file path for hydra.
This makes the nixos on arm user instructions work again.
2019-11-05 10:10:51 -05:00
AmineChikhaoui
6ce605e18d
sdImage: add option to enable bzip2 compression
also make SD image compression the default setup.
Fixes issues with output size such as: https://hydra.nixos.org/build/102163603
2019-09-30 15:42:13 -04:00
Silvan Mosberger
f47ef8fcf7
sdImage: use findmnt to get root device when resizing (#58059)
sdImage: use findmnt to get root device when resizing
2019-09-20 23:28:01 +02:00
Ben Wolsieffer
9e5aa25c53 sd-image: don't use installer.cloneConfig option that is not imported
This once again allows sd-image.nix to imported standalone to build SD images
of arbitrary NixOS systems.
2019-09-01 14:15:33 -04:00
Silvan Mosberger
478e7184f8
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type

Also fix up some minor module problems along the way
2019-08-31 18:19:00 +02:00
Florian Klink
0aa5e3165c sd-image.nix: set installer.cloneConfig to false
As SD Card images are both installation media and installation target,
don't copy over a /etc/nixos/configuration.nix

Closes #63576.
2019-08-19 16:34:06 +02:00
Sarah Brofeldt
e0cf7d6093 nixos/sd-image: Increase default firmware partition size 2019-08-18 22:55:39 +02:00
Samuel Dionne-Riel
288118cdfa sd-image: Adds removed options for removed options
This will keep configuration configuring the size of the /boot partition
still build, while showing the deprecation warning.

In 99.9% of cases I assume ignoring the configuration is better, as the
sd-image builder already is pretty opinionated in that matter.
2019-06-16 17:47:32 -04:00
Samuel Dionne-Riel
c113c094cf sd-image: Pull less slack in the image by accounting for slack
The slack, seemingly, accounted for more than the minimum required for
slack plus the two partitions.

This change makes the gap a somewhat abstracted amount, but is not
configurable within the derivation.
2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel
1843e00146 sd-image: Updates comments 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel
8634d5700d sd-image: firmware partition reduced to 20MiB 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel
53884e1b94 sd-image: Switch /boot to the ext4 partition 2019-06-16 17:47:31 -04:00
Samuel Dionne-Riel
6e9e78b618 sd-image: Moves /boot into rootfs
The current FAT32 partition is kept as it is required for the Raspberry
Pi family of hardware. It is where the firmware is kept.

The partition is kept bootable, and the boot files kept in there until
the following commits, to keep all commits of this series individually
bootable.
2019-06-16 17:47:30 -04:00
Michael Eden
bd7bcb5576 sdImage: use findmnt to get root device when resizing 2019-03-21 11:34:20 -04:00
Samuel Dionne-Riel
1b6a4d3979 sd-image: Do not use batch operation for mcopy.
```
       b      Batch mode. Optimized for huge recursive copies, but less secure if a crash happens during the copy.
```

It seems the "less secure if a crash happens" does not need a crash to
happen.

With batch mode:

```
/[...]/.
  Start (0) does not point to parent (___)
```

For pretty much everything copied in.

Without batch mode, everything passes `fsck`.

See #51150
2018-11-29 01:50:30 +02:00
Samuel Dionne-Riel
2e5eb135aa sd-image: Verifies the FAT partition before copying it.
This is to ensure `mtools`-based operations don't wreck the FS.
2018-11-29 01:50:30 +02:00
John Ericson
2c2f1e37d4 reewide: Purge all uses stdenv.system and top-level system
It is deprecated and will be removed after 18.09.
2018-08-30 17:20:32 -04:00
Will Fancher
f0957b9477 sd-image: Fix cross compiling 2018-08-21 14:05:23 +03:00
Andrew Dunham
d7bfd04301 sdImage: make partition ID/UUID configurable 2018-07-12 17:02:03 +03:00
Tuomas Tynkkynen
4c21180a13 nixos/sd-image: Make it more similar to iso-image.nix
- Add `imageName` and `imageBaseName` options similar to the `isoName`
  and `isoBaseName` options
- Make the filename of the iso match what iso-image.nix does
- Generate a nix-support/hydra-build-products like iso-image.nix does
2018-04-02 15:18:25 +03:00
Tuomas Tynkkynen
60f5659dad treewide: Use correct output in ${config.nix.package}/bin 2016-04-25 16:44:37 +02:00
Tuomas Tynkkynen
4cf9bf9eb0 sd-image.nix: Move the /boot partition up to 8M
Reportedly some ARM boards need some boot code at the start of a SD card
that could be larger than a megabyte. Change it to 8M, and while at it
reduce the /boot size such that the root partition should now start on a
128M boundary (the flash on SD cards really don't like non-aligned
writes these days).
2016-02-01 10:46:17 +02:00
Tuomas Tynkkynen
df86813d97 nixos: Add derivations for SD card installation images on ARM
The resulting image can be copied to a SD card with `dd` and is directly
bootable by a suitably configured U-Boot. Though depending on the board, some
extra steps are required for copying U-Boot itself to the SD card.

Inside the image is a partition table, with a FAT32 /boot and a normal
writable EXT4 rootfs. It's possible to directly reuse the SD image's
partition layout and "install" NixOS on the same SD card by replacing
the default configuration.nix and nixos-rebuild, and actually is the
preferred way to use these images. To assist in this installation
method, the boot scripts on the image automatically resize the rootfs
partition to fit the SD card on the first boot.

The SD images come in two flavors; one for the ARMv6 Raspberry Pi,
and one multiplatform image for all the boards supported by the
mainline kernel's multi_v7_defconfig config target. At the moment, these
have been tested on:
    - Raspberry Pi Model B (512MB model)
    - NVIDIA Jetson TK1
    - Linksprite pcDuino3 Nano

To build, run:

nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage \
    -I nixos-config='<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix>'
2015-07-26 00:31:20 +03:00