GRUB2 eats your OSes

After a chat in the pub with a friend of mine, I thought it were time to bring back to life my netbsd which didn’t boot anymore post installation of Grub2 on my Debian laptop. I have found a nice page describing Grub 2. All I had to do was then to edit this file /etc/grub.d/40_custom and fill it with this :

#!/bin/sh
echo "Adding NetBSD" >&2
cat < < EOF
menuentry "
NetBSD" {
set root=(hd0,2)
chainloader +1
}
EOF

All remains is to run the following and you’re good to go: update-grub2