Comments (6)
Maybe all those commands should just use lib.toGNUCommandLineShell
for proper escaping.
from disko.
Oh man, how have I never come across toGNUCommandLineShell
before! Nice!
Maybe all those commands should just use
lib.toGNUCommandLineShell
for proper escaping.
Yeah, I think that's a good call, given the amount of script generation going on. Although I think it'd still need special handling for the case of parted
to ensure that quotes remain when parted parses the inner command (i.e. they're not all stripped by bash).
from disko.
I'm up for having a swing at this myself, but might be a while since not much free time to code at the moment.
from disko.
not sure if thats still a problem? maybe PRing an example which causes the break is enough so I can fix it
from disko.
Sorry, have been more busy than I expected this year!
As far as I can tell, it's still an issue as of 4eed245 . So generating diskoScript
will result with something like;
parted -s /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_SXXXXXXXXXXXXX -- mkpart Basic Data Partition ntfs 1049kB 473MB
when I believe the correct escaping (which I achieve with the escape_parted_name
above) should be;
parted -s /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_SXXXXXXXXXXXXX -- mkpart '"Basic Data Partition"' ntfs 1049kB 473MB
(slightly modified output to vaguely anonymise drive info)
Extracting from my config I think this should be enough to reproduce;
disko.devices = {
disk.root = {
type = "disk";
device = "/dev/sda1";
content = {
type = "table";
format = "gpt";
partitions = [
{
start = "1049kB";
end = "473MB";
name = "Basic Data Partition";
fs-type = "ntfs";
flags = [
"hidden"
"diag"
];
content = {
type = "filesystem";
format = "ntfs";
mountpoint = "/mnt/ignore/windows_recovery";
};
}
];
};
};
};
will look at making an example PR when I can.
from disko.
Had a quick bash at reproducing with examples/test. I hadn't realised there was a new syntax for partition tables, but it seems to fail just the same (see PR).
Something that occurred to me while testing is that escaping the /dev/disk/by-partlabel
isn't as simple as quoting, since it does the \x20
escaping thing (not sure how best to refer to it!);
$ ls /dev/disk/by-partlabel/Basic*
'/dev/disk/by-partlabel/Basic\x20data\x20partition'
You might already have solved this problem elsewhere, but just in case it's helpful, I note that the systemd-escape
command will escape spaces in the same way;
$ systemd-escape "Basic Data Partition"
Basic\x20Data\x20Partition
from disko.
Related Issues (20)
- Using disko to generate raspberry pi sd card images
- Random boot failues due to partition confusion because disko now relies on `by-partlabel` HOT 8
- ZFS Features Support: Dataset property inheritance HOT 2
- Converting an existing system to use disko? HOT 5
- GRUB Mirrored boot entries with disko HOT 2
- zpool create error: one or more vdevs refer to the same device HOT 1
- How to test luks setup with `--vm-test` HOT 5
- device already has a partition, skipping creating zpool zroot HOT 1
- Can't automount ZFS dataset without using mountpoint="legacy" HOT 1
- `disko-install` should error out immediately if it was invoked without `sudo` HOT 1
- [DOC] add demo/example config for subvolumes on btrfs on lvm on luks
- Add docs for upgrade from legacy table to gpt HOT 3
- QUESTION: neededForBoot option HOT 1
- Random Boot failures due to failing to mount /usr/bin HOT 4
- Size range HOT 1
- encrypted swap and hibernation HOT 2
- Generate an .iso unattended install image HOT 17
- typo in the docs?
- how to to pass flake `self` using `specialArgs`? HOT 2
- disko-install: error: infinite recursion encountered HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from disko.