# # \brief Example for hosting the genode.org website on Genode # \author Norman Feske # \date 2012-08-16 # # This run script combines the lighttpd web server with the tar_fs file system # to host the genode.org website. When executed the first time, the genode.org # website is downloaded to 'bin/genode_org/website'. When the web server is up, # you may point your web browser to http://localhost:5555 # set build_components { core init drivers/timer server/tar_fs app/lighttpd } set use_usb_driver [expr [have_spec omap4] || [have_spec exynos5]] set use_nic_driver [expr !$use_usb_driver] set use_platform_driver [expr $use_usb_driver && [have_spec foc_arndale]] if {$use_usb_driver} { set network_driver "usb_drv" } if {$use_nic_driver} { set network_driver "nic_drv" } lappend_if $use_platform_driver build_components drivers/platform lappend_if $use_usb_driver build_components drivers/usb lappend_if $use_nic_driver build_components drivers/nic lappend_if [have_spec acpi] build_components drivers/acpi lappend_if [have_spec pci] build_components drivers/pci/device_pd lappend_if [have_spec gpio] build_components drivers/gpio build $build_components create_boot_directory append config { } append_if $use_platform_driver config { } append_if [have_spec gpio] config { } append_if $use_usb_driver config { } append_if $use_nic_driver config { } append_if [have_spec acpi] config { } append_if [expr ![have_spec acpi] && [have_spec pci]] config { } append config { } append config { } install_config $config # # Create TAR archive containting the web-server configuration and the # website content. # # lighttpd configuration exec mkdir -p bin/genode_org/etc/lighttpd set fd [open "bin/genode_org/etc/lighttpd/lighttpd.conf" w] puts $fd { server.port = 80 server.document-root = "/website" server.event-handler = "select" server.network-backend = "write" server.max-keep-alive-requests = 0 index-file.names = ( "index", "index.html", "index.htm" ) mimetype.assign = ( ".png" => "image/png", ".jpg" => "image/jpeg", ".jpeg" => "image/jpeg", ".gif" => "image/gif", ".css" => "text/css", ".html" => "text/html", ".htm" => "text/html", "" => "text/html", ) } close $fd # mirror of genode.org website if {![file exists bin/genode_org/website/index]} { puts "mirroring genode.org website to bin/genode_org/website..." exec mkdir -p bin/genode_org/website # ignore wget errors catch { exec wget -nH -Lrc -P bin/genode_org/website http://genode.org } } exec tar cfv bin/genode_org.tar -h -C bin/genode_org . # # Boot modules # # generic modules set boot_modules { core init timer ld.lib.so tar_fs libc.lib.so libm.lib.so libc_fs.lib.so libc_log.lib.so lwip.lib.so zlib.lib.so lighttpd genode_org.tar } # platform-specific modules lappend_if $use_platform_driver boot_modules platform_drv lappend_if [have_spec acpi] boot_modules acpi_drv lappend_if [have_spec pci] boot_modules pci_drv lappend_if $use_usb_driver boot_modules usb_drv lappend_if $use_nic_driver boot_modules nic_drv lappend_if [have_spec nova] boot_modules pci_device_pd lappend_if [have_spec gpio] boot_modules gpio_drv build_boot_image $boot_modules append_if [have_spec x86] qemu_args " -net nic,model=e1000 " append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 " append qemu_args " -net user -redir tcp:5555::80 " append qemu_args " -nographic -serial mon:stdio " run_genode_until forever