2021-07-20 06:37:43 +00:00
|
|
|
parameter BOOT_FILE is "rocket".
|
|
|
|
|
2021-08-23 02:25:41 +00:00
|
|
|
switch to 1.
|
2021-07-20 06:37:43 +00:00
|
|
|
clearguis().
|
2021-08-23 02:25:41 +00:00
|
|
|
|
|
|
|
// delete files on current volume
|
|
|
|
wipeDir("1:/", true).
|
|
|
|
|
|
|
|
// copy the new bootloader and execute it.
|
2021-08-01 05:23:39 +00:00
|
|
|
copypath("0:/boot/"+BOOT_FILE+".ks", "1:/boot/"+BOOT_FILE+".ks").
|
|
|
|
runpath("/boot/"+BOOT_FILE+".ks").
|
2021-08-23 02:25:41 +00:00
|
|
|
|
|
|
|
function wipeDir {
|
|
|
|
parameter dir, root is false.
|
|
|
|
|
|
|
|
cd(dir).
|
|
|
|
|
|
|
|
local fileList is list().
|
|
|
|
list files in fileList.
|
|
|
|
for f in fileList {
|
|
|
|
if f:ISFILE {
|
|
|
|
deletepath(f).
|
|
|
|
} else if f:NAME[0] <> "." {
|
|
|
|
wipeDir(f).
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if not root {
|
|
|
|
cd("..").
|
|
|
|
}
|
|
|
|
}
|