You are not logged in.

#1 2012-04-22 09:00:59

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

[SOLVED] Booting Windows from a desktop shortcut

I'm looking for a script or method that changes the default menu entry for the bootloader and reboots the system, but when I reboot (or shutdown) from Windows, Arch Linux becomes the default entry.

Maybe what I'm looking for is a way to save the previous selection as the default. Is this possible?

Last edited by DSpider (2012-04-23 09:50:23)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#2 2012-04-22 10:30:09

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,319

Re: [SOLVED] Booting Windows from a desktop shortcut

Offline

#3 2012-04-23 07:56:53

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Booting Windows from a desktop shortcut

Ah, now I remember. GRUB Legacy. It's been so long since I last used it... About 3 years I think. It was great. It did what it was meant to do, and did it well. I use Syslinux now.


Here's something interesting:

http://www.syslinux.org/wiki/index.php/Doc/extlinux

5. EXTLINUX now has "boot-once" support. The boot-once information is stored in an on-disk datastructure, part of extlinux.sys, called the "Auxillary Data Vector". The Auxilliary Data Vector is also available to COMBOOT/COM32 modules that want to store small amounts of information.

To set the boot-once information, do:

extlinux --once 'command' /boot/extlinux

where 'command' is any command you could enter at the SYSLINUX command line. It will be executed on the next boot and then erased.


I should probably reboot, press Tab at the "Windows XP" entry and jot it down on a piece of paper or something (on my phone, most likely).

Last edited by DSpider (2012-04-23 09:52:22)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#4 2012-04-23 09:50:11

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Booting Windows from a desktop shortcut

Solved.

$ sudo extlinux --once 'chain.c32 hd0 2' /boot/syslinux/
$ sudo extlinux -o "xp" /boot/syslinux/

Both of the above work, along with different variations. Read the man page for extlinux.


The Syslinux menu entry for Windows:

LABEL xp
        MENU LABEL Windows XP
        KERNEL chain.c32
        APPEND hd0 2

And the script:

#! /bin/sh

sudo extlinux -o xp /boot/syslinux/
sudo reboot

Coupled with my sudoers file (so that it doesn't ask for a password):

dspider arch=NOPASSWD: /sbin/reboot, /sbin/poweroff, /usr/sbin/extlinux -o xp /boot/syslinux/

Creating a shortcut to the script is trivial. I'm not gonna go into it. To be honest, I was more interested in creating an Openbox menu entry than a desktop shortcut. But it pretty much works the same anyway.

Cheers.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB