Dimitris Karakasilis
0e278a89f0
Don't let the mapping be nil when reading an empty file
...
e.g. when we first create it
because it throws this error:
```
panic: assignment to entry in nil map
goroutine 1 [running]:
github.com/kairos-io/kcrypt/pkg/partition_info.PartitionInfo.UpdateMapping({{0xa60325?, 0x18?}, 0x0?}, {0xc000302000?, 0x1?})
/go/pkg/mod/github.com/kairos-io/kcrypt@v0.4.2/pkg/partition_info/partition_info.go:69 +0x99
```
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-15 19:45:44 +02:00
Dimitris Karakasilis
7310c313ee
Merge pull request #5 from kairos-io/fix-version-bug-and-typpos
...
Fix typo in name, bad function call and version of the binary
2022-11-15 15:13:05 +02:00
Dimitris Karakasilis
b9572125e1
Fix typo in name, bad function call and version of the binary
...
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-15 15:09:56 +02:00
Dimitris Karakasilis
44ccb84dfb
Merge pull request #4 from kairos-io/create-info-file-if-not-exists
...
Create the partition file if it doesn't exist
2022-11-15 12:39:00 +02:00
Dimitris Karakasilis
a0a7c1269f
Create the partition file if id doesn't exist
...
so that the caller doesn't have to care if it's the first time the
partition is encrypted or not.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-15 12:17:32 +02:00
Dimitris Karakasilis
14664b6644
Merge pull request #3 from kairos-io/380-return-partition-mapping-data
...
Make `kcrypt encrypt` return useful lable/uuid mapping data
2022-11-11 15:13:16 +02:00
Dimitris Karakasilis
29f22e7f92
Update partition label with the store one before asking for a passphrase
...
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-11 13:14:31 +02:00
Dimitris Karakasilis
4a6c79f6a6
Change to a more object-oriented approach
...
Now the code can simply initialize a PartitionInfo from a file and then
call LookupUUIDForLabel on it.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-11 13:06:00 +02:00
Dimitris Karakasilis
8ca95e953b
Add functions to produce a string representation of a partition
...
so that we encapsulate all the logic in the same package
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-11 12:11:43 +02:00
Dimitris Karakasilis
c0d6b81b5d
Add github action pipeline to run unit tests
...
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-11 11:47:18 +02:00
Dimitris Karakasilis
82c6e8fcd0
Create parition info parsing library
...
to be used both here (when trying to find the partition UUID using a
label) and on the kairos side when updating the file after calling
kcrypt to encrypt a partition (which causes the UUID to change).
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-11 10:55:46 +02:00
Dimitris Karakasilis
d84b1ea2c2
Make kcrypt encrypt
return useful lable/uuid mapping data
...
part of: https://github.com/kairos-io/kairos/issues/380
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
2022-11-10 16:21:48 +02:00
Ettore Di Giacinto
aa620714a5
Add /oem/system/discovery
2022-10-17 19:15:40 +00:00
Ettore Di Giacinto
c9680590bf
Conditionals bring still deps in systemd
...
Generate instead of enabling both services
2022-10-15 21:14:06 +00:00
Ettore Di Giacinto
d496900927
Add online service
2022-10-15 17:17:10 +00:00
Ettore Di Giacinto
4c073ca50c
Make mkfs call more compatible
2022-10-15 16:34:18 +00:00
Ettore Di Giacinto
ce6ef0573b
Wait mapper to be ready before formatting
2022-10-15 16:19:36 +00:00
Ettore Di Giacinto
cabc24dc37
Add LICENSE file
2022-10-06 14:53:51 +00:00
mudler
5dd71fbf19
Use luks1 by default
2022-10-06 00:24:06 +02:00
mudler
410f8b2ed7
Close device after luksify
2022-10-06 00:16:03 +02:00
mudler
5fbdc4d614
Minor fixups to the encryption process
2022-10-06 00:03:43 +02:00
mudler
d977bdf888
go fmt
2022-10-05 23:09:04 +02:00
mudler
dc90d59ad2
Add /dev/ prefix to partition found
2022-10-05 23:08:50 +02:00
Ettore Di Giacinto
06a8eff25f
Minor fixups
2022-10-04 17:08:20 +00:00
mudler
b05d3c1e54
Initial import
2022-10-03 11:03:48 +02:00