> Excellent! I'm looking forward to hear about your findings.

Forgive the crappyness of this code, but it is just to show that this idea
works:


syslinux supports lua scripts.


What to do:

1. VBoxManage setextradata "debvbox"
"VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct"
"Tails-Tor-Guest-MAGICNUM"

Where "debvbox" is the name of the tails virtual machine


2. Edit the tails iso and add the following files:

2a. /usr/lib/syslinux/lua.32 into iso://  isolinux/

2b. Replace isolinux.cfg with:
label lua
       kernel lua.c32
       append tails.lua
label select_menu
       com32 ifcpu64.c32
       append menu_686-pae -- menu_686-pae -- menu_486
label menu_686-pae
       kernel vesamenu.c32
       append live686.cfg
label menu_486
       kernel vesamenu.c32
       append live486.cfg
default lua
prompt 0

2c. Gedit a tails.lua script into iso://  isolinux/tails.lua   containing:
(here comes the crappy code, but it shows the concept works)
(dont need the <CODE> in the lua script)
<CODE>
function printf(...)
    io.write(string.format(...))
end

printf("hello world\n")


if (dmi.supported()) then

  dmitable = dmi.gettable()

  --for k,v in pairs(dmitable) do
  --  print(k, v)
  --end


  printf("system.product_name value is:\n")
  print(dmitable["system.product_name"])
  printf(" ")
  print(string.match(dmitable["system.product_name"],
"Tails-Tor-Guest-MAGICNUM"));
  syslinux.sleep(60)


  if ( dmitable["system.product_name"] == "Tails-Tor-Guest-MAGICNUM" ) then
    print("Matches")
    printf("system.product_name is set to Tails-Tor-Guest-MAGICNUM")
    printf("Executing syslinux menu entry tails-tor-guest-vm.label in 60
seconds")
    syslinux.sleep(60)
    syslinux.run_command("tails-tor-guest-vm.label")
  else
    print("Does not match")
    print("Running standard default tails menu entry 'select_menu' in 60
seconds")
    syslinux.sleep(60)
    syslinux.run_command("select_menu")
  end
end
--else dmi not supported (rare hardware?) still needs to load a menu entry
</CODE>



Re-build the iso, I used isomaster (a gui tool in debian packages)


Boot the ISO in virtualbox




How tails boots can now be controlled via a LUA script (tails.lua)
The lua script can check for DMI information

DMI was a standard created prior to 1999 that standardizes system
information being available from the bios such as product vendorname,
system name, system serial numbers, and a lot of other information


Virtualbox can SET dmi information using the VBoxManage command



With the supplied (crappy) lua script, the system will either boot the
normal ifcpu64 menu entry (go through the normal boot process) if a magic
string is not set for the DMI field System Product, or

If system product is set to a special value by VboxManage (that magic
string is Tails-Tor-Guest-MAGICNUM in the lua script) then it will boot
a syslinux menu entry called tails-tor-guest-vm.label   (which I havent
created yet btw)



So this is one idea, tails livecd can control how a tails-guest-vm will
boot, and tails-guest-vm can decide how to boot as early as the syslinux
stage




thoughts?














_______________________________________________
tails-dev mailing list
tails-dev@boum.org
https://mailman.boum.org/listinfo/tails-dev

Reply via email to