Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
3) Linux does some automated stuff (with the Windows partition).
4) Computer boots to windows.
5) User sees windows desktop. It's the first time the user can do anything with the computer.
This sequence must repeat each time the computer is rebooted.
So each time the compter is rebooted it first boots linux, which does some stuff and then boots to windows.
My first thought was to set the default boot option to linux in grub/lilo. Linux boots, does it's stuff, changes grub.conf so that WinXP would be default and reboots. That's easy, but the next time(s!) the computer is rebooted it would boot WinXP straight away.
I don't think it's possible to make grub change it's own config after the command to boot it's default option is performed. In other words: after it has chosen to boot from the windows partition grub would change the default option back to linux. I doubt that's possible tho :(.
I don't think WinXP could change this while/after booting either, or could it?
How would one create such a setup? It's all just theory right now, so all ideas are welcome.
Originally posted by acid_kewpie Could you explain WHY you want to do this in the first place? Maybe if we knew why you wanted to do such a bizarre thing we'd be able to offer useful suggestions to achieve your goal.
Linux would run scripts that would check what has been changed on the windows partition and restore files if need be from a server. Or update the installation of windows and other programs that are installed from the central server. This would be more convenient at a gaming/internet cafe instead of a "Kiosk mode" in windows.
The user could do almost anything, but a reboot would fix it all. A reboot could update windows itself, any programs or just desktop shortcuts.
One way would be to set up a small FAT partition on the HD and put install GRUB on it, and set you boot to load from the FAT partition. (Set it up like a floppy boot disk.) Then both Windows and Linux could access the grub.conf file and change it as needed.
Note: I haven't done this myself, but I think it should work. I do have a boot floppy, but it's configured as an e2fs disk. (Only 15% of the 1.4 Mb disk is used, so the partition can be quite small. Hum -- a thought: You could develop and test the concept using a FAT floppy as the GRUB boot disk, setting your system to boot from the floppy.)
Last edited by PTrenholme; 08-27-2005 at 09:28 AM.
My last post got me interested, so I built a FAT boot floppy, and it seemed to work well. At least both XP and FC4 could boot from the floppy, and read /boot/grub/grub.conf on the floppy
If you haven't done this, here's how:
1) Put a DOS formatted floppy in you drive.
$ mount /media/floppy (or wherever you mount your floppies)
$ mkdir /media/floppy/boot
$ mkdir /media/floppy/boot/grub
$ sudo cp /boot/grub/* /media/floppy/boot/grub/
$ sudo /sbin/grub
grub> root (fd0)
grub> setup (fd0)
$ umount /media/floppy
And that's it: Now just boot from the floppy and you should see the same GRUB menu you have on your HD, since all you did was copy your /boot/grub directory to the floppy.
My grub.conf file looks like this:
$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,1)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
title Fedora Core 4 (2.6.12-1.1398)
kernel /vmlinuz-2.6.12-1.1398_FC4smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
title Fedora Core 4 Init 3, no rhgb
kernel /vmlinuz-2.6.12-1.1398_FC4smp ro root=/dev/VolGroup00/LogVol00 3 quiet
title Fedora Core 3 (2.6.12-1.1372)
kernel /vmlinuz-2.6.12-1.1372_FC3smp ro root=LABEL=/ rhgb quiet
so I can boot into either XP or FC4 (or FC3 for a backup) from the floppy or HD.
Last edited by PTrenholme; 08-27-2005 at 01:05 PM.
I don't know if it's possible to boot from a FAT partition on the HD but if it'd be possible it's easy to create a "file.bat" automaticaly executed at the XP start-up: once you've created it put it into Start->Programs->Startup.
This file should copy a version of the grup file with the Linux start-up.
No problem. I do recommend that you develop the system using the boot-from-floppy approach, where you just set your BIOS to boot first from the floppy. That way you'll still have a working system when you (if you're like me) make the inevitable "boo-boo."