Quick hack to get image booting working again

This commit is contained in:
Michael Brown
2007-06-28 17:55:29 +01:00
parent 7d6e4aab6f
commit 4b08f4cf0f
5 changed files with 69 additions and 68 deletions

View File

@@ -99,19 +99,27 @@ void netboot ( struct net_device *netdev ) {
return;
}
printf ( "Booting \"%s\"\n", filename );
if ( ( rc = imgfetch ( filename, NULL, &image ) ) != 0 ) {
image = alloc_image();
if ( ! image ) {
printf ( "Out of memory\n" );
return;
}
if ( ( rc = imgfetch ( image, filename, 0 ) ) != 0 ) {
printf ( "Could not retrieve %s: %s\n",
filename, strerror ( rc ) );
image_put ( image );
return;
}
if ( ( rc = imgload ( image ) ) != 0 ) {
printf ( "Could not load %s: %s\n", image->name,
strerror ( rc ) );
image_put ( image );
return;
}
if ( ( rc = imgexec ( image ) ) != 0 ) {
printf ( "Could not execute %s: %s\n", image->name,
strerror ( rc ) );
image_put ( image );
return;
}
}