* [PATCH] LIBDIR detection without /proc
@ 2009-05-20 20:22 Warren Togami
[not found] ` <4A146687.3020508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Warren Togami @ 2009-05-20 20:22 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
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.
diff --git a/modules.d/50plymouth/plymouth-populate-initrd
b/modules.d/50plymouth/plymouth-populate-initrd
index df6e7c5..58b5b5a 100755
--- a/modules.d/50plymouth/plymouth-populate-initrd
+++ b/modules.d/50plymouth/plymouth-populate-initrd
@@ -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
wtogami-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <4A146687.3020508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] LIBDIR detection without /proc [not found] ` <4A146687.3020508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2009-05-20 20:52 ` Andreas Thienemann [not found] ` <Pine.LNX.4.58.0905202249560.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Andreas Thienemann @ 2009-05-20 20:52 UTC (permalink / raw) To: Warren Togami; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On Wed, 20 May 2009, Warren Togami wrote: > 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* > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <Pine.LNX.4.58.0905202249560.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org>]
* Re: [PATCH] LIBDIR detection without /proc [not found] ` <Pine.LNX.4.58.0905202249560.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org> @ 2009-05-20 20:57 ` Warren Togami [not found] ` <4A146EBF.5060404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Warren Togami @ 2009-05-20 20:57 UTC (permalink / raw) To: initramfs On 05/20/2009 04:52 PM, Andreas Thienemann wrote: > On Wed, 20 May 2009, Warren Togami wrote: > >> 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 wtogami-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <4A146EBF.5060404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] LIBDIR detection without /proc [not found] ` <4A146EBF.5060404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2009-05-20 21:24 ` Andreas Thienemann [not found] ` <Pine.LNX.4.58.0905202309060.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Andreas Thienemann @ 2009-05-20 21:24 UTC (permalink / raw) To: Warren Togami; +Cc: initramfs On Wed, 20 May 2009, Warren Togami wrote: > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <Pine.LNX.4.58.0905202309060.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org>]
* Re: [PATCH] LIBDIR detection without /proc [not found] ` <Pine.LNX.4.58.0905202309060.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org> @ 2009-05-20 22:02 ` Warren Togami [not found] ` <4A147DF3.4070108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 6+ messages in thread From: Warren Togami @ 2009-05-20 22:02 UTC (permalink / raw) To: initramfs On 05/20/2009 05:24 PM, Andreas Thienemann wrote: > On Wed, 20 May 2009, Warren Togami wrote: > >> 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. > > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <4A147DF3.4070108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH] Check /sbin/plymouthd for arch instead of /proc/$$/exe. [not found] ` <4A147DF3.4070108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2009-05-21 0:37 ` Warren Togami 0 siblings, 0 replies; 6+ messages in thread From: Warren Togami @ 2009-05-21 0:37 UTC (permalink / raw) To: initramfs 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 <wtogami-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 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(-) diff --git a/modules.d/50plymouth-pre0.7/plymouth-populate-initrd b/modules.d/50plymouth-pre0.7/plymouth-populate-initrd index e195ddc..1802b25 100755 --- a/modules.d/50plymouth-pre0.7/plymouth-populate-initrd +++ b/modules.d/50plymouth-pre0.7/plymouth-populate-initrd @@ -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" diff --git a/modules.d/50plymouth/plymouth-populate-initrd b/modules.d/50plymouth/plymouth-populate-initrd index df6e7c5..f3c67f1 100755 --- a/modules.d/50plymouth/plymouth-populate-initrd +++ b/modules.d/50plymouth/plymouth-populate-initrd @@ -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" -- 1.6.2.2 -- To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-05-21 0:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 20:22 [PATCH] LIBDIR detection without /proc Warren Togami
[not found] ` <4A146687.3020508-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-05-20 20:52 ` Andreas Thienemann
[not found] ` <Pine.LNX.4.58.0905202249560.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org>
2009-05-20 20:57 ` Warren Togami
[not found] ` <4A146EBF.5060404-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-05-20 21:24 ` Andreas Thienemann
[not found] ` <Pine.LNX.4.58.0905202309060.7805-bvJ793YqIODNUDpmljszgg@public.gmane.org>
2009-05-20 22:02 ` Warren Togami
[not found] ` <4A147DF3.4070108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-05-21 0:37 ` [PATCH] Check /sbin/plymouthd for arch instead of /proc/$$/exe Warren Togami
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.