-
Notifications
You must be signed in to change notification settings - Fork 158
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
overlay.d: add udev rule for creating stable symlink to boot disk #1308
Conversation
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.
In general, this looks great. Some questions about dependencies, and I'm not sure about the partx/trigger/settle part.
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-root-symlink.service
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-root-symlink.service
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/create-root-symlink.sh
Outdated
Show resolved
Hide resolved
for dev in $(lsblk -o NAME --noheadings --nodeps --list --paths); do | ||
partx -u ${dev} | ||
done | ||
|
||
udevadm trigger | ||
udevadm settle |
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.
What problem is this code solving? Is there a more targeted way of doing it than retriggering every device?
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.
for some reason on s390x
WWN
is not always present in lsblk
output, so this udev/partx
code is used to mitigate that problem
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/module-setup.sh
Outdated
Show resolved
Hide resolved
Also, I agree with coreos/coreos-assembler#2517 (comment) that the kola test should move into this repo. |
fdc07d4
to
88a8f7f
Compare
done. |
6c4962b
to
25ee1c9
Compare
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/create-root-symlink.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/create-root-symlink.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/create-root-symlink.sh
Outdated
Show resolved
Hide resolved
25ee1c9
to
68f6439
Compare
1ae196e
to
245b767
Compare
overlay.d/05core/usr/lib/udev/rules.d/99-zz-coreos-stable-root.rules
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/module-setup.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/count-fs.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/udev/rules.d/99-zz-coreos-stable-root.rules
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/count-fs.sh
Outdated
Show resolved
Hide resolved
f9e73c5
to
680951b
Compare
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.
Can we use boot
instead of root
? It's mostly equivalent because all we care about for this is pre-ignition-disks
in which case boot and root are on the same disk. But I like boot
because that's what #1269 targets, so we know we'll only have a single boot filesystem.
overlay.d/05core/usr/lib/udev/rules.d/99-zz-coreos-stable-root.rules
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/udev/rules.d/99-zz-coreos-stable-root.rules
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-disk-contains-fs.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-disk-contains-fs.sh
Outdated
Show resolved
Hide resolved
ok() { | ||
echo "ok" "$@" | ||
} | ||
|
||
fatal() { | ||
echo "$@" >&2 | ||
exit 1 | ||
} |
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.
Check out the other tests which use commonlib.sh
to get these functions.
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 ignition
tests use copy-paste )
02c6aea
to
e2aba5d
Compare
root
partition
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/coreos-teardown-initramfs.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/module-setup.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/35coreos-ignition/module-setup.sh
Outdated
Show resolved
Hide resolved
if [[ "$name" =~ ${disk}p?[[:digit:]] ]] && [[ -e "/sys/block/$disk/$name/start" ]]; | ||
then | ||
eval $(udevadm info --query=property -n /dev/$name | grep -e ID_FS_LABEL -e PARTNAME) | ||
if [[ "${ID_FS_LABEL:-}" == "$label" ]] || [[ "${PARTNAME:-}" == "$label" ]]; then |
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.
ID_FS_LABEL
is not always available.
Ahh OK. Hmm, that's unfortunate. Using the partition name rather than the filesystem label is not as good because we have expectations around the latter but not necessarily the former (e.g. I don't think anything would actually break if we have multiple partitions labeled boot
). OTOH, it's not unreasonable to extend our requirement to partition names. So... let's roll with it!
Creates '/dev/disk/coreos-boot-disk' symlink to boot disk for use by Ignition config, therefore 'storage.disks' section could be defined without hardcoding /dev/sda, /dev/vda, etc. Issue: coreos/fedora-coreos-tracker#759 Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
e2aba5d
to
3cb083d
Compare
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.
🎉
Creates '/dev/disk/coreos-root-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.
Issue: coreos/fedora-coreos-tracker#759