[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594118: initramfs-tools: Generating image error. Unexpected operator



On 24/08/10 10:34, maximilian attems wrote:
On Mon, Aug 23, 2010 at 09:50:34PM +0200, Rodolfo Garcia wrote:
Package: initramfs-tools
Version: 0.98
Severity: important

Hi!

I have a problem trying to generate a new initram:

debian:~# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-2.6.32-5-686
[: 33: #: unexpected operator
/boot/initrd.img-2.6.18-6-686 does not exist. Cannot update.
debian:~#
please post the output of:

ls -l /var/lib/initramfs-tools/

and of

sh -x /usr/sbin/update-initramfs -u


thanks.

Hi,

debian:~# ls -l /var/lib/initramfs-tools/
total 8
-rw-r--r-- 1 root root 72 sep 17  2008 2.6.18-6-686
-rw-r--r-- 1 root root 72 ago 23 21:45 2.6.32-5-686
debian:~#
debian:~# sh -x /usr/sbin/update-initramfs -u
+ STATEDIR=/var/lib/initramfs-tools
+ BOOTDIR=/boot
+ CONF=/etc/initramfs-tools/update-initramfs.conf
+ KPKGCONF=/etc/kernel-img.conf
+ USETRIGGERS=true
+ mode=
+ version=
+ update_initramfs=yes
+ backup_initramfs=no
+ set -e
+ [ -r /etc/initramfs-tools/update-initramfs.conf ]
+ . /etc/initramfs-tools/update-initramfs.conf
+ update_initramfs=yes
+ backup_initramfs=no
+ true
+ [ x != x ]
+ verbose=0
+ yes=0
+ takeover=0
+ getopts k:cudyvtb:h? flag
+ mode=u
+ getopts k:cudyvtb:h? flag
+ shift 1
+ [ 0 -ne 0 ]
+ [ -z u ]
+ [  = all ]
+ [ yes = all ]
+ update
+ [ yes = no ]
+ [ -z  ]
+ set_highest_version
+ get_sorted_versions
+ version_list=
+ basename /var/lib/initramfs-tools/2.6.18-6-686
+ gsv_x=2.6.18-6-686
+ [ 2.6.18-6-686 = * ]
+ worklist=
+ [ 2.6.18-6-686 !=  ]
+ worklist= 2.6.18-6-686
+ version_list= 2.6.18-6-686
+ basename /var/lib/initramfs-tools/2.6.32-5-686
+ gsv_x=2.6.32-5-686
+ [ 2.6.32-5-686 = * ]
+ worklist=
+ dpkg --compare-versions 2.6.32-5-686 > 2.6.18-6-686
+ worklist= 2.6.32-5-686 2.6.18-6-686
+ gsv_x=
+ [  !=  ]
+ version_list= 2.6.32-5-686 2.6.18-6-686
+ verbose Available versions:  2.6.32-5-686 2.6.18-6-686
+ [ 0 = 1 ]
+ [ -z  2.6.32-5-686 2.6.18-6-686 ]
+ set -- 2.6.32-5-686 2.6.18-6-686
+ version=2.6.32-5-686
+ [ -z 2.6.32-5-686 ]
+ [ -z 2.6.32-5-686 ]
+ [ -z 2.6.32-5-686 ]
+ set_initramfs
+ initramfs=/boot/initrd.img-2.6.32-5-686
+ ro_boot_check
+ [ ! -r /proc/mounts ]
+ chrooted
+ stat -c %d/%i /
+ stat -Lc %d/%i /proc/1/root
+ [ 2050/2 = 2050/2 ]
+ return 1
+ awk /boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
&& $2 == "/boot") print "ro"} /proc/mounts
+ boot_opts=
+ [ -n  ]
+ altered_check
+ [ 0 = 1 ]
+ [ ! -e /boot/initrd.img-2.6.32-5-686 ]
+ compare_sha1
+ diff /var/lib/initramfs-tools/2.6.32-5-686 -
+ sha1sum /boot/initrd.img-2.6.32-5-686
+ return 0
+ backup_initramfs
+ [ ! -r /boot/initrd.img-2.6.32-5-686 ]
+ initramfs_bak=/boot/initrd.img-2.6.32-5-686.dpkg-bak
+ [ -r /boot/initrd.img-2.6.32-5-686.dpkg-bak ]
+ ln -f /boot/initrd.img-2.6.32-5-686 /boot/initrd.img-2.6.32-5-686.dpkg-bak
+ verbose Keeping /boot/initrd.img-2.6.32-5-686.dpkg-bak
+ [ 0 = 1 ]
+ generate_initramfs
+ echo update-initramfs: Generating /boot/initrd.img-2.6.32-5-686
update-initramfs: Generating /boot/initrd.img-2.6.32-5-686
+ OPTS=-o
+ [ 0 = 1 ]
+ mkinitramfs -o /boot/initrd.img-2.6.32-5-686.new 2.6.32-5-686
[: 33: #: unexpected operator
+ mv -f /boot/initrd.img-2.6.32-5-686.new /boot/initrd.img-2.6.32-5-686
+ set_sha1
+ sha1sum /boot/initrd.img-2.6.32-5-686
+ run_bootloader
+ [ -d /etc/initramfs/post-update.d/ ]
+ command -v update-grub
+ [ -e /etc/lilo.conf ]
+ [ -r /etc/lilo.conf ]
+ [ -r /etc/elilo.conf ]
+ [ -r /etc/zipl.conf ]
+ flash-kernel --supported
+ backup_booted_initramfs
+ initramfs_bak=/boot/initrd.img-2.6.32-5-686.dpkg-bak
+ [ ! -r /boot/initrd.img-2.6.32-5-686.dpkg-bak ]
+ [ ! -r /proc/uptime ]
+ [ no = no ]
+ rm -f /boot/initrd.img-2.6.32-5-686.dpkg-bak
+ return 0

Running "sh -x mkinitramfs -o /boot/initrd.img-2.6.32-5-686.new 2.6.32-5-686"

I found this:

...
+ ec=0
+ [ 0 -ne 0 ]
+ [ -e /conf/param.conf ]
+ [ -f /usr/share/initramfs-tools/hooks/uswsusp ]
+ [ n = y ]
+ /usr/share/initramfs-tools/hooks/uswsusp
[: 33: #: unexpected operator
+ ec=0
+ [ 0 -ne 0 ]
+ [ -e /conf/param.conf ]
+ [ -f /usr/share/initramfs-tools/hooks/dmsetup ]
+ [ n = y ]
...

Then, I ran:

debian:/var/lib/initramfs-tools# /usr/share/initramfs-tools/hooks/uswsusp
[: 33: #: unexpected operator
cp: «/etc/uswsusp.conf» y «/etc/uswsusp.conf» son el mismo fichero
debian:/var/lib/initramfs-tools#

(English: cp: «/etc/uswsusp.conf» and «/etc/uswsusp.conf» are the same file)

And then:

In the file (/usr/share/initramfs-tools/hooks/uswsusp) we can find:

# The only obligatory option ..
RES_DEV=$(sed -rn 's/^resume device[[:space:]]+[:=][[:space:]]+// p' /etc/uswsusp.conf)

if [ -z "$RES_DEV" ] || [ ! -b $RES_DEV ]; then
    exit 0;
fi

debian:/var/lib/initramfs-tools# sed -rn 's/^resume device[[:space:]]+[:=][[:space:]]+// p' /etc/uswsusp.conf
# RESUME=/dev/sda3 UUID=6242f227-2677-4df5-85d1-c64262909585

And yes! this is the problem, the previous output in the test.

This line is commented in the installation process of uswsusp, because I cannot use this swap partition to suspend to disk. Is this line:

debian:/var/lib/initramfs-tools# cat /etc/uswsusp.conf | grep resume
resume device = # RESUME=/dev/sda3 UUID=6242f227-2677-4df5-85d1-c64262909585

Probably, the easiest solution is check if the line is commented.

Thanks a lot.

--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/




Reply to: