"ubimage" module contains ubifs image + instructions

Presently either you run this from U-Boot or you figure out for
yourself how to kexecboot into a recovery system :-)
This commit is contained in:
Daniel Barlow
2023-10-21 23:20:53 +01:00
parent d2f517a4e9
commit e6ef4f78bb
2 changed files with 114 additions and 1 deletions

View File

@@ -35,9 +35,10 @@ in
in runCommand "mkfs.ubifs" {
depsBuildBuild = [ mtdutils ];
} ''
mkdir -p $TMPDIR/empty/nix/store/ $TMPDIR/empty/secrets
mkdir -p $TMPDIR/empty/nix/store/ $TMPDIR/empty/secrets $TMPDIR/empty/boot
cp ${systemConfiguration}/bin/activate $TMPDIR/empty/activate
ln -s ${pkgs.s6-init-bin}/bin/init $TMPDIR/empty/init
cp ${config.system.outputs.uimage} $TMPDIR/empty/boot/uimage
mkdir -p $TMPDIR/empty/nix/store
for path in $(cat ${systemConfiguration}/etc/nix-store-paths) ; do
(cd $TMPDIR/empty && cp -a $path .$path)