Skip to content

Commit

Permalink
Add image for overtaking using direct download to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelicorn committed Mar 9, 2024
1 parent 54b6546 commit 99320b2
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ ssh root@<ip>
dmsetup remove root # Close old root cryptsetup mapper if you have that
systemd-repart --copy-from --dry-run=no --empty=force /run/image.raw /dev/vda
```

## Tar based, curl method

If you directly want to deploy an image that's larger than your available memory,
you can use the following approach, where you upload the image (age encrypted)
to a remote server and redirect the output through decryption onto the disk.

```bash
mkosi --image=debian-tar build
rsync -zP mkosi.output/debian-tar.tar root@ip:/root/
ssh root@<ip>
mkdir -p /run/nextroot
cd /run/nextroot
tar -xf /local_scratch/image.tar
cp /etc/ssh/ssh_host_* etc/ssh/
systemctl soft-reboot
ssh root@<ip>
cryptsetup close root # Close old root cryptsetup mapper if you have that
curl -s https://example.com/mkosi.age | age -d | dd of=/dev/sda bs=4M status=progress
```
23 changes: 23 additions & 0 deletions mkosi.images/debian-tar-curl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Distribution]
Distribution=debian
Release=sid

[Content]
Timezone=UTC
Packages=
systemd
dbus
udev
bash
ca-certificates
openssh-server
util-linux
util-linux-extra
systemd-resolved
coreutils
cryptsetup
curl
age

[Output]
@Format=tar

0 comments on commit 99320b2

Please sign in to comment.