LIBDIR detection without /proc
PATCH 1/1 LIBDIR detection without /proc
bash-4.0# ./dracut -l -f /boot/initrd-2.6.29.3-140.fc11.i586.img 2.6.29.3-140.fc11.i586
ldd: /proc/8072/exe: No such file or directory
modules.d/50plymouth/plymouth-populate-initrd
Could we please not rely on /proc to detect anything? Something like the following would work fine. It also has the benefit of being able to run without /proc mounted, which is great for building initrd's within a chroot.
modules.d/50plymouth/plymouth-populate-initrd +1 -1
@@ -1,5 +1,5 @@ #!/bin/bash -if ldd /proc/$$/exe |grep -q lib64; then +if [ -f /usr/lib64/plymouth/text.so ]; then LIBDIR="/usr/lib64" else LIBDIR="/usr/lib"
Another issue, it appears this plymouth module is uncondtional? Shouldn't it skip plymouth install if it plymouth does not exist for the sake of other distributions?
Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Warren Togami
Could we please not rely on /proc to detect anything? Something like the following would work fine. It also has the benefit of being able to run without /proc mounted, which is great for building initrd's within a chroot.
I'm not sure if checking for an installed file is going to work flawless. *shrug*
Quoted 3 lines
Another issue, it appears this plymouth module is uncondtional? Shouldn't it skip plymouth install if it plymouth does not exist for the sake of other distributions?
[root@bofh dracut]# cat modules.d/50plymouth/check
#!/bin/bash
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]] [root@bofh dracut]#
Does look rather conditional to me.
regards,
andreas
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.58.0905202249560.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org
Quoted 9 lines · Andreas Thienemann
Quoted 4 lines · Warren Togami
Could we please not rely on /proc to detect anything? Something like the following would work fine. It also has the benefit of being able to run without /proc mounted, which is great for building initrd's within a chroot.
I'm not sure if checking for an installed file is going to work flawless. *shrug*
If you have 64bit plymouth it will be at that location. If it isn't at that location, then the previous lib vs lib64 check and subsequent copying would have failed to do its job anyway. So what is the possible harm?
Warren Togami
[email protected]
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Warren Togami
If you have 64bit plymouth it will be at that location. If it isn't at that location, then the previous lib vs lib64 check and subsequent copying would have failed to do its job anyway. So what is the possible harm?
For this specific case, it would work in hopefully all cases. I have no idea how common ia32 systems with amd64 binaries in addition to the used ia32 binaries are. This is something which would throw off the check.
I've seen such things on development systems, which is why I'm personally tending to favor uname output... In any case, it's Harald's call. :)
regards,
andreas
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): Pine.LNX.4.58.0905202309060.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org
Quoted 11 lines · Andreas Thienemann
Quoted 4 lines · Warren Togami
If you have 64bit plymouth it will be at that location. If it isn't at that location, then the previous lib vs lib64 check and subsequent copying would have failed to do its job anyway. So what is the possible harm?
For this specific case, it would work in hopefully all cases. I have no idea how common ia32 systems with amd64 binaries in addition to the used ia32 binaries are. This is something which would throw off the check.
If a 32bit system has 64bit binaries installed it is an error.
Quoted 3 lines
I've seen such things on development systems, which is why I'm personally tending to favor uname output... In any case, it's Harald's call. :)
You cannot rely on detection of any aspect of the running system to decide what gets included in the initrd. Isn't a big point of dracut to exist to have a generated initrd that can boot any system of the same arch?
The other case where it reads /proc/mounts to decide which filesystems to include in the initrd is another example of where we shouldn't be relying on the running system for detection.
Warren
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Check /sbin/plymouthd for arch instead of /proc/$$/exe.
Here is an improved version of this patch. /sbin/plymouthd is guaranteed to exist if it passed the check, and it would be of the correct architecture.
From 6d1b465555ac4511b9bda90b7d72c29060c66955 Mon Sep 17 00:00:00 2001
From: Warren Togami <[email protected]>
Date: Wed, 20 May 2009 20:35:08 -0400
Subject: [PATCH] Check /sbin/plymouthd for arch instead of /proc/$$/exe.
/sbin/plymouthd is guaranteed to be there and be the correct arch.
--- .../50plymouth-pre0.7/plymouth-populate-initrd | 2 +- modules.d/50plymouth/plymouth-populate-initrd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
modules.d/50plymouth-pre0.7/plymouth-populate-initrd +1 -1
@@ -1,5 +1,5 @@ #!/bin/bash -if ldd /proc/$$/exe |grep -q lib64; then +if ldd /sbin/plymouthd |grep -q lib64; then LIBDIR="/usr/lib64" else LIBDIR="/usr/lib"
modules.d/50plymouth/plymouth-populate-initrd +1 -1
@@ -1,5 +1,5 @@ #!/bin/bash -if ldd /proc/$$/exe |grep -q lib64; then +if ldd /sbin/plymouthd |grep -q lib64; then LIBDIR="/usr/lib64" else LIBDIR="/usr/lib"
Signature · 7 lines
1.6.2.2 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html