Organize fails with character devices
Metadata
Current evaluation
Organize treated character/block device nodes as regular files. Fixed by PR #1260, merged as commit 9f185208, which adds a device-aware move/copy helper using os.mknod for character and block special files.
Resolution: closed resolved
Reason: Maintainer comment pointed to PR canonical/craft-parts#1260 ("fix: allow organize to move special files"), which was merged as commit 9f185208. The resulting craft_parts/utils/file_utils.py uses stat.S_ISCHR/S_ISBLK with os.mknod, with unit and integration tests asserting device nodes survive organize.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
Organize in craft-parts is not handling character (and presumably) block device nodes, and will consider them regular files instead.
### To Reproduce
Create a character device with major 1, minor 5 (/dev/zero). Upon organizing, craft-parts will create a regular file using all the available space in the filesystem.
### part yaml
```shell
N/A
```
### Relevant log output
```shell
N/A
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Organize treated character/block device nodes as regular files. Fixed by PR #1260, merged as commit 9f185208, which adds a device-aware move/copy helper using os.mknod for character and block special files. | |
| stealth/space-bunny-alpha | — | closed resolved | Organize now moves character and block device nodes correctly, preventing /dev/zero from becoming a space-filling regular file. Fixed by merged PR #1260 (commit 9f185208). | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in merged PR #1260 (9f185208): organize now uses device-node-aware moving, correctly handling character and block special files. | |
| qwen/qwen3.6-35b-a3b | — | — | craft-parts Organize incorrectly handled character and block devices as regular files, risking disk space exhaustion. The bug was fixed and merged in pull request #1260. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in PR #1260. The craft-parts Organize function now correctly handles character and block device nodes instead of treating them as regular files, preventing filesystem space exhaustion. | |
| qwen/qwen3.6-35b-a3b | — | — | Fixed in PR #1260. The craft-parts Organize step now correctly preserves character and block device nodes instead of copying them as regular files, preventing unintended disk space consumption. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed in craft-parts PR #1260. The Organize step previously mishandled character and block device nodes, treating them as regular files and risking filesystem exhaustion. The update correctly preserves device nodes during organization. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#1260
(confidence 97%)
Merged PR cited in the closing maintainer comment; commit 9f185208 adds device-aware special-file handling.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1260 fix: allow organize to move special files | craft-parts | merged | Merged in canonical/craft-parts#1260 via commit 9f185208, adding a device-aware move helper so organize can move character and block special files. |