* dracut-026: lsinitrd doesn't work with provided image
@ 2013-03-11 18:53 Wim Muskee
[not found] ` <CAKzfqkfwg_tW70VJbmgKg-Vs3O2DWLX36o0bMZhYvTL9U9QCRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Wim Muskee @ 2013-03-11 18:53 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
hi,
In dracut-026:
# dracut /boot/initramfs-dracut-x86_64-3.3.8-gentoo 3.3.8-gentoo
# lsinitrd /boot/initramfs-dracut-x86_64-3.3.8-gentoo
No <initramfs file> specified and the default image
'/boot/initramfs-3.2.1-gentoo-r2.img}' cannot be accessed!
Usage: lsinitrd [-s] [<initramfs file> [<filename>]]
Looking at the lsinitrd, the provided image seems to be always
overwritten after it has been set from $1.
regards, Wim
^ permalink raw reply [flat|nested] 7+ messages in thread[parent not found: <CAKzfqkfwg_tW70VJbmgKg-Vs3O2DWLX36o0bMZhYvTL9U9QCRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: dracut-026: lsinitrd doesn't work with provided image [not found] ` <CAKzfqkfwg_tW70VJbmgKg-Vs3O2DWLX36o0bMZhYvTL9U9QCRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2013-03-12 7:54 ` Dave Young [not found] ` <513EDF30.7090408-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Dave Young @ 2013-03-12 7:54 UTC (permalink / raw) To: Wim Muskee; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA On 03/12/2013 02:53 AM, Wim Muskee wrote: > hi, > > In dracut-026: > # dracut /boot/initramfs-dracut-x86_64-3.3.8-gentoo 3.3.8-gentoo > # lsinitrd /boot/initramfs-dracut-x86_64-3.3.8-gentoo > > No <initramfs file> specified and the default image > '/boot/initramfs-3.2.1-gentoo-r2.img}' cannot be accessed! > > Usage: lsinitrd [-s] [<initramfs file> [<filename>]] > > Looking at the lsinitrd, the provided image seems to be always > overwritten after it has been set from $1. > The machine-id section should only be run in case without $1 as image name. Is below fix works for you? diff --git a/lsinitrd.sh b/lsinitrd.sh index 7a09423..fe723f7 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -54,23 +54,23 @@ if [[ "$1" ]]; then usage exit 1 fi -fi - -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id - -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" else - image="/boot/initramfs-${KERNEL_VERSION}.img}" -fi + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id -if ! [[ -f "$image" ]]; then - { + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + else + image="/boot/initramfs-${KERNEL_VERSION}.img}" + fi + + if ! [[ -f "$image" ]]; then + { echo "No <initramfs file> specified and the default image '$image' cannot be accessed!" echo - } >&2 - usage - exit 1 + } >&2 + usage + exit 1 + fi fi CAT=zcat ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <513EDF30.7090408-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: dracut-026: lsinitrd doesn't work with provided image [not found] ` <513EDF30.7090408-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2013-03-12 14:35 ` Wim Muskee [not found] ` <CAKzfqkeUkknOwONqZkuZ8c56+5iNLxigLv+K70sSDXuvPaabZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Wim Muskee @ 2013-03-12 14:35 UTC (permalink / raw) To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Dave Young On Tue, Mar 12, 2013 at 8:54 AM, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > On 03/12/2013 02:53 AM, Wim Muskee wrote: >> hi, >> >> In dracut-026: >> # dracut /boot/initramfs-dracut-x86_64-3.3.8-gentoo 3.3.8-gentoo >> # lsinitrd /boot/initramfs-dracut-x86_64-3.3.8-gentoo >> >> No <initramfs file> specified and the default image >> '/boot/initramfs-3.2.1-gentoo-r2.img}' cannot be accessed! >> >> Usage: lsinitrd [-s] [<initramfs file> [<filename>]] >> >> Looking at the lsinitrd, the provided image seems to be always >> overwritten after it has been set from $1. >> > > The machine-id section should only be run in case without $1 as image name. > Is below fix works for you? > > diff --git a/lsinitrd.sh b/lsinitrd.sh > index 7a09423..fe723f7 100755 > --- a/lsinitrd.sh > +++ b/lsinitrd.sh > @@ -54,23 +54,23 @@ if [[ "$1" ]]; then > usage > exit 1 > fi > -fi > - > -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id > - > -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then > - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" > else > - image="/boot/initramfs-${KERNEL_VERSION}.img}" > -fi > + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id > > -if ! [[ -f "$image" ]]; then > - { > + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then > + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" > + else > + image="/boot/initramfs-${KERNEL_VERSION}.img}" > + fi > + > + if ! [[ -f "$image" ]]; then > + { > echo "No <initramfs file> specified and the default image '$image' cannot be accessed!" > echo > - } >&2 > - usage > - exit 1 > + } >&2 > + usage > + exit 1 > + fi > fi > > CAT=zcat Yes, the patch works for me, thx. ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <CAKzfqkeUkknOwONqZkuZ8c56+5iNLxigLv+K70sSDXuvPaabZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: dracut-026: lsinitrd doesn't work with provided image [not found] ` <CAKzfqkeUkknOwONqZkuZ8c56+5iNLxigLv+K70sSDXuvPaabZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2013-03-12 14:59 ` Harald Hoyer [not found] ` <513F42EC.5030800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Harald Hoyer @ 2013-03-12 14:59 UTC (permalink / raw) To: Wim Muskee; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA, Dave Young Am 12.03.2013 15:35, schrieb Wim Muskee: > On Tue, Mar 12, 2013 at 8:54 AM, Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: >> On 03/12/2013 02:53 AM, Wim Muskee wrote: >>> hi, >>> >>> In dracut-026: >>> # dracut /boot/initramfs-dracut-x86_64-3.3.8-gentoo 3.3.8-gentoo >>> # lsinitrd /boot/initramfs-dracut-x86_64-3.3.8-gentoo >>> >>> No <initramfs file> specified and the default image >>> '/boot/initramfs-3.2.1-gentoo-r2.img}' cannot be accessed! >>> >>> Usage: lsinitrd [-s] [<initramfs file> [<filename>]] >>> >>> Looking at the lsinitrd, the provided image seems to be always >>> overwritten after it has been set from $1. >>> >> >> The machine-id section should only be run in case without $1 as image name. >> Is below fix works for you? >> >> diff --git a/lsinitrd.sh b/lsinitrd.sh >> index 7a09423..fe723f7 100755 >> --- a/lsinitrd.sh >> +++ b/lsinitrd.sh >> @@ -54,23 +54,23 @@ if [[ "$1" ]]; then >> usage >> exit 1 >> fi >> -fi >> - >> -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id >> - >> -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then >> - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" >> else >> - image="/boot/initramfs-${KERNEL_VERSION}.img}" >> -fi >> + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id >> >> -if ! [[ -f "$image" ]]; then >> - { >> + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then >> + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" >> + else >> + image="/boot/initramfs-${KERNEL_VERSION}.img}" typo.. trailing "}" ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <513F42EC.5030800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* [PATCH] Do not override user specified initramfs image name [not found] ` <513F42EC.5030800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2013-03-13 1:48 ` Dave Young [not found] ` <513FDAF4.9030908-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Dave Young @ 2013-03-13 1:48 UTC (permalink / raw) To: Harald Hoyer; +Cc: Wim Muskee, initramfs-u79uwXL29TY76Z2rM5mHXA The code section for setting default initramfs image name is only for the case that user has not specified image name argument. Moving the code to else section of below: if [[ "$1" ]]; then ... else ... fi Also remove the typo of trailing '}' Reported-by: Wim Muskee <wimmuskee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- diff --git a/lsinitrd.sh b/lsinitrd.sh index 7a09423..fe723f7 100755 --- a/lsinitrd.sh +++ b/lsinitrd.sh @@ -54,23 +54,23 @@ if [[ "$1" ]]; then usage exit 1 fi -fi - -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id - -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" else - image="/boot/initramfs-${KERNEL_VERSION}.img}" -fi + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id -if ! [[ -f "$image" ]]; then - { + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" + else + image="/boot/initramfs-${KERNEL_VERSION}.img" + fi + + if ! [[ -f "$image" ]]; then + { echo "No <initramfs file> specified and the default image '$image' cannot be accessed!" echo - } >&2 - usage - exit 1 + } >&2 + usage + exit 1 + fi fi CAT=zcat ^ permalink raw reply related [flat|nested] 7+ messages in thread
[parent not found: <513FDAF4.9030908-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] Do not override user specified initramfs image name [not found] ` <513FDAF4.9030908-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2013-03-13 7:17 ` Harald Hoyer [not found] ` <514027FE.9090600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 0 siblings, 1 reply; 7+ messages in thread From: Harald Hoyer @ 2013-03-13 7:17 UTC (permalink / raw) To: Dave Young; +Cc: Wim Muskee, initramfs-u79uwXL29TY76Z2rM5mHXA Am 13.03.2013 02:48, schrieb Dave Young: > > > The code section for setting default initramfs image name is only for > the case that user has not specified image name argument. > > Moving the code to else section of below: > > if [[ "$1" ]]; then > ... > else > ... > fi > > Also remove the typo of trailing '}' > > Reported-by: Wim Muskee <wimmuskee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> > --- > diff --git a/lsinitrd.sh b/lsinitrd.sh > index 7a09423..fe723f7 100755 > --- a/lsinitrd.sh > +++ b/lsinitrd.sh > @@ -54,23 +54,23 @@ if [[ "$1" ]]; then > usage > exit 1 > fi > -fi > - > -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id > - > -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then > - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" > else > - image="/boot/initramfs-${KERNEL_VERSION}.img}" > -fi > + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id > > -if ! [[ -f "$image" ]]; then > - { > + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then > + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" > + else > + image="/boot/initramfs-${KERNEL_VERSION}.img" > + fi > + > + if ! [[ -f "$image" ]]; then > + { > echo "No <initramfs file> specified and the default image '$image' cannot be accessed!" > echo > - } >&2 > - usage > - exit 1 > + } >&2 > + usage > + exit 1 > + fi > fi > > CAT=zcat > see http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=727e68d0b5cb93eb6c6e00f0541b8519657a2597 and http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=d928724c3cf464a495c11162042951887b80f5e6 already committed on 2013-03-11 ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <514027FE.9090600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] Do not override user specified initramfs image name [not found] ` <514027FE.9090600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> @ 2013-03-13 7:26 ` Dave Young 0 siblings, 0 replies; 7+ messages in thread From: Dave Young @ 2013-03-13 7:26 UTC (permalink / raw) To: Harald Hoyer; +Cc: Wim Muskee, initramfs-u79uwXL29TY76Z2rM5mHXA On 03/13/2013 03:17 PM, Harald Hoyer wrote: > Am 13.03.2013 02:48, schrieb Dave Young: >> >> >> The code section for setting default initramfs image name is only for >> the case that user has not specified image name argument. >> >> Moving the code to else section of below: >> >> if [[ "$1" ]]; then >> ... >> else >> ... >> fi >> >> Also remove the typo of trailing '}' >> >> Reported-by: Wim Muskee <wimmuskee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> >> --- >> diff --git a/lsinitrd.sh b/lsinitrd.sh >> index 7a09423..fe723f7 100755 >> --- a/lsinitrd.sh >> +++ b/lsinitrd.sh >> @@ -54,23 +54,23 @@ if [[ "$1" ]]; then >> usage >> exit 1 >> fi >> -fi >> - >> -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id >> - >> -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then >> - image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" >> else >> - image="/boot/initramfs-${KERNEL_VERSION}.img}" >> -fi >> + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id >> >> -if ! [[ -f "$image" ]]; then >> - { >> + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then >> + image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" >> + else >> + image="/boot/initramfs-${KERNEL_VERSION}.img" >> + fi >> + >> + if ! [[ -f "$image" ]]; then >> + { >> echo "No <initramfs file> specified and the default image '$image' cannot be accessed!" >> echo >> - } >&2 >> - usage >> - exit 1 >> + } >&2 >> + usage >> + exit 1 >> + fi >> fi >> >> CAT=zcat >> > > see > http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=727e68d0b5cb93eb6c6e00f0541b8519657a2597 > and > http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=d928724c3cf464a495c11162042951887b80f5e6 > > already committed on 2013-03-11 > > Good to know, thanks for tell. -- Thanks Dave ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-03-13 7:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 18:53 dracut-026: lsinitrd doesn't work with provided image Wim Muskee
[not found] ` <CAKzfqkfwg_tW70VJbmgKg-Vs3O2DWLX36o0bMZhYvTL9U9QCRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-12 7:54 ` Dave Young
[not found] ` <513EDF30.7090408-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-12 14:35 ` Wim Muskee
[not found] ` <CAKzfqkeUkknOwONqZkuZ8c56+5iNLxigLv+K70sSDXuvPaabZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-12 14:59 ` Harald Hoyer
[not found] ` <513F42EC.5030800-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-13 1:48 ` [PATCH] Do not override user specified initramfs image name Dave Young
[not found] ` <513FDAF4.9030908-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-13 7:17 ` Harald Hoyer
[not found] ` <514027FE.9090600-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-03-13 7:26 ` Dave Young
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox