Date: Mon, 30 Jun 2014 17:01:15 GMT From: pedrosouza@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r270228 - soc2014/pedrosouza/lua_loader/head/sys/boot/lua Message-ID: <201406301701.s5UH1Fld000775@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pedrosouza Date: Mon Jun 30 17:01:14 2014 New Revision: 270228 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=270228 Log: Added drawer.lua Added: soc2014/pedrosouza/lua_loader/head/sys/boot/lua/drawer.lua Added: soc2014/pedrosouza/lua_loader/head/sys/boot/lua/drawer.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2014/pedrosouza/lua_loader/head/sys/boot/lua/drawer.lua Mon Jun 30 17:01:14 2014 (r270228) @@ -0,0 +1,157 @@ +include("/boot/screen.lua"); +drawer = {}; + +drawer.brand_position = {x = 2, y = 1}; +drawer.fbsd_logo = { + " ______ ____ _____ _____ ", + " | ____| | _ \\ / ____| __ \\ ", + " | |___ _ __ ___ ___ | |_) | (___ | | | |", + " | ___| '__/ _ \\/ _ \\| _ < \\___ \\| | | |", + " | | | | | __/ __/| |_) |____) | |__| |", + " | | | | | | || | | |", + " |_| |_| \\___|\\___||____/|_____/|_____/ " +}; + +drawer.logo_position = {x = 46, y = 4}; +drawer.beastie_color = { + " \027[31m, ,", + " /( )`", + " \\ \\___ / |", + " /- \027[37m_\027[31m `-/ '", + " (\027[37m/\\/ \\\027[31m \\ /\\", + " \027[37m/ / |\027[31m ` \\", + " \027[34mO O \027[37m) \027[31m/ |", + " \027[37m`-^--'\027[31m`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " \027[33m<----.\027[31m __ / __ \\", + " \027[33m<----|====\027[31mO)))\027[33m==\027[31m) \\) /\027[33m====|", + " \027[33m<----'\027[31m `--' `.__,' \\", + " | |", + " \\ / /\\", + " \027[36m______\027[31m( (_ / \\______/", + " \027[36m,' ,-----' |", + " `--{__________)\027[37m" +}; + +drawer.beastie = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + " <----. __ / __ \\", + " <----|====O)))==) \\) /====|", + " <----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)" +}; + +drawer.fbsd_logo_shift = {x = 5, y = 6}; +drawer.fbsd_logo_v = { + " ______", + " | ____| __ ___ ___ ", + " | |__ | '__/ _ \\/ _ \\", + " | __|| | | __/ __/", + " | | | | | | |", + " |_| |_| \\___|\\___|", + " ____ _____ _____", + " | _ \\ / ____| __ \\", + " | |_) | (___ | | | |", + " | _ < \\___ \\| | | |", + " | |_) |____) | |__| |", + " | | | |", + " |____/|_____/|_____/" +}; + +drawer.orb_shift = {x = 3, y = 0}; +drawer.orb_color = { + " \027[31m``` \027[31;1m`\027[31m", + " s` `.....---...\027[31;1m....--.``` -/\027[31m", + " +o .--` \027[31;1m/y:` +.\027[31m", + " yo`:. \027[31;1m:o `+-\027[31m", + " y/ \027[31;1m-/` -o/\027[31m", + " .- \027[31;1m::/sy+:.\027[31m", + " / \027[31;1m`-- /\027[31m", + " `: \027[31;1m:`\027[31m", + " `: \027[31;1m:`\027[31m", + " / \027[31;1m/\027[31m", + " .- \027[31;1m-.\027[31m", + " -- \027[31;1m-.\027[31m", + " `:` \027[31;1m`:`", + " \027[31;1m.-- `--.", + " .---.....----.\027[37m" +}; + +drawer.orb = { + " ``` `", + " s` `.....---.......--.``` -/", + " +o .--` /y:` +.", + " yo`:. :o `+-", + " y/ -/` -o/", + " .- ::/sy+:.", + " / `-- /", + " `: :`", + " `: :`", + " / /", + " .- -.", + " -- -.", + " `:` `:`", + " .-- `--.", + " .---.....----." +}; + +function drawer.isColorEnabled() + return true; +end + +function drawer.draw(x, y, logo) + for i = 1, #logo do + screen.setcursor(x, y + i); + print(logo[i]); + end +end + +function drawer.drawbrand() + local x = tonumber(loader.getenv("loader_brand_x")); + local y = tonumber(loader.getenv("loader_brand_y")); + + if (x == nil) then x = drawer.brand_position.x; end + if (y == nil) then y = drawer.brand_position.y; end + + local logo = load("return " .. tostring(loader.getenv("loader_brand")))(); + if (logo == nil) then logo = drawer.fbsd_logo; end + drawer.draw(x, y, logo); +end + +function drawer.drawlogo() + local x = tonumber(loader.getenv("loader_logo_x")); + local y = tonumber(loader.getenv("loader_logo_y")); + + if (x == nil) then x = drawer.logo_position.x; end + if (y == nil) then y = drawer.logo_position.y; end + + local logo = loader.getenv("loader_logo"); + if (logo == "beastie") then logo = drawer.beastie_color; + elseif (logo == "beastiebw") then logo = drawer.beastie; + elseif (logo == "fbsdbw") then logo = drawer.fbsd_logo_v; + elseif (logo == "orb") then logo = drawer.orb_color; + elseif (logo == "orbbw") then logo = drawer.orb; + elseif (logo == "tribute") then logo = drawer.fbsd_logo; + elseif (logo == "tributebw") then logo = drawer.fbsd_logo; + elseif (logo == nil) then + if (drawer.isColorEnabled() == true) then logo = drawer.orb_color; + else logo = drawer.orb; end + end + drawer.draw(x, y, logo); +end \ No newline at end of file
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406301701.s5UH1Fld000775>