2 printf
= function(s
,...)
3 return io
.write(s
:format(...))
6 -- get syslinux derivative (ISOLINUX, PXELINUX, SYSLINUX)
7 derivative
= syslinux
.derivative()
9 printf("Run specific command depending on the Syslinux derivate:\n")
10 printf("--------------------------------------------------------\n\n")
11 printf(" Detected Syslinux derivative: %s\n", derivative
)
13 if derivative
== "SYSLINUX" then
14 -- swap internal (hd1) hard drive with USB stick (hd0)
15 commandline
= 'chain.c32 hd1 swap'
16 elseif derivative
== "ISOLINUX" then
17 -- boot first hard drive
18 commandline
= 'chain.c32 hd0'
19 elseif derivative
== "PXELINUX" then
20 -- boot first hard drive
21 commandline
= 'chain.c32 hd0'
23 printf("Do nothing\n")
27 printf("\n commandline for derivative: %s\n\n", commandline
)
31 for time
= 7, 1, -1 do
32 printf(" Boot in %d second(s)... \r", time
)
37 syslinux
.run_command(commandline
)