dracut-026: lsinitrd doesn't work with provided image
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
A message that is not in the archive (sent off-list or not yet received): CAKzfqkfwg_tW70VJbmgKg-Vs3O2DWLX36o0bMZhYvTL9U9QCRQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 6 lines · Wim Muskee
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
Quoted 8 lines
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?
lsinitrd.sh +13 -13
@@ -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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 50 lines · Dave Young
Quoted 6 lines · Wim Muskee
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-gentooQuoted 8 lines
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?
lsinitrd.sh +9
-10@@ -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
lsinitrd.sh if [[ "$1" ]]; then · line 76
Quoted 10 lines
lsinitrd.sh +4
-3- } >&2 - usage - exit 1 + } >&2 + usage + exit 1 + fi fi CAT=zcat
Yes, the patch works for me, thx.
A message that is not in the archive (sent off-list or not yet received): CAKzfqkeUkknOwONqZkuZ8c56+5iNLxigLv+K70sSDXuvPaabZg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Am 12.03.2013 15:35, schrieb Wim Muskee:
Quoted 39 lines · Dave Young
Quoted 38 lines · Wim Muskee
Quoted 6 lines
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-gentooQuoted 8 lines
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?
lsinitrd.sh +1
-8@@ -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
Quoted 6 lines
lsinitrd.sh if [[ "$1" ]]; then · line 63
Quoted 6 lines
lsinitrd.sh +4
-2-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 "}"
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 Do not override user specified initramfs image name
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 '}'
---
lsinitrd.sh +13 -13
@@ -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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Do not override user specified initramfs image name
Am 13.03.2013 02:48, schrieb Dave Young:
Quoted 50 lines
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
...
fiAlso remove the typo of trailing '}'
Reported-by Wim Muskee <[email protected]>Signed-off-by Dave Young <[email protected]>---
lsinitrd.sh +9
-10@@ -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
lsinitrd.sh if [[ "$1" ]]; then · line 76
Quoted 10 lines
lsinitrd.sh +4
-3- } >&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
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Do not override user specified initramfs image name
Quoted 67 lines · Harald Hoyer
Am 13.03.2013 02:48, schrieb Dave Young:
Quoted 50 lines
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
...
fiAlso remove the typo of trailing '}'
Reported-by Wim Muskee <[email protected]>Signed-off-by Dave Young <[email protected]>---
lsinitrd.sh +9
-10@@ -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!" echolsinitrd.sh if [[ "$1" ]]; then · line 76
Quoted 10 lines
lsinitrd.sh +4
-3- } >&2 - usage - exit 1 + } >&2 + usage + exit 1 + fi fi CAT=zcatsee
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
Quoted 3 lines
already committed on 2013-03-11
Good to know, thanks for tell.
Signature · 2 lines
Thanks Dave