Skip to content

Preserve directory structure during packaging - #127

Draft
mschwan-phytec wants to merge 3 commits into
mainfrom
wip-keep-dir-structure
Draft

mschwan-phytec wants to merge 3 commits into
mainfrom
wip-keep-dir-structure

Conversation

@mschwan-phytec

Copy link
Copy Markdown
Collaborator

mksquashfs strips the leading directories of its sources by default, so
partup package out.partup layout.yaml foo/bar.txt stored bar.txt at
the package root instead of foo/bar.txt. Passing a directory kept its
name, which made the behavior inconsistent.

Pass -no-strip to mksquashfs, so the relative paths are kept and the
input files are used directly without copying them. As the paths now end
up in the package, validate them first: they must be located below the
current directory, which can be changed with the -C option, and the
layout configuration must be placed at the package root. Add the error
code PU_PACKAGE_ERROR_INVALID_PATH for violations.

Also shell-quote the input and output paths, so that names containing
spaces no longer break the mksquashfs command line, and pass -noappend.

Check that foo/bar.txt is stored with its directory and that its
siblings are not packaged. Also check that a layout configuration in a
subdirectory, paths above the current directory and absolute paths are
rejected.

Document that relative paths of input files are preserved and which
restrictions apply to them. Add the corresponding changelog entry.

mksquashfs strips the leading directories of its sources by default, so
`partup package out.partup layout.yaml foo/bar.txt` stored bar.txt at
the package root instead of foo/bar.txt. Passing a directory kept its
name, which made the behavior inconsistent.

Pass -no-strip to mksquashfs, so the relative paths are kept and the
input files are used directly without copying them. As the paths now end
up in the package, validate them first: they must be located below the
current directory, which can be changed with the -C option, and the
layout configuration must be placed at the package root. Add the error
code PU_PACKAGE_ERROR_INVALID_PATH for violations.

Also shell-quote the input and output paths, so that names containing
spaces no longer break the mksquashfs command line, and pass -noappend.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Check that foo/bar.txt is stored with its directory and that its
siblings are not packaged. Also check that a layout configuration in a
subdirectory, paths above the current directory and absolute paths are
rejected.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Document that relative paths of input files are preserved and which
restrictions apply to them. Add the corresponding changelog entry.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant