Add memtest support.
[syslinux-debian/hramrach.git] / com32 / lua / test / syslinux-derivative.lua
blobfbdf5d5757c42a61c2f43bad26d59aa2ded81da7
1 -- get nice output
2 printf = function(s,...)
3 return io.write(s:format(...))
4 end
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'
22 else
23 printf("Do nothing\n")
24 return 1
25 end
27 printf("\n commandline for derivative: %s\n\n", commandline)
30 -- Count down from 7
31 for time = 7, 1, -1 do
32 printf(" Boot in %d second(s)... \r", time)
33 syslinux.sleep(1)
34 end
36 -- Boot
37 syslinux.run_command(commandline)