-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create disk images without root #381
Create disk images without root #381
Conversation
a53322a
to
8318e0e
Compare
A quick note: this should not affect probably the most common case of qemu or bare-metal with kernel bootstrap without --external-sources, which already proceeds without ever creating an FS image other than srcfs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than these, LGTM.
self.external_dir = os.path.join(self.target_dir, 'external') | ||
|
||
os.makedirs(self.external_dir, exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove exist_ok here? I'm pretty sure this will break CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any situation where that directory can exist at that point? Previously, it would exist when the "external" image was mounted, but it is not longer the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It exists at the beginning the latter phases of GitHub CI, which is split up into multiple phases to avoid hitting GitHub's time limits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the prepare
function (the one modified here) is only called for the first step, later steps use the reuse
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I was actually mistaken about the purpose of this.
But it is indeed necessary - when building with kernel-bootstrap and external sources, /external will already exist when we get here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see how can the directory exist.
But it is indeed necessary - when building with kernel-bootstrap and external sources, /external will already exist when we get here.
That was true when the external image was mounted, which already created the directory. But now only the init directory will exist at that point.
8318e0e
to
fa26b1f
Compare
`mke2fs` has a `-d` option that allows to populate the newly created filesystem without needing to temporarily mount it. That allows to use `parted` and `mkfs.ext3` on regular files without needing root access.
…passed (with kernel bootstrap) All distfiles are still copied to "external"
The version of stat available at that point does not support %Lr, so use instead its hexadecimal counterpar (%T)
fa26b1f
to
5243d3b
Compare
mke2fs
has a-d
option that allows to populate the newly created filesystem without needing to temporarily mount it. That allows to useparted
andmkfs.ext3
on regular files without needing root access.I also fixed some issues I bumped into while testing (see commits).