As I understand it, the reason memtest-setup puts the memtest entry at the beginning of the grub menu instead of the end (bug 489110) is that it uses grubby. Is it possible for the modified version to avoid this? (I'm guessing not, just thought I should ask before you did the work.)

(In reply to comment #4)
No problem, my new memtest-setup is flexible. I will add the option for the insert position and make the last position the default if not specified.
I am not using grubby now, because it doesn't count with non-kernel images and the memtest installation still required helper script and sed for ugly non-portable grub conf patching. The situation went even worse with grub2. Currently the grubby cannot be easily modified. In the future I am going to create and post grubby patches that simplifies the installation of non-kernel images but it would be longer term goal.

Hi,
rather than using grubby and some post install, wouldn't it be better to use some template at the /etc/grub.d/? For example /etc/grub.d/23_memtest would move the entry to the end of the grub2 menu.
I am attaching the template script I modified from the 10_linux for the need of memtest.
New grub2 configuration is generated by:
grub2-mkconfig -o /boot/grub2/grub.cfg
Best regards
Michal Ambroz

Guys, sorry for delay. Michal thanks for your work.
Personally I was interested in robust grub1/2 capable script that do not force user to run grub2-mkconfig (i.e. it patch directly grub.cfg), but also generates grub2 templates to support grub2-mkconfig. Currently I am in approx. 50% of implementation (I was busy with more prio tasks).
I think we can go with the template to fix this problem quickly. Maybe I will release the script later. Again thanks.

I added support to memtest-setup for the template. It should now support grub/grub2. Thanks for the template.
I will integrate my rewritten version of memtest-setup later, when finished and fully tested.

It works, just two minor issues:
1) When updating memtest86+, get the warning
Running Transaction
Updating : memtest86+-4.20-2.fc16.x86_64 1/2
Cleanup : memtest86+-4.20-1.fc16.x86_64 2/2
sed: can't read /boot/grub/grub.conf: No such file or directory
2) I have a dual-boot machine (Fedora/Vista), and the memtest86+ entry is after the Fedora entries but before the Vista entry. Is it possible to have the memtest86+ entry always be last (below all OS entries)?

Package memtest86+-4.20-2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing memtest86+-4.20-2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16801/memtest86+-4.20-2.fc16
then log in and leave karma (feedback).

(In reply to comment #15)
> It works, just two minor issues:
>
> 1) When updating memtest86+, get the warning
>
It seems to be caused by %preun of the old memtest that has hardcoded grub1.
New version has conditional. I guess it would require some triggers magic to
kill this, but the added complexity woulnd't be probably worth to fix such
harmless warning that appears only once.
> 2) I have a dual-boot machine (Fedora/Vista), and the memtest86+ entry is after
> the Fedora entries but before the Vista entry. Is it possible to have the
> memtest86+ entry always be last (below all OS entries)?
>
I will check this.

(In reply to comment #18)
> Works for me in my VirtualBox 4.1.6 Rawhide x86_64 guest with updates-testing
> enabled, though. Weird.
It blows down my VirtualBox-4.1.6_74713 x86_64, but it probably doesn't mean anything (I have similar opinion with some F16 kernels :). There was no code change and it seems to work OK on my real testing HW.

I spotted typo in memtest86+ spec file, that caused the 20_memtest not to be removed from your /etc/grub.d/ upon package uninstall. I fixed this in memtest86+-4.20-3. I also renamed the 20_memtest to 20_memtest86+ to be in sync with upstream docs.

(In reply to comment #15)
> 2) I have a dual-boot machine (Fedora/Vista), and the memtest86+ entry is after
> the Fedora entries but before the Vista entry. Is it possible to have the
> memtest86+ entry always be last (below all OS entries)?
>
If you install your second OS (Vista) by 30_os-prober or by 40_custom or $prefix/custom.cfg scripts, they appeared after the memtest in the bootmenu, because memtest uses prefix 20_*. This number seems to be reserved by grub2 upstream, according to their docs:
20_*: Third party apps (e.g. memtest86+)
You can rename the 20_memtest86+ to e.g. 50_memtest86+ to be the last in the menu, but you will have to also remove it by hand if you uninstall the memtest86+ package later. I think we should use the 20_* for compatibility.

(In reply to comment #24)
> Does it matter that it's not using the elf-memtest image anymore? That one can
> be booted with:
> knetbsd /elf-memtest86+-4.20
AFAIK probably better not to change this. I will revert this in memtest86+-4.20-4.fc16, thanks.

(In reply to comment #29)
Thanks for testing.
The two memtest86+ entries are caused by bug introduced by typo in 4.20-2 - it doesn't remove its template and it is leftover. It gets fixed in 4.20-3. You need to remove the leftover 4.20-2 template by hand:
# rm /etc/grub.d/20-memtest
I am not sure if it is worth to add hack for this, because the 4.20-2 didn't left updates-testing and was there only for short time.
> Note, though, that when
> running memtest-setup it doesn't tell me to run grub2-mkconfig, so it would
> have been easy to forget.
>
> [root@compaq-pc RPMS]# memtest-setup
> grub2 detected, installing template...
> grub2 template is already installed. Exiting...
>
If the grub template is already there (the leftover template in this case) I guess it doesn't need to tell you to run grub2-mkconfig, because there was done no change to your grub2 config.

(In reply to comment #29)
Upgrade path 4.20-1 to 4.20-4 should work without the leftover file. Also the leftover file is only present if you install 4.20-2 and then run memtest-setup, otherwise it is not created.

Confirmed that the old file /etc/grub.d/20_memtest is not owned by any package, and removed it. Running grub2-mkconfig then gives me one memtest entry. This entry also works both in my F16 and Rawhide guests.