Setting default header image in child theme

Twenty Twelve by default doesn’t have a header image specified. For a child theme, I need to set a default header image. I’ve tried overriding the custom header functionality, but wasn’t able to find a durable solution.

I tried copying the /inc/custom-header.php to the child theme’s folder, and customize it there, but the child theme just kept using the parent theme’s custom-header file.

My current solution is to replace line 83 of the parents functions.phprequire( get_template_directory() . '/inc/custom-header.php' );
withrequire( get_stylesheet_directory() . '/inc/custom-header.php' );
This does the trick, however, I will need to make the change everytime Twenty Twelve gets updated.

Anyone has a solution that can withstand an update to the parent theme?

@paulwp: As I had mentioned, I have made a plugin of the code you have posted here, and I did that because (and as a rookie) I had read something somewhere about a plugin occasionally being preferable over an accumulation of things in functions.php. Either way, however, someone had suggested I submit the new plugin to the repository…and it has been accepted. But since I would/will be showing your username as the contributor of its code, I have come here again to first ask your permission for that mention of you.

Many thanks.

edit: Also, a link to this thread will be the one (and only) listed or shown anywhere in relation to the new plugin.

Please go ahead, feel free to do whatever, credit to me is totally unnecessary, it’s just a piece of code anyway. It’s good that you make it useful for more people, and folks with higher coding skill can improve upon too.