From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NHY3f-0006S9-4M for mharc-grub-devel@gnu.org; Mon, 07 Dec 2009 02:30:59 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHY3c-0006Rv-T8 for grub-devel@gnu.org; Mon, 07 Dec 2009 02:30:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHY3b-0006Rb-O7 for grub-devel@gnu.org; Mon, 07 Dec 2009 02:30:55 -0500 Received: from [199.232.76.173] (port=37061 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHY3b-0006RY-IM for grub-devel@gnu.org; Mon, 07 Dec 2009 02:30:55 -0500 Received: from 74-93-104-97-washington.hfc.comcastbusiness.net ([74.93.104.97]:53750 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHY3b-0007fS-DB for grub-devel@gnu.org; Mon, 07 Dec 2009 02:30:55 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 92F2424C6E2; Sun, 6 Dec 2009 23:30:53 -0800 (PST) Date: Sun, 06 Dec 2009 23:30:53 -0800 (PST) Message-Id: <20091206.233053.45905914.davem@davemloft.net> To: fzielcke@z-51.de From: David Miller X-Mailer: Mew version 6.2 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: grub-devel@gnu.org Subject: mkrelpath doesn't do what it should... X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2009 07:30:57 -0000 I was trying to figure out why the kernel image paths generated automatically for me by grub-mkconfig were not correct. I have /boot on a seperate partition, but in the generated config files it uses paths like /boot/vmlinux-2632 etc. The problem is grub-mkrelpath and it's usage in the scrips such as "10_linux". "/boot" is given to "grub-mkrelpath", and this results in the identical "/boot" in rel_dirname. So all the paths emitted by 10_linux end up being "/boot" based instead of "/" based. grub-mkrelpath seems to do the right thing if I pass it a full path, f.e. giving it "/boot/vmlinux" emits the correct "/vmlinux" Casually inspecting make_system_path_relative_to_its_root() shows what appears to be another bug. It seems to immediately break from the loop when a different device number than "/"'s is seen, but what if I have: /one/two/three Where / is /dev/hda1, /one/two is /dev/hda2 and /one/two/three is yet another mount from /dev/hda3. It seems like the premature loop exit in this function will give us the wrong result here. The loop needs to remember the string prefix point at which every device number change occurs, and once the whole path has been traversed it should unwind back to that point in order to emit the result.