From 612c1a73f1cb2184639163d0e37e303b70f5f7bc Mon Sep 17 00:00:00 2001 From: Teguh Sobirin Date: Sat, 16 Apr 2016 21:02:48 +0700 Subject: [PATCH 1/5] Add missing /dev/pts Missing /dev/pts causing "Can not write log, openpty() failed (/dev/pts not mounted?)" --- scripts/common | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/common b/scripts/common index 8c0e914..814f37f 100644 --- a/scripts/common +++ b/scripts/common @@ -51,6 +51,10 @@ on_chroot() { if ! mount | grep -q `realpath ${ROOTFS_DIR}/dev`; then mount --bind /dev ${ROOTFS_DIR}/dev fi + + if ! mount | grep -q `realpath ${ROOTFS_DIR}/dev/pts`; then + mount --bind /dev/pts ${ROOTFS_DIR}/dev/pts + fi if ! mount | grep -q `realpath ${ROOTFS_DIR}/sys`; then mount --bind /sys ${ROOTFS_DIR}/sys From aca321fd700deaa0ef36b03ead65661bd654f61c Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Wed, 4 May 2016 15:51:41 +0100 Subject: [PATCH 2/5] Various fixes --- .gitignore | 3 +++ build.sh | 30 +++++++++++++++++++++--------- scripts/common | 24 ++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 9f52a0f..ec91fd6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ deploy/* work/* config +SKIP +.pc +*-pc diff --git a/build.sh b/build.sh index e3f7a6e..11988a2 100755 --- a/build.sh +++ b/build.sh @@ -77,10 +77,14 @@ EOF run_stage(){ log "Begin ${STAGE_DIR}" + STAGE=$(basename ${STAGE_DIR}) pushd ${STAGE_DIR} > /dev/null unmount ${WORK_DIR}/${STAGE} STAGE_WORK_DIR=${WORK_DIR}/${STAGE} ROOTFS_DIR=${STAGE_WORK_DIR}/rootfs + if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then + EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" + fi if [ ! -f SKIP ]; then if [ "${CLEAN}" = "1" ]; then if [ -d ${ROOTFS_DIR} ]; then @@ -93,7 +97,8 @@ run_stage(){ log "End ${STAGE_DIR}/prerun.sh" fi for SUB_STAGE_DIR in ${STAGE_DIR}/*; do - if [ -d ${SUB_STAGE_DIR} ]; then + if [ -d ${SUB_STAGE_DIR} ] && + [ ! -f ${SUB_STAGE_DIR}/SKIP ]; then run_sub_stage fi done @@ -125,6 +130,7 @@ export IMG_DATE=${IMG_DATE:-"$(date -u +%Y-%m-%d)"} export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export SCRIPT_DIR="${BASE_DIR}/scripts" export WORK_DIR="${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}" +export DEPLOY_DIR="${BASE_DIR}/deploy" export LOG_FILE="${WORK_DIR}/build.log" export CLEAN @@ -132,11 +138,15 @@ export IMG_NAME export APT_PROXY export STAGE -export PREV_STAGE export STAGE_DIR +export STAGE_WORK_DIR +export PREV_STAGE export PREV_STAGE_DIR export ROOTFS_DIR export PREV_ROOTFS_DIR +export IMG_SUFFIX +export EXPORT_DIR +export EXPORT_ROOTFS_DIR export QUILT_PATCHES export QUILT_NO_DIFF_INDEX=1 @@ -144,18 +154,20 @@ export QUILT_NO_DIFF_TIMESTAMPS=1 export QUILT_REFRESH_ARGS="-p ab" source ${SCRIPT_DIR}/common -export -f log -export -f bootstrap -export -f unmount -export -f on_chroot -export -f copy_previous -export -f update_issue mkdir -p ${WORK_DIR} log "Begin ${BASE_DIR}" for STAGE_DIR in ${BASE_DIR}/stage*; do - STAGE=$(basename ${STAGE_DIR}) + run_stage +done + +STAGE_DIR=${BASE_DIR}/export-image + +CLEAN=1 +for EXPORT_DIR in ${EXPORT_DIRS}; do + IMG_SUFFIX=$(cat ${EXPORT_DIR}/EXPORT_IMAGE) + EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename ${EXPORT_DIR})/rootfs run_stage done diff --git a/scripts/common b/scripts/common index 814f37f..e2969ad 100644 --- a/scripts/common +++ b/scripts/common @@ -1,6 +1,7 @@ log (){ date +"[%T] $@" | tee -a ${LOG_FILE} } +export -f log bootstrap(){ ARCH=$(dpkg --print-architecture) @@ -18,6 +19,7 @@ bootstrap(){ --no-check-gpg \ $1 $2 $3 } +export -f bootstrap copy_previous(){ if [ ! -d ${PREV_ROOTFS_DIR} ]; then @@ -27,6 +29,7 @@ copy_previous(){ mkdir -p ${ROOTFS_DIR} rsync -aHAX ${PREV_ROOTFS_DIR}/ ${ROOTFS_DIR}/ } +export -f copy_previous unmount(){ if [ -z "$1" ]; then @@ -38,10 +41,24 @@ unmount(){ while mount | grep -q $DIR; do LOCS=`mount | grep $DIR | cut -f 3 -d ' ' | sort -r` for loc in $LOCS; do - sudo umount $loc + umount $loc done done } +export -f unmount + +unmount_image(){ + sync + sleep 1 + unmount $(dirname ${1}) + LOOP_DEV=$(losetup -j ${1} | cut -f1 -d':') + if [ -n "${LOOP_DEV}" ]; then + sleep 1 + kpartx -ds ${LOOP_DEV} + losetup -d ${LOOP_DEV} + fi +} +export -f unmount_image on_chroot() { if ! mount | grep -q `realpath ${ROOTFS_DIR}/proc`; then @@ -62,7 +79,10 @@ on_chroot() { chroot ${ROOTFS_DIR}/ "$@" } +export -f on_chroot update_issue() { - echo -e "Raspberry Pi reference ${DATE}\nGenerated using Pi-gen, https://github.com/RPi-Distro/Pi-gen, ${1}" > ${ROOTFS_DIR}/etc/rpi-issue + GIT_HASH=$(git rev-parse HEAD) + echo -e "Raspberry Pi reference ${DATE}\nGenerated using pi-gen, https://github.com/RPi-Distro/pi-gen, ${GIT_HASH}, ${1}" > ${ROOTFS_DIR}/etc/rpi-issue } +export -f update_issue From b61c63db8f86a9a75ffd42bdb869030d94612059 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 5 May 2016 14:55:53 +0100 Subject: [PATCH 3/5] common: Fix issue date --- scripts/common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common b/scripts/common index e2969ad..a9d722d 100644 --- a/scripts/common +++ b/scripts/common @@ -83,6 +83,6 @@ export -f on_chroot update_issue() { GIT_HASH=$(git rev-parse HEAD) - echo -e "Raspberry Pi reference ${DATE}\nGenerated using pi-gen, https://github.com/RPi-Distro/pi-gen, ${GIT_HASH}, ${1}" > ${ROOTFS_DIR}/etc/rpi-issue + echo -e "Raspberry Pi reference ${IMG_DATE}\nGenerated using pi-gen, https://github.com/RPi-Distro/pi-gen, ${GIT_HASH}, ${1}" > ${ROOTFS_DIR}/etc/rpi-issue } export -f update_issue From de878cc21718bade5d7dbd19d8cdfebc0176c155 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 5 May 2016 16:55:35 +0100 Subject: [PATCH 4/5] build.sh: fix patches --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 11988a2..9a889f2 100755 --- a/build.sh +++ b/build.sh @@ -43,11 +43,12 @@ EOF fi QUILT_PATCHES=${SUB_STAGE_DIR}/${i}-patches mkdir -p ${i}-pc - ln -sf .pc ${i}-pc + ln -sf ${i}-pc .pc if [ -e ${SUB_STAGE_DIR}/${i}-patches/EDIT ]; then echo "Dropping into bash to edit patches..." bash fi + quilt upgrade RC=0 quilt push -a || RC=$? case "$RC" in From bdca3e3b48e72df796ec7b1a24a26c08b2dcfa67 Mon Sep 17 00:00:00 2001 From: Serge Schneider Date: Thu, 5 May 2016 19:43:33 +0100 Subject: [PATCH 5/5] Rework --- export-image/00-allow-rerun/00-run.sh | 13 ++++ export-image/00-allow-rerun/files/policy-rc.d | 2 + .../01-set-sources/00-patches/0-sources.diff | 9 +++ export-image/01-set-sources/00-patches/series | 1 + export-image/01-set-sources/01-run.sh | 7 ++ export-image/02-network/01-run.sh | 3 + export-image/02-network/files/resolv.conf | 1 + export-image/03-finalise/01-run.sh | 34 +++++++++ export-image/03-finalise/files/LICENSE.oracle | 72 +++++++++++++++++++ export-image/prerun.sh | 48 +++++++++++++ stage1/01-sys-tweaks/00-run.sh | 4 +- stage2/01-sys-tweaks/00-packages | 1 + stage4/00-install-packages/00-packages | 7 +- stage4/02-extras/00-run.sh | 5 +- 14 files changed, 201 insertions(+), 6 deletions(-) create mode 100755 export-image/00-allow-rerun/00-run.sh create mode 100644 export-image/00-allow-rerun/files/policy-rc.d create mode 100644 export-image/01-set-sources/00-patches/0-sources.diff create mode 100644 export-image/01-set-sources/00-patches/series create mode 100755 export-image/01-set-sources/01-run.sh create mode 100755 export-image/02-network/01-run.sh create mode 100644 export-image/02-network/files/resolv.conf create mode 100755 export-image/03-finalise/01-run.sh create mode 100644 export-image/03-finalise/files/LICENSE.oracle create mode 100755 export-image/prerun.sh diff --git a/export-image/00-allow-rerun/00-run.sh b/export-image/00-allow-rerun/00-run.sh new file mode 100755 index 0000000..1355b2e --- /dev/null +++ b/export-image/00-allow-rerun/00-run.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e + +if [ -e ${ROOTFS_DIR}/etc/ld.so.preload ]; then + mv ${ROOTFS_DIR}/etc/ld.so.preload ${ROOTFS_DIR}/etc/ld.so.preload.disabled +fi + +if [ ! -e ${ROOTFS_DIR}/usr/sbin/policy-rc.d ]; then + install -m 744 files/policy-rc.d ${ROOTFS_DIR}/usr/sbin/ +fi + +if [ ! -x ${ROOTFS_DIR}/usr/bin/qemu-arm-static ]; then + cp /usr/bin/qemu-arm-static ${ROOTFS_DIR}/usr/bin/ +fi diff --git a/export-image/00-allow-rerun/files/policy-rc.d b/export-image/00-allow-rerun/files/policy-rc.d new file mode 100644 index 0000000..0b1556d --- /dev/null +++ b/export-image/00-allow-rerun/files/policy-rc.d @@ -0,0 +1,2 @@ +#!/bin/sh +exit 101 diff --git a/export-image/01-set-sources/00-patches/0-sources.diff b/export-image/01-set-sources/00-patches/0-sources.diff new file mode 100644 index 0000000..d46afe6 --- /dev/null +++ b/export-image/01-set-sources/00-patches/0-sources.diff @@ -0,0 +1,9 @@ +Index: export-jessie/rootfs/etc/apt/sources.list.d/raspi.list +=================================================================== +--- export-jessie.orig/rootfs/etc/apt/sources.list.d/raspi.list ++++ export-jessie/rootfs/etc/apt/sources.list.d/raspi.list +@@ -1,3 +1,3 @@ +-deb http://archive.raspberrypi.org/debian/ jessie main ui staging ++deb http://archive.raspberrypi.org/debian/ jessie main ui + # Uncomment line below then 'apt-get update' to enable 'apt-get source' + #deb-src http://archive.raspberrypi.org/debian/ jessie main ui diff --git a/export-image/01-set-sources/00-patches/series b/export-image/01-set-sources/00-patches/series new file mode 100644 index 0000000..49ccdbc --- /dev/null +++ b/export-image/01-set-sources/00-patches/series @@ -0,0 +1 @@ +0-sources.diff diff --git a/export-image/01-set-sources/01-run.sh b/export-image/01-set-sources/01-run.sh new file mode 100755 index 0000000..638b581 --- /dev/null +++ b/export-image/01-set-sources/01-run.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e + +on_chroot sh -e - < /dev/null +zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip $(basename ${IMG_FILE}) +popd > /dev/null diff --git a/export-image/03-finalise/files/LICENSE.oracle b/export-image/03-finalise/files/LICENSE.oracle new file mode 100644 index 0000000..00898ca --- /dev/null +++ b/export-image/03-finalise/files/LICENSE.oracle @@ -0,0 +1,72 @@ +Taken from http://www.java.com/license + +Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX + +ORACLE AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO LICENSE THE SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE AGREEMENT CAREFULLY. BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM. IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED. + +1. DEFINITIONS. "Software" means the software identified above in binary form that you selected for download, install or use (in the version You selected for download, install or use) from Oracle or its authorized licensees, any other machine readable materials (including, but not limited to, libraries, source files, header files, and data files), any updates or error corrections provided by Oracle, and any user manuals, programming guides and other documentation provided to you by Oracle under this Agreement. "General Purpose Desktop Computers and Servers" means computers, including desktop and laptop computers, or servers, used for general computing functions under end user control (such as but not specifically limited to email, general purpose Internet browsing, and office suite productivity tools). The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this Agreement. "Programs" means (a) Java technology applets and applications intended to run on the Java Platform, Standard Edition platform on Java-enabled General Purpose Desktop Computers and Servers; and (b) JavaFX technology applications intended to run on the JavaFX Runtime on JavaFX-enabled General Purpose Desktop Computers and Servers. “Commercial Features” means those features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. “README File” means the README file for the Software accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. + +2. LICENSE TO USE. Subject to the terms and conditions of this Agreement including, but not limited to, the Java Technology Restrictions of the Supplemental License Terms, Oracle grants you a non-exclusive, non-transferable, limited license without license fees to reproduce and use internally the Software complete and unmodified for the sole purpose of running Programs. THE LICENSE SET FORTH IN THIS SECTION 2 DOES NOT EXTEND TO THE COMMERCIAL FEATURES. YOUR RIGHTS AND OBLIGATIONS RELATED TO THE COMMERCIAL FEATURES ARE AS SET FORTH IN THE SUPPLEMENTAL TERMS ALONG WITH ADDITIONAL LICENSES FOR DEVELOPERS AND PUBLISHERS. + +3. RESTRICTIONS. Software is copyrighted. Title to Software and all associated intellectual property rights is retained by Oracle and/or its licensors. Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software. You acknowledge that the Software is developed for general use in a variety of information management applications; it is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use the Software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle disclaims any express or implied warranty of fitness for such uses. No right, title or interest in or to any trademark, service mark, logo or trade name of Oracle or its licensors is granted under this Agreement. Additional restrictions for developers and/or publishers licenses are set forth in the Supplemental License Terms. + +4. DISCLAIMER OF WARRANTY. THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. + +5. LIMITATION OF LIABILITY. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ORACLE'S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE THOUSAND DOLLARS (U.S. $1,000). + +6. TERMINATION. This Agreement is effective until terminated. You may terminate this Agreement at any time by destroying all copies of Software. This Agreement will terminate immediately without notice from Oracle if you fail to comply with any provision of this Agreement. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. Upon termination, you must destroy all copies of Software. + +7. EXPORT REGULATIONS. You agree that U.S. export control laws and other applicable export and import laws govern your use of the Software, including technical data; additional information can be found on Oracle's Global Trade Compliance web site (http://www.oracle.com/products/export). You agree that neither the Software nor any direct product thereof will be exported, directly, or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation. + +8. TRADEMARKS AND LOGOS. You acknowledge and agree as between you +and Oracle that Oracle owns the ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand +designations ("Oracle Marks"), and you agree to comply with the Third +Party Usage Guidelines for Oracle Trademarks currently located at +http://www.oracle.com/us/legal/third-party-trademarks/index.html . Any use you make of the Oracle Marks inures to Oracle's benefit. + +9. U.S. GOVERNMENT LICENSE RIGHTS. If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation shall be only those set forth in this Agreement. + +10. GOVERNING LAW. This agreement is governed by the substantive and procedural laws of California. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco, or Santa Clara counties in California in any dispute arising out of or relating to this agreement. + +11. SEVERABILITY. If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate. + +12. INTEGRATION. This Agreement is the entire agreement between you and Oracle relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party. + +SUPPLEMENTAL LICENSE TERMS + +These Supplemental License Terms add to or modify the terms of the Binary Code License Agreement. Capitalized terms not defined in these Supplemental Terms shall have the same meanings ascribed to them in the Binary Code License Agreement. These Supplemental Terms shall supersede any inconsistent or conflicting terms in the Binary Code License Agreement, or in any license contained within the Software. + +A. COMMERCIAL FEATURES. You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production purpose, or for any purpose other than as set forth in Sections B, C, D and E of these Supplemental Terms. If You want to use the Commercial Features for any purpose other than as permitted in this Agreement, You must obtain a separate license from Oracle. + +B. SOFTWARE INTERNAL USE FOR DEVELOPMENT LICENSE GRANT. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File incorporated herein by reference, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce internally and use internally the Software complete and unmodified for the purpose of designing, developing, and testing your Programs. + +C. LICENSE TO DISTRIBUTE SOFTWARE. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including, but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the Software, provided that (i) you distribute the Software complete and unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality to the Software, (iii) you do not distribute additional software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in this Agreement and that includes the notice set forth in Section H, and (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section C does not extend to the Software identified in Section G. + +D. LICENSE TO DISTRIBUTE REDISTRIBUTABLES. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File, including but not limited to the Java Technology Restrictions and Limitations on Redistribution of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute those files specifically identified as redistributable in the README File ("Redistributables") provided that: (i) you distribute the Redistributables complete and unmodified, and only bundled as part of Programs, (ii) the Programs add significant and primary functionality to the Redistributables, (iii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README File), (iv) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, (v) you only distribute the Redistributables pursuant to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in the Agreement and includes the notice set forth in Section H, (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software. The license set forth in this Section D does not extend to the Software identified in Section G. + +E. DISTRIBUTION BY PUBLISHERS. This section pertains to your distribution of the JavaTM SE Development Kit Software (“JDK”) with your printed book or magazine (as those terms are commonly used in the industry) relating to Java technology ("Publication"). Subject to and conditioned upon your compliance with the restrictions and obligations contained in the Agreement, Oracle hereby grants to you a non-exclusive, nontransferable limited right to reproduce complete and unmodified copies of the JDK on electronic media (the "Media") for the sole purpose of inclusion and distribution with your Publication(s), subject to the following terms: (i) You may not distribute the JDK on a stand-alone basis; it must be distributed with your Publication(s); (ii) You are responsible for downloading the JDK from the applicable Oracle web site; (iii) You must refer to the JDK as JavaTM SE Development Kit; (iv) The JDK must be reproduced in its entirety and without any modification whatsoever (including with respect to all proprietary notices) and distributed with your Publication subject to a license agreement that is a complete, unmodified reproduction of this Agreement; (v) The Media label shall include the following information: “Copyright [YEAR], Oracle America, Inc. All rights reserved. Use is subject to license terms. ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand designations are trademarks or registered trademarks of Oracle in the U.S. and other countries.” [YEAR] is the year of Oracle's release of the Software; the year information can typically be found in the Software’s “About” box or screen. This information must be placed on the Media label in such a manner as to only apply to the JDK; (vi) You must clearly identify the JDK as Oracle's product on the Media holder or Media label, and you may not state or imply that Oracle is responsible for any third-party software contained on the Media; (vii) You may not include any third party software on the Media which is intended to be a replacement or substitute for the JDK; (viii) You agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of the JDK and/or the Publication; ; and (ix) You shall provide Oracle with a written notice for each Publication; such notice shall include the following information: (1) title of Publication, (2) author(s), (3) date of Publication, and (4) ISBN or ISSN numbers. Such notice shall be sent to Oracle America, Inc., 500 Oracle Parkway, Redwood Shores, California 94065 U.S.A , Attention: General Counsel. + +F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation. + +G. LIMITATIONS ON REDISTRIBUTION. You may not redistribute or otherwise transfer patches, bug fixes or updates made available by Oracle through Oracle Premier Support, including those made available under Oracle's Java SE Support program. + +H. COMMERCIAL FEATURES NOTICE. For purpose of complying with Supplemental Term Section C.(v)(b) and D.(v)(b), your license agreement shall include the following notice, where the notice is displayed in a manner that anyone using the Software will see the notice: + +Use of the Commercial Features for any commercial or production purpose requires a separate license from Oracle. “Commercial Features” means those features identified Table 1-1 (Commercial Features In Java SE Product Editions) of the Java SE documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html + + + +I. SOURCE CODE. Software may contain source code that, unless expressly licensed for other purposes, is provided solely for reference purposes pursuant to the terms of this Agreement. Source code may not be redistributed unless expressly provided for in this Agreement. + +J. THIRD PARTY CODE. Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME file accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html. In addition to any terms and conditions of any third party opensource/freeware license identified in the THIRDPARTYLICENSEREADME file, the disclaimer of warranty and limitation of liability provisions in paragraphs 4 and 5 of the Binary Code License Agreement shall apply to all Software in this distribution. + +K. TERMINATION FOR INFRINGEMENT. Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right. + +L. INSTALLATION AND AUTO-UPDATE. The Software's installation and auto-update processes transmit a limited amount of data to Oracle (or its service provider) about those specific processes to help Oracle understand and optimize them. Oracle does not associate the data with personally identifiable information. You can find more information about the data Oracle collects as a result of your Software download at http://www.oracle.com/technetwork/java/javase/documentation/index.html. + +For inquiries please contact: Oracle America, Inc., 500 Oracle Parkway, + +Redwood Shores, California 94065, USA. + +Last updated 02 April 2013 + diff --git a/export-image/prerun.sh b/export-image/prerun.sh new file mode 100755 index 0000000..aaf9bfa --- /dev/null +++ b/export-image/prerun.sh @@ -0,0 +1,48 @@ +#!/bin/bash -e +IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img" + +unmount_image ${IMG_FILE} + +rm -f ${IMG_FILE} + +rm -rf ${ROOTFS_DIR} +mkdir -p ${ROOTFS_DIR} + +BOOT_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR}/boot -B M | cut -f 1 | tr -d M) +TOTAL_SIZE=$(du -sh ${EXPORT_ROOTFS_DIR} -B M | cut -f 1 | tr -d M) + +IMG_SIZE=$(expr $BOOT_SIZE \* 2 \+ $TOTAL_SIZE \+ 512)M + +fallocate -l ${IMG_SIZE} ${IMG_FILE} +fdisk ${IMG_FILE} > /dev/null 2>&1 < /dev/null +mkfs.ext4 -O ^huge_file $ROOT_DEV > /dev/null + +mount -v $ROOT_DEV ${ROOTFS_DIR} -t ext4 +mkdir -p ${ROOTFS_DIR}/boot +mount -v $BOOT_DEV ${ROOTFS_DIR}/boot -t vfat + +rsync ${EXPORT_ROOTFS_DIR}/ ${ROOTFS_DIR}/ -aHAX diff --git a/stage1/01-sys-tweaks/00-run.sh b/stage1/01-sys-tweaks/00-run.sh index 5c6ce7e..d710e5b 100755 --- a/stage1/01-sys-tweaks/00-run.sh +++ b/stage1/01-sys-tweaks/00-run.sh @@ -2,8 +2,8 @@ install -d ${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d install -m 644 files/noclear.conf ${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/noclear.conf -install -m 744 files/policy-rc.d ${ROOTFS_DIR}/usr/sbin/policy-rc.d -#install -v -m 644 files/fstab ${ROOTFS_DIR}/etc/fstab TODO: Necessary in systemd? +install -m 744 files/policy-rc.d ${ROOTFS_DIR}/usr/sbin/policy-rc.d #TODO: Necessary in systemd? +install -v -m 644 files/fstab ${ROOTFS_DIR}/etc/fstab on_chroot sh -e - </dev/null 2>&1; then diff --git a/stage2/01-sys-tweaks/00-packages b/stage2/01-sys-tweaks/00-packages index 583a936..60e6c30 100644 --- a/stage2/01-sys-tweaks/00-packages +++ b/stage2/01-sys-tweaks/00-packages @@ -13,3 +13,4 @@ dphys-swapfile raspberrypi-sys-mods pi-bluetooth apt-listchanges +usb-modeswitch diff --git a/stage4/00-install-packages/00-packages b/stage4/00-install-packages/00-packages index f8b3ea4..950e320 100644 --- a/stage4/00-install-packages/00-packages +++ b/stage4/00-install-packages/00-packages @@ -3,7 +3,6 @@ libreoffice-sdbc-hsqldb sonic-pi python idle python3-pygame python-pygame python-tk python3 idle3 python3-tk -python3-rpi.gpio python3-pgzero python-serial python3-serial python-picamera python3-picamera @@ -22,6 +21,8 @@ tree scratch nuscratch greenfoot bluej nodered -python-gpiozero python3-gpiozero -raspi-gpio libgl1-mesa-dri libgles1-mesa libgles2-mesa xcompmgr +geany +piclone +pulseaudio-module-bluetooth +wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio diff --git a/stage4/02-extras/00-run.sh b/stage4/02-extras/00-run.sh index a4a64ab..74c9d9e 100755 --- a/stage4/02-extras/00-run.sh +++ b/stage4/02-extras/00-run.sh @@ -1,7 +1,10 @@ #!/bin/bash -e HASH=`wget https://api.github.com/repos/KenT2/python-games/git/refs/heads/master -qO -| grep \"sha\" | cut -f 2 -d ':' | cut -f 2 -d \"` -HASH_LOCAL=`cat files/python_games.hash` + +if [ -f files/python_games.hash ]; then + HASH_LOCAL=`cat files/python_games.hash` +fi if [ ! -e files/python_games.tar.gz ] || [ "$HASH" != "$HASH_LOCAL" ]; then wget "https://github.com/KenT2/python-games/tarball/master" -O files/python_games.tar.gz