-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fixed hardcoded root partition device name sda2 #830
Conversation
Same comment as on lxc/lxc-ci#822, I'd prefer that some race-free method be used as otherwise multiple image builds on the same system may make this logic racy. |
I changed my mind, do as you prefered. |
0518c5b
to
8613f0e
Compare
The root partition may not be /dev/sda2, for example if set the boot disk as the second disk, the root partition device name will be /dev/sdb2. It may be /dev/vda2 if not using san disk. The fix figured out the root partition device UUID and set the UUID as the root, the root partition device UUID keeps no change. Depends on lxc/distrobuilder#830 Signed-off-by: JUN JIE NAN <[email protected]>
Great to see! Could you split your PR into two commits? One adding the new env variables to distrobuilder and then the second updating the example .yaml to use it? |
Depends on PR lxc#830
Depends on PR lxc#830 Signed-off-by: JUN JIE NAN <[email protected]>
distrobuilder/main_incus.go
Outdated
} | ||
|
||
c.global.ctx = context.WithValue(c.global.ctx, shared.ContextKeyEnviron, | ||
[]string{fmt.Sprintf("ROOTFS_DEVICE_UUID=%s", rootfsDevUUID)}) |
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'd probably go for DISTROBUILDR_ROOTFS_UUID
instead so that it's clear that this is a distrobuilder thing and we avoid potential conflicts with other env variables (as unlikely as that may be).
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.
done
The root partition may not be /dev/sda2, for example if set the boot disk as the second disk, the root partition device name will be /dev/sdb2. It may be /dev/vda2 if not using san disk. The fix figured out the root partition device UUID and set the UUID as the root, the root partition device UUID keeps no change. Signed-off-by: JUN JIE NAN <[email protected]>
Depends on PR lxc#830 Signed-off-by: JUN JIE NAN <[email protected]>
The root partition may not be /dev/sda2, for example if set the boot disk as the second disk, the root partition device name will be /dev/sdb2. It may be /dev/vda2 if not using san disk. The fix figured out the root partition device UUID and set the UUID as the root, the root partition device UUID keeps no change. Depends on lxc/distrobuilder#830 Signed-off-by: JUN JIE NAN <[email protected]>
… Incus) (#83) Cherry-picked from lxc/distrobuilder#830 and lxc/distrobuilder#831
The root partition may not be /dev/sda2, for example if set the boot disk as the second disk, the root partition device name will be /dev/sdb2. It may be /dev/vda2 if not using san disk. The fix figured out the root partition device UUID and set the UUID as the root, the root partition device UUID keeps no change.