X-Git-Url: http://git.annexia.org/?p=qemu-sanity-check.git;a=blobdiff_plain;f=init.c;h=ef7011c032543e1d29b679b617431d307e7d139e;hp=17bfa2a861a3057a0ee614e2e259f36c3b07a5fe;hb=b1dcf280b829474c8bce6c0143bebc4c463bd0b2;hpb=aee03601ac923906391b438bc4040c4a4265112d diff --git a/init.c b/init.c index 17bfa2a..ef7011c 100644 --- a/init.c +++ b/init.c @@ -11,9 +11,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -22,6 +22,10 @@ #include #include +#ifdef HAVE_SYS_REBOOT_H +#include +#endif + int main (int argc, char *argv[]) { @@ -29,6 +33,14 @@ main (int argc, char *argv[]) fprintf (stderr, "***** initrd started up OK *****\n"); fprintf (stderr, "\n"); fprintf (stderr, "\n"); + +#if defined(HAVE_SYS_REBOOT_H) && defined(RB_AUTOBOOT) + /* Try to reboot the system. */ + reboot (RB_AUTOBOOT); + perror ("reboot"); + /* Reboot attempt failed, fallthrough below. */ +#endif + fprintf (stderr, "expect to see a kernel panic below, that is normal\n"); fprintf (stderr, "\n"); fprintf (stderr, "\n");