From 96d761013b0364043c603cb0a4498d59d617ce62 Mon Sep 17 00:00:00 2001 From: Michel LIBERADO Date: Fri, 19 Jul 2013 22:19:29 +0200 Subject: [PATCH] + added some instructions in /etc/network/interfaces in order to have a functional WiFi (with D-LINK DWA-131 in my case) + updated linux 3.6.y for raspberry fetch url + new packages * wiringPi : https://projects.drogon.net/raspberry-pi/wiringpi/ The package configuration is not very clean since the Makefile of wiringPi is subject to change very soon * qtserialport * qtftp + bootloader config.txt : * overscan properties for the (See http://elinux.org/RPiconfig#Video_mode_options) because my old TV need it * hdmi_drive * hdmi_group * hdmi_mode + package modifications : * wpa_supplicant : Added preliminary features to generate the /etc/wpa_supplicant file (used by /etc/network/interfaces) with support of SSID and KEY --- board/raspberrypi/interfaces | 5 ++ configs/raspberrypi_defconfig | 4 +- package/Config.in | 3 + package/qt5/qt5.mk | 2 + package/qt5/qtftp/Config.in | 5 ++ package/qt5/qtftp/qtftp.mk | 29 +++++++++ package/qt5/qtserialport/Config.in | 5 ++ package/qt5/qtserialport/qtserialport.mk | 29 +++++++++ package/raspberrypi/bootloader/Config.in | 52 ++++++++++++++- package/raspberrypi/bootloader/bootloader.mk | 21 +++++++ package/wiringpi/Config.in | 6 ++ package/wiringpi/wiringpi.mk | 66 ++++++++++++++++++++ package/wpa_supplicant/Config.in | 15 +++++ 13 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 package/qt5/qtftp/Config.in create mode 100644 package/qt5/qtftp/qtftp.mk create mode 100644 package/qt5/qtserialport/Config.in create mode 100644 package/qt5/qtserialport/qtserialport.mk create mode 100644 package/wiringpi/Config.in create mode 100644 package/wiringpi/wiringpi.mk diff --git a/board/raspberrypi/interfaces b/board/raspberrypi/interfaces index 01d53ab64..f744bcbf1 100644 --- a/board/raspberrypi/interfaces +++ b/board/raspberrypi/interfaces @@ -4,3 +4,8 @@ iface lo inet loopback # Configure eth0 auto eth0 iface eth0 inet dhcp +# Configure wlan0 +allow-hotplug wlan0 +auto wlan0 +iface wlan0 inet dhcp +pre-up wpa_supplicant -c /etc/wpa_supplicant.conf -i wlan0 -B diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index b798e8367..9430dc697 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -91,7 +91,7 @@ BR2_PACKAGE_QTGAMEPAD=y BR2_TARGET_ROOTFS_TAR_GZIP=y BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/tarball/rpi-3.6.y/79ec5aa57e2466e2cad5395fb47ad9c5c42537f9.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/tarball/rpi-3.6.y/3f3284d1c90673eb03236c8fd440b52c8028a47c.tar.gz" BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/raspberrypi/linux-3.6-raspberrypi.config" BR2_LINUX_KERNEL_UNCOMPRESSED=y @@ -110,4 +110,4 @@ BR2_PACKAGE_OMXPLAYER=y BR2_PACKAGE_XWIIMOTE=y BR2_INIT_UPSTART=y BR2_ROOTFS_DEVICE_TABLE="board/raspberrypi/device_table.txt" -BR2_PACKAGE_KBD=y \ No newline at end of file +BR2_PACKAGE_KBD=y diff --git a/package/Config.in b/package/Config.in index f58a7969f..63153553c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -823,6 +823,7 @@ source "package/raspberrypi/omxplayer/Config.in" source "package/xwiimote/Config.in" source "package/libnih/Config.in" source "package/upstart/Config.in" +source "package/wiringpi/Config.in" menu "Qt 5" source "package/qt5/qtbase/Config.in" source "package/qt5/qtxmlpatterns/Config.in" @@ -838,6 +839,8 @@ source "package/qt5/qtscript/Config.in" source "package/qt5/qtsvg/Config.in" source "package/qt5/qt3d/Config.in" source "package/qt5/qtgamepad/Config.in" +source "package/qt5/qtserialport/Config.in" +source "package/qt5/qtftp/Config.in" endmenu endmenu diff --git a/package/qt5/qt5.mk b/package/qt5/qt5.mk index 0dd90687e..683d26bcc 100644 --- a/package/qt5/qt5.mk +++ b/package/qt5/qt5.mk @@ -12,3 +12,5 @@ include package/qt5/qtscript/qtscript.mk include package/qt5/qtsvg/qtsvg.mk include package/qt5/qt3d/qt3d.mk include package/qt5/qtgamepad/qtgamepad.mk +include package/qt5/qtserialport/qtserialport.mk +include package/qt5/qtftp/qtftp.mk diff --git a/package/qt5/qtftp/Config.in b/package/qt5/qtftp/Config.in new file mode 100644 index 000000000..1e201eeab --- /dev/null +++ b/package/qt5/qtftp/Config.in @@ -0,0 +1,5 @@ +config BR2_PACKAGE_QTFTP + bool "qtftp" + select BR2_PACKAGE_QTBASE + help + A Qt5 module that adds support for ftp but which is deprecated. diff --git a/package/qt5/qtftp/qtftp.mk b/package/qt5/qtftp/qtftp.mk new file mode 100644 index 000000000..f3976126e --- /dev/null +++ b/package/qt5/qtftp/qtftp.mk @@ -0,0 +1,29 @@ +QTFTP_VERSION = 8f60c8c0adca6e6183fb31b528d306439ca2d2c1 +QTFTP_SITE = git://gitorious.org/qt/qtftp.git +QTFTP_SITE_METHOD = git +QTFTP_DEPENDENCIES = qtbase +QTFTP_INSTALL_STAGING = YES + +define QTFTP_CONFIGURE_CMDS + -[ -f $(@D)/Makefile ] && $(MAKE) -C $(@D) distclean + #run qmake + (cd $(@D) && $(HOST_DIR)/usr/bin/qmake ) +endef + +define QTFTP_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define QTFTP_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) install +endef + +define QTFTP_INSTALL_TARGET_CMDS + cp -dpf $(STAGING_DIR)/usr/lib/libQt5Ftp.a $(TARGET_DIR)/usr/lib +endef + +define QTFTP_UNINSTALL_TARGET_CMDS + -rm $(TARGET_DIR)/usr/lib/libQt5Ftp.a +endef + +$(eval $(generic-package)) diff --git a/package/qt5/qtserialport/Config.in b/package/qt5/qtserialport/Config.in new file mode 100644 index 000000000..f6fb49887 --- /dev/null +++ b/package/qt5/qtserialport/Config.in @@ -0,0 +1,5 @@ +config BR2_PACKAGE_QTSERIALPORT + bool "qtserialport" + select BR2_PACKAGE_QTBASE + help + A Qt5 module that adds support for managing serial port diff --git a/package/qt5/qtserialport/qtserialport.mk b/package/qt5/qtserialport/qtserialport.mk new file mode 100644 index 000000000..ff067ecea --- /dev/null +++ b/package/qt5/qtserialport/qtserialport.mk @@ -0,0 +1,29 @@ +QTSERIALPORT_VERSION = 238309f65ba8faaa0b88a4f3d06a224fe3652467 +QTSERIALPORT_SITE = git://gitorious.org/qt/qtserialport.git +QTSERIALPORT_SITE_METHOD = git +QTSERIALPORT_DEPENDENCIES = qtbase +QTSERIALPORT_INSTALL_STAGING = YES + +define QTSERIALPORT_CONFIGURE_CMDS + -[ -f $(@D)/Makefile ] && $(MAKE) -C $(@D) distclean + #run qmake + (cd $(@D) && $(HOST_DIR)/usr/bin/qmake ) +endef + +define QTSERIALPORT_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define QTSERIALPORT_INSTALL_STAGING_CMDS + $(MAKE) -C $(@D) install +endef + +define QTSERIALPORT_INSTALL_TARGET_CMDS + cp -dpf $(STAGING_DIR)/usr/lib/libQt5SerialPort*.so.* $(TARGET_DIR)/usr/lib +endef + +define QTSERIALPORT_UNINSTALL_TARGET_CMDS + -rm $(TARGET_DIR)/usr/lib/libQt5SerialPort*.so.* +endef + +$(eval $(generic-package)) diff --git a/package/raspberrypi/bootloader/Config.in b/package/raspberrypi/bootloader/Config.in index e1805dd9b..ad13a3dd1 100644 --- a/package/raspberrypi/bootloader/Config.in +++ b/package/raspberrypi/bootloader/Config.in @@ -81,11 +81,61 @@ config BR2_RASPBERRYPI_GPU_SPEED config BR2_RASPBERRYPI_DISABLE_OVERSCAN bool "disable overscan" - default y + default n help Disable overscan See http://elinux.org/RPiconfig#Video_mode_options +if !BR2_RASPBERRYPI_DISABLE_OVERSCAN +comment "Make display smaller to stop text spilling off the screen" + +config BR2_RASPBERRYPI_OVERSCAN_LEFT + int "Overscan left" + default 50 + help + See http://elinux.org/RPiconfig#Video_mode_options + +config BR2_RASPBERRYPI_OVERSCAN_RIGHT + int "Overscan right" + default 50 + help + See http://elinux.org/RPiconfig#Video_mode_options + +config BR2_RASPBERRYPI_OVERSCAN_TOP + int "Overscan top" + default 50 + help + See http://elinux.org/RPiconfig#Video_mode_options + +config BR2_RASPBERRYPI_OVERSCAN_BOTTOM + int "Overscan bottom" + default 50 + help + See http://elinux.org/RPiconfig#Video_mode_options + +endif + +config BR2_RASPBERRYPI_HDMI_DRIVE + int "hdmi drive" + default 2 + help + hdmi_drive chooses between HDMI and DVI modes (1 = DVI no sound, 2 = HDMI sound if supported) + See http://elinux.org/RPiconfig#Video_mode_options + +config BR2_RASPBERRYPI_HDMI_GROUP + int "hdmi group" + default 1 + help + hdmi_group defines the HDMI type (1 = CEA, 2 = DMT) + See http://elinux.org/RPiconfig#Video_mode_options + +config BR2_RASPBERRYPI_HDMI_MODE + int "hdmi mode" + default 31 + help + hdmi_mode defines screen resolution in CEA or DMT format (default 1080p 50 Hz) + See http://elinux.org/RPiconfig#Video_mode_options + comment "Kernel command line options" config BR2_RASPBERRYPI_CMDLINE string "Linux kernel command line" diff --git a/package/raspberrypi/bootloader/bootloader.mk b/package/raspberrypi/bootloader/bootloader.mk index f7c90f2b2..45e738505 100644 --- a/package/raspberrypi/bootloader/bootloader.mk +++ b/package/raspberrypi/bootloader/bootloader.mk @@ -24,8 +24,18 @@ define BOOTLOADER_INSTALL_TARGET_CMDS -if [ "$(BR2_RASPBERRYPI_DISABLE_OVERSCAN)" = "y" ]; then \ echo "disable_overscan=1" >> $(TARGET_DIR)/boot/config.txt; \ + fi + -if [ "$(BR2_RASPBERRYPI_DISABLE_OVERSCAN)" != "y" ]; then \ + echo "overscan_left=$(BR2_RASPBERRYPI_OVERSCAN_LEFT)" >> $(TARGET_DIR)/boot/config.txt; \ + echo "overscan_right=$(BR2_RASPBERRYPI_OVERSCAN_RIGHT)" >> $(TARGET_DIR)/boot/config.txt; \ + echo "overscan_top=$(BR2_RASPBERRYPI_OVERSCAN_TOP)" >> $(TARGET_DIR)/boot/config.txt; \ + echo "overscan_bottom=$(BR2_RASPBERRYPI_OVERSCAN_BOTTOM)" >> $(TARGET_DIR)/boot/config.txt; \ fi + echo "hdmi_drive=$(BR2_RASPBERRYPI_HDMI_DRIVE)" >> $(TARGET_DIR)/boot/config.txt + echo "hdmi_group="$(BR2_RASPBERRYPI_HDMI_GROUP) >> $(TARGET_DIR)/boot/config.txt + echo "hdmi_mode="$(BR2_RASPBERRYPI_HDMI_MODE) >> $(TARGET_DIR)/boot/config.txt + -if [ "$(BR2_RASPBERRYPI_DISABLE_L2CACHE)" = "y" ]; then \ echo "disable_l2cache=1" >> $(TARGET_DIR)/boot/config.txt; \ fi @@ -54,6 +64,17 @@ define BOOTLOADER_INSTALL_TARGET_CMDS echo "#fixup_file=fixup_x.dat" >> $(TARGET_DIR)/boot/config.txt echo "$(BR2_RASPBERRYPI_CMDLINE)" > $(TARGET_DIR)/boot/cmdline.txt + + # Generate minimal /etc/wpa_supplicant.conf file if necessary + -if [ "$(BR2_PACKAGE_WPA_SUPPLICANT)" = "y" ]; then \ + rm $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo "ctrl_interface=/var/run/wpa_supplicant" >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo "ap_scan=1" >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo "network={" >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo 'ssid='$(BR2_PACKAGE_WPA_SUPPLICANT_SSID) >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo 'psk='$(BR2_PACKAGE_WPA_SUPPLICANT_KEY) >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + echo "}" >> $(TARGET_DIR)/etc/wpa_supplicant.conf; \ + fi endef $(eval $(generic-package)) diff --git a/package/wiringpi/Config.in b/package/wiringpi/Config.in new file mode 100644 index 000000000..a8f1399e2 --- /dev/null +++ b/package/wiringpi/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_WIRINGPI + bool "wiringPi" + help + WiringPi is a GPIO access library written in C for the BCM2835 used in the Raspberry Pi. + + http://wiringpi.com/ diff --git a/package/wiringpi/wiringpi.mk b/package/wiringpi/wiringpi.mk new file mode 100644 index 000000000..55f499e62 --- /dev/null +++ b/package/wiringpi/wiringpi.mk @@ -0,0 +1,66 @@ +############################################################# +# +# wiringPi +# +############################################################# + +WIRINGPI_VERSION = 2.0 +WIRINGPI_SOURCE = wiringPi-02a3bd8.tar.gz +#WIRINGPI_SOURCE = wiringPi-$(WIRINGPI_VERSION).tar.gz +WIRINGPI_SITE = https://git.drogon.net/?p=wiringPi;a=snapshot;h=02a3bd8d8f2ae5c873e63875a8faef5b627f9db6;sf=tgz +WIRINGPI_LICENSE = LGPLv3 +WIRINGPI_LICENSE_FILES = COPYING +WIRINGPI_INSTALL_STAGING = YES +WIRINGPI_SITE_METHOD = wget +#WIRINGPI_CONFIG_SCRIPTS = wiringpi-config +#WIRINGPI_DEPENDENCIES = host-libaaa libbbb +TMP_BUILD = Build + +# what steps should be performed to build the package +define WIRINGPI_BUILD_CMDS + @echo "---------- Building libwiringPi ----------" + $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" -C $(@D)/wiringPi all + mkdir -p $(@D)/$(TMP_BUILD) + $(MAKE) DESTDIR="$(@D)/$(TMP_BUILD)" PREFIX="" -C $(@D)/wiringPi install + @echo "---------- Building libwiringPiDev ----------" + $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" INCLUDE="-I$(@D)/$(TMP_BUILD)/include" -C $(@D)/devLib all + $(MAKE) DESTDIR="$(@D)/$(TMP_BUILD)" PREFIX="" -C $(@D)/devLib install + @echo "---------- Building wiringPi gpio utility ----------" + $(MAKE) CC="$(TARGET_CC)" LD="$(TARGET_LD)" INCLUDE="-I$(@D)/$(TMP_BUILD)/include" LDFLAGS="-L$(@D)/$(TMP_BUILD)/lib" $(LIBS) -C $(@D)/gpio all + $(MAKE) DESTDIR="$(@D)/$(TMP_BUILD)" PREFIX="" -C $(@D)/gpio install +endef + +# what steps should be performed to install the package in the staging space +define WIRINGPI_INSTALL_STAGING_CMDS + $(INSTALL) -D -m 0755 $(@D)/$(TMP_BUILD)/lib/libwiringPi*.so.* $(STAGING_DIR)/usr/lib + $(INSTALL) -D -m 0644 $(@D)/$(TMP_BUILD)/include/*.h $(STAGING_DIR)/usr/include + $(INSTALL) -D -m 0755 $(@D)/$(TMP_BUILD)/bin/gpio $(STAGING_DIR)/usr/bin +endef + +# what steps should be performed to install the package in the target space +define WIRINGPI_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 0755 $(@D)/$(TMP_BUILD)/lib/libwiringPi*.so.* $(TARGET_DIR)/usr/lib + $(INSTALL) -D -m 0755 $(@D)/$(TMP_BUILD)/bin/gpio $(TARGET_DIR)/usr/bin +endef + +define WIRINGPI_CLEAN_CMDS + rm -rf $(@D)/$(TMP_BUILD) +endef + +# device-node file used by this package +define WIRINGPI_DEVICES +# /dev/foo c 666 0 0 42 0 - - - +endef + +# permissions to set to specific files installed by this package +define WIRINGPI_PERMISSIONS + usr/bin/gpio f 4755 0 0 - - - - - +endef + +# user that is used by this package (eg. to run a daemon as non-root) +define WIRINGPI_USERS +# foo -1 wiringpi -1 * - - - LibFoo daemon +endef + +# generates, according to the variables defined previously, all the Makefile code necessary to make your package working +$(eval $(generic-package)) diff --git a/package/wpa_supplicant/Config.in b/package/wpa_supplicant/Config.in index 8b0b36693..735ef8339 100644 --- a/package/wpa_supplicant/Config.in +++ b/package/wpa_supplicant/Config.in @@ -54,4 +54,19 @@ config BR2_PACKAGE_WPA_SUPPLICANT_WPS help Enable support for Wi-Fi Protected Setup (WPS) +comment "/etc/wpa_supplicant.conf file" + +config BR2_PACKAGE_WPA_SUPPLICANT_SSID + string "Network SSID" + default "home" + help + This is the SSID name of your network. + Check http://linux.die.net/man/5/wpa_supplicant.conf if your need more parameters. + +config BR2_PACKAGE_WPA_SUPPLICANT_KEY + string "Password" + default "my SSID WPA key" + help + This is the key. Must be between quotes if litteral or without quotes if entered as hexadecimal. + Check http://linux.die.net/man/5/wpa_supplicant.conf if your need more parameters. endif