From c131ea55120adc0efe6d3b8f84f142a9e4cabf67 Mon Sep 17 00:00:00 2001 From: Niklas Date: Mon, 10 Oct 2011 17:26:17 +0200 Subject: added new files --- CMakeLists.txt | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ README | 8 ++++++- build-pkg.sh | 4 ++-- build.sh | 32 ++++++++++++++++++++++++-- lib/libcustomdhcpcd.so | Bin 0 -> 81333 bytes testApp.sh | 36 +++++++++++++++++++++++++++++ 6 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 CMakeLists.txt mode change 100644 => 100755 build.sh create mode 100755 lib/libcustomdhcpcd.so create mode 100755 testApp.sh diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f4a0c1f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,60 @@ +cmake_minimum_required(VERSION 2.8) + +project(fbgui) + +set(QT_MIN_VERSION "4.7.0") +find_package(Qt4 REQUIRED) +if (QT4_FOUND) + message(STATUS "QT4 found.") +else(QT4_FOUND) + message(FATAL_ERROR "QT4 not found!") +endif(QT4_FOUND) + +#find_package(Qxt REQUIRED) + +set(QT_USE_QTNETWORK TRUE) +set(QT_USE_QTWEBKIT TRUE) + +file(GLOB FBGUI_SOURCES src/*.cpp) +file(GLOB FBGUI_MOC_HEADERS src/*.h) +file(GLOB FBGUI_UIS src/*.ui) +file(GLOB FBGUI_RCS src/*.qrc) + +include_directories(${CMAKE_CURRENT_BINARY_DIR} + /usr/include/ + /usr/include/netlink/ + /usr/include/netlink/route/ + ./customdhcpcd/src/ + ./common/ + ./build + ${QT_INCLUDES} + /usr/local/Qxt/include/QxtCore + /usr/include/sysfs + /usr/include/libusb-1.0) + +include(${QT_USE_FILE}) +add_definitions(${QT_DEFINITIONS}) + +link_directories(/usr/local/Qxt/lib /usr/lib + /home/niklas/workspace/fbgui-ng/lib) + +#add_library( +# /usr/local/Qxt/lib/libQxtCore.so +# /usr/lib/libqjson.so +# /usr/lib/libusb-1.0.a +# ) + +QT4_ADD_RESOURCES(FBGUI_RC_SOURCES ${FBGUI_RCS}) +QT4_WRAP_UI(FBGUI_UI_HEADERS ${FBGUI_UIS}) +QT4_WRAP_CPP(FBGUI_MOC_SOURCES ${FBGUI_MOC_HEADERS}) + +add_executable(fbgui + ${QT_INCLUDES} + ${FBGUI_SOURCES} + ${FBGUI_MOC_SOURCES} + ${FBGUI_UI_HEADERS} + ${FBGUI_RC_SOURCES}) + +target_link_libraries(fbgui + ${QT_LIBRARIES} + QxtCore qjson sysfs usb-1.0 customdhcpcd nl) diff --git a/README b/README index 8c226d1..9cf6ab1 100644 --- a/README +++ b/README @@ -17,7 +17,13 @@ What does this do excatly? (Note: The website content is crucial to the successfull execution of this program!) How to build/use it? - Simply run ./build.sh to create a package of fbgui (including all the required libs). + + First compile the source code using: + ./build.sh + + To build the package first compile then use: + ./build.pkg.sh + To integrate into a Preboot-Media, follow instructions on the wiki. Dependancies: diff --git a/build-pkg.sh b/build-pkg.sh index f3f3c36..4e7a77b 100755 --- a/build-pkg.sh +++ b/build-pkg.sh @@ -12,13 +12,13 @@ mkdir -p pkg cd pkg mkdir -p bin -cp ../src/fbgui bin +cp ../build/fbgui bin mkdir -p usr/local/Trolltech/${QT_VERSION}/lib cp -r /usr/local/Trolltech/${QT_VERSION}/lib/fonts \ usr/local/Trolltech/${QT_VERSION}/lib/ -for SHARED_LIBRARY in `ldd ../src/fbgui | awk '{print $3}' |grep ^/` +for SHARED_LIBRARY in `ldd ../build/fbgui | awk '{print $3}' |grep ^/` do #echo "$SHARED_LIBRARY" DIR=`dirname $SHARED_LIBRARY | cut -c2-` diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 4ed283b..0d6f4eb --- a/build.sh +++ b/build.sh @@ -1,2 +1,30 @@ -#!/bin/bash -# TODO auto-compiler with cmake +#!/bin/sh +# fbsplash builder script for cmake +DIR=$(pwd) +BUILDDIR=build + +# if --clean, remove build dir +if [ "$1" = "--clean" ] +then + rm -rf $BUILDDIR + echo "$BUILDDIR removed." +fi + +if [ ! -f CMakeLists.txt ] +then + echo "No CMakeLists.txt found." + echo "Run this script from the folder containing CMakeLists.txt." + exit 1 +fi + +# make build dir if its not there +[ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR + +cd $BUILDDIR +# use cmake to create Makefile +echo "Invoking cmake ..." +cmake "$DIR" +echo "Invoking make ..." +make + +cd $DIR diff --git a/lib/libcustomdhcpcd.so b/lib/libcustomdhcpcd.so new file mode 100755 index 0000000..b4894ce Binary files /dev/null and b/lib/libcustomdhcpcd.so differ diff --git a/testApp.sh b/testApp.sh new file mode 100755 index 0000000..054169d --- /dev/null +++ b/testApp.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Script now simply passes all arguments to the fbgui call. +# Use: ./testApp.sh [OPTIONS] +# OPTIONS: +# -h, --help prints help +# -D , --debug= sets debug level [0,1] +# -u , --url= sets URL to load +# -d , --download= sets download directory +# -c , --config= sets path to config file +# -t , --trigger= sets path to file triggering URL load +# -s , --serial= sets path to serial number file +# +# Note: all path are expected to be absolute. +QT_VERSION=Qt-4.7.2 + +# clean /tmp/fbgui +rm -rf /tmp/fbgui +rm /tmp/fbgui_trigger + +# path to script (including script name) +script_path="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" + +# to get the path only: use dirname which strips the filename from a path +working_path=`dirname "$script_path"` + +# construct unique display_id based on user, needed for multi-user qvfb usage +display_id=$(grep -n $(whoami) /etc/passwd| head -n 1|awk -F : '{print $1}') + +# Start QT's virtual framebuffer with proper display_id +/usr/local/Trolltech/$QT_VERSION/bin/qvfb -width 1024 -height 768 -qwsdisplay :$display_id & +# quick sleep to wait for qvfb loading +sleep 0.2 +# Start fbgui connecting to QVFb with display_id from above. +$working_path/build/fbgui -display QVFb:$display_id $@ +# kill qvfb since fbgui stopped +killall qvfb -- cgit v1.2.3-55-g7522