Save partition priorities in early startup

AmigaOS users can make feature requests in this forum.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Save partition priorities in early startup

Post by thomasrapp »

The script is not meant as a boot selector on startup. It is called from the currently running OS to select the partition you want to boot next. It does what the thread title says: it saves boot priorities. It does not (re)boot or change the current boot partition.
ancalimon
Posts: 35
Joined: Tue Oct 18, 2011 7:31 am

Re: Save partition priorities in early startup

Post by ancalimon »

I have modified to script to suit my simple setup at the moment. I'm using iconx as defaulttool to launch it. I can't make it work though. Am I missing something?

Code: Select all

.key changebootpri
.def changebootpri C:changebootpri

set choice `requestchoice "BootSelector" "*nSelect boot drive*n" "WB39|OS41|Cancel"`

if $choice eq 0
   skip quit
endif

if $choice eq 1 ; WB39
   <changebootpri> >nil: ADH1 1 ; WB39
   <changebootpri> >nil: DH0 0 ; OS41
   set dev "ADH1 / WB39"
   skip done
endif

if $choice eq 2 ; OS41
   <changebootpri> >nil: ADH1 0 ; WB39
   <changebootpri> >nil: DH0 1 ; OS41
   set dev "DH0 / WB41"
   skip done
endif

lab done
requestchoice >nil: "BootSelector" "Boot device set to $dev." "Ok"

lab quit
By the way, when I type .def in a shell I get ".def: Unknown command"

If I select WB39 or OS41 options after I'm presented with the choice window, I get a cli window titled IconX telling the following:

Code: Select all

 : Unknown command
 : Unknown command
 : Unknown command
 : Unknown command
And the BootSelector window appears saying: "Boot device set to $dev."
User avatar
Amigo1
Posts: 221
Joined: Sun Jan 01, 2012 3:32 pm

Re: Save partition priorities in early startup

Post by Amigo1 »

@ancalimon

.def is not a command intended to be typed in a shell.


Type "SET Echo ON" in a shell and try to start the script from a shell to find out more

other than that, I remember having had some issues with .def in scripts at some point in time after some updates of the OS. Scripts which used to work didn't. I am not in front of my Amiga and have no notes at hand, can't say if I solved it.
Cold reboot does help sometimes.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Save partition priorities in early startup

Post by thomasrapp »

Try to remove the lines with .key and .def from the beginning of the script and replace all occurrences of <changebootpri> by C:ChangeBootPri.

Note: if you use C: as path, you have to put the program into ADH1:C and into DH0:C. I would prefer one common place like Work:Tools/ChangeBootPri
ancalimon
Posts: 35
Joined: Tue Oct 18, 2011 7:31 am

Re: Save partition priorities in early startup

Post by ancalimon »

@thomasrapp

I got this when I did as you say:

7.OS41:> set echo on
7.OS41:> execute switchos
execute switchos
set choice 2
if 2 eq 0
if 2 eq 1
if 2 eq 2
: Unknown command
7.OS41:>

Then I tried the old script again and it worked. :/ I unarchived the changebootpri command to C: again before trying though. I have no idea what was causing the problem. Now I will try again with OS3.9 :)
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Save partition priorities in early startup

Post by thomasrapp »

Well, I used cut & paste to copy the script from your above post into an editor on my OS 4.1 machine and it ran at the first try. So you must be doing something wrong when editing the script.

Please try the attached version. Unpack it to RAM and run it by double click.
Attachments
SwitchOS.lha
(9.73 KiB) Downloaded 383 times
Post Reply