Merged updates from upstream

This commit is contained in:
Charles Cross 2016-05-05 15:32:31 -07:00
commit b5c577fcdf
16 changed files with 332 additions and 12 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
deploy/* deploy/*
work/* work/*
.vscode/* .vscode/*
config
SKIP
.pc
*-pc

View File

@ -58,11 +58,12 @@ EOF
fi fi
QUILT_PATCHES=${SUB_STAGE_DIR}/${i}-patches QUILT_PATCHES=${SUB_STAGE_DIR}/${i}-patches
mkdir -p ${i}-pc mkdir -p ${i}-pc
ln -sf .pc ${i}-pc ln -sf ${i}-pc .pc
if [ -e ${SUB_STAGE_DIR}/${i}-patches/EDIT ]; then if [ -e ${SUB_STAGE_DIR}/${i}-patches/EDIT ]; then
echo "Dropping into bash to edit patches..." echo "Dropping into bash to edit patches..."
bash bash
fi fi
quilt upgrade
RC=0 RC=0
quilt push -a || RC=$? quilt push -a || RC=$?
case "$RC" in case "$RC" in
@ -96,6 +97,8 @@ EOF
run_stage(){ run_stage(){
log "Begin ${STAGE_DIR}" log "Begin ${STAGE_DIR}"
STAGE=$(basename ${STAGE_DIR})
pushd ${STAGE_DIR} > /dev/null pushd ${STAGE_DIR} > /dev/null
@ -107,6 +110,10 @@ run_stage(){
# Set the root directory for this stage # Set the root directory for this stage
ROOTFS_DIR=${STAGE_WORK_DIR}/rootfs ROOTFS_DIR=${STAGE_WORK_DIR}/rootfs
if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then
EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}"
fi
# Check to see if we should skip this stage (seemingly never) # Check to see if we should skip this stage (seemingly never)
if [ ! -f SKIP ]; then if [ ! -f SKIP ]; then
@ -127,7 +134,8 @@ run_stage(){
# For each substage, run the run_sub_stage command for it # For each substage, run the run_sub_stage command for it
for SUB_STAGE_DIR in ${STAGE_DIR}/*; do 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 run_sub_stage
fi fi
done done
@ -229,18 +237,27 @@ export IMG_NAME
export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SCRIPT_DIR="${BASE_DIR}/scripts" export SCRIPT_DIR="${BASE_DIR}/scripts"
<<<<<<< HEAD
export WORK_DIR="${BASE_DIR}/work/${IMG_NAME}" export WORK_DIR="${BASE_DIR}/work/${IMG_NAME}"
=======
export WORK_DIR="${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"
export DEPLOY_DIR="${BASE_DIR}/deploy"
>>>>>>> bdca3e3b48e72df796ec7b1a24a26c08b2dcfa67
export LOG_FILE="${WORK_DIR}/build.log" export LOG_FILE="${WORK_DIR}/build.log"
export CLEAN export CLEAN
export APT_PROXY export APT_PROXY
export STAGE export STAGE
export PREV_STAGE
export STAGE_DIR export STAGE_DIR
export STAGE_WORK_DIR
export PREV_STAGE
export PREV_STAGE_DIR export PREV_STAGE_DIR
export ROOTFS_DIR export ROOTFS_DIR
export PREV_ROOTFS_DIR export PREV_ROOTFS_DIR
export IMG_SUFFIX
export EXPORT_DIR
export EXPORT_ROOTFS_DIR
export QUILT_PATCHES export QUILT_PATCHES
export QUILT_NO_DIFF_INDEX=1 export QUILT_NO_DIFF_INDEX=1
@ -248,12 +265,6 @@ export QUILT_NO_DIFF_TIMESTAMPS=1
export QUILT_REFRESH_ARGS="-p ab" export QUILT_REFRESH_ARGS="-p ab"
source ${SCRIPT_DIR}/common 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
# Create working directory # Create working directory
mkdir -p ${WORK_DIR} mkdir -p ${WORK_DIR}
@ -261,7 +272,15 @@ log "Begin ${BASE_DIR}"
# Successively build each stage # Successively build each stage
for STAGE_DIR in ${BASE_DIR}/stage*; do 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 run_stage
done done

View File

@ -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

View File

@ -0,0 +1,2 @@
#!/bin/sh
exit 101

View File

@ -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

View File

@ -0,0 +1 @@
0-sources.diff

View File

@ -0,0 +1,7 @@
#!/bin/bash -e
on_chroot sh -e - <<EOF
apt-get update
apt-get -y dist-upgrade
apt-get clean
EOF

View File

@ -0,0 +1,3 @@
#/bin/bash -e
install -m 644 files/resolv.conf ${ROOTFS_DIR}/etc/

View File

@ -0,0 +1 @@
nameserver 8.8.8.8

View File

@ -0,0 +1,34 @@
#!/bin/bash -e
IMG_FILE="${STAGE_WORK_DIR}/${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.img"
on_chroot sh -e - <<EOF
/etc/init.d/fake-hwclock stop
EOF
rm -f ${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache
rm -f ${ROOTFS_DIR}/usr/sbin/policy-rc.d
rm -f ${ROOTFS_DIR}/usr/bin/qemu-arm-static
if [ -e ${ROOTFS_DIR}/etc/ld.so.preload.disabled ]; then
mv ${ROOTFS_DIR}/etc/ld.so.preload.disabled ${ROOTFS_DIR}/etc/ld.so.preload
fi
update_issue $(basename ${EXPORT_DIR})
install -m 644 ${ROOTFS_DIR}/etc/rpi-issue ${ROOTFS_DIR}/boot/issue.txt
install files/LICENSE.oracle ${ROOTFS_DIR}/boot/
ROOT_DEV=$(mount | grep "${ROOTFS_DIR} " | cut -f1 -d' ')
unmount ${ROOTFS_DIR}
zerofree -v ${ROOT_DEV}
unmount_image ${IMG_FILE}
mkdir -p ${DEPLOY_DIR}
rm -f ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip
echo zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip ${IMG_FILE}
pushd ${STAGE_WORK_DIR} > /dev/null
zip ${DEPLOY_DIR}/image_${IMG_DATE}-${IMG_NAME}${IMG_SUFFIX}.zip $(basename ${IMG_FILE})
popd > /dev/null

View File

@ -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 Softwares “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

48
export-image/prerun.sh Executable file
View File

@ -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 <<EOF
o
n
8192
+`expr $BOOT_SIZE \* 3`M
p
t
c
n
8192
p
w
EOF
LOOP_DEV=`kpartx -asv ${IMG_FILE} | grep -E -o -m1 'loop[[:digit:]]+' | head -n 1`
BOOT_DEV=/dev/mapper/${LOOP_DEV}p1
ROOT_DEV=/dev/mapper/${LOOP_DEV}p2
mkdosfs -n boot -S 512 -s 16 -v $BOOT_DEV > /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

View File

@ -1,6 +1,7 @@
log (){ log (){
date +"[%T] $@" | tee -a ${LOG_FILE} date +"[%T] $@" | tee -a ${LOG_FILE}
} }
export -f log
bootstrap(){ bootstrap(){
ARCH=$(dpkg --print-architecture) ARCH=$(dpkg --print-architecture)
@ -18,6 +19,7 @@ bootstrap(){
--no-check-gpg \ --no-check-gpg \
$1 $2 $3 $1 $2 $3
} }
export -f bootstrap
copy_previous(){ copy_previous(){
if [ ! -d ${PREV_ROOTFS_DIR} ]; then if [ ! -d ${PREV_ROOTFS_DIR} ]; then
@ -27,6 +29,7 @@ copy_previous(){
mkdir -p ${ROOTFS_DIR} mkdir -p ${ROOTFS_DIR}
rsync -aHAX ${PREV_ROOTFS_DIR}/ ${ROOTFS_DIR}/ rsync -aHAX ${PREV_ROOTFS_DIR}/ ${ROOTFS_DIR}/
} }
export -f copy_previous
unmount(){ unmount(){
if [ -z "$1" ]; then if [ -z "$1" ]; then
@ -38,10 +41,24 @@ unmount(){
while mount | grep -q $DIR; do while mount | grep -q $DIR; do
LOCS=`mount | grep $DIR | cut -f 3 -d ' ' | sort -r` LOCS=`mount | grep $DIR | cut -f 3 -d ' ' | sort -r`
for loc in $LOCS; do for loc in $LOCS; do
sudo umount $loc umount $loc
done done
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() { on_chroot() {
if ! mount | grep -q `realpath ${ROOTFS_DIR}/proc`; then if ! mount | grep -q `realpath ${ROOTFS_DIR}/proc`; then
@ -62,6 +79,7 @@ on_chroot() {
chroot ${ROOTFS_DIR}/ "$@" chroot ${ROOTFS_DIR}/ "$@"
} }
export -f on_chroot
# This should be used if building on a system that uses systemd (?) # This should be used if building on a system that uses systemd (?)
on_chroot2() { on_chroot2() {
@ -69,5 +87,7 @@ on_chroot2() {
} }
update_issue() { 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 ${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

View File

@ -40,3 +40,4 @@ dphys-swapfile
raspberrypi-sys-mods raspberrypi-sys-mods
pi-bluetooth pi-bluetooth
apt-listchanges apt-listchanges
usb-modeswitch

View File

@ -0,0 +1,28 @@
java-common oracle-java8-jdk
libreoffice-sdbc-hsqldb
sonic-pi
python idle python3-pygame python-pygame python-tk
python3 idle3 python3-tk
python3-pgzero
python-serial python3-serial
python-picamera python3-picamera
debian-reference-en dillo x2x
wolfram-engine
raspberrypi-net-mods raspberrypi-ui-mods
smartsim penguinspuzzle
python-pip python3-pip
python3-numpy
pypy
python3-pifacecommon python3-pifacedigitalio python3-pifacedigital-scratch-handler python-pifacecommon python-pifacedigitalio
minecraft-pi python-minecraftpi
alacarte rc-gui sense-hat
claws-mail
tree
scratch nuscratch
greenfoot bluej
nodered
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

57
stage4/02-extras/00-run.sh Executable file
View File

@ -0,0 +1,57 @@
#!/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 \"`
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
echo $HASH > files/python_games.hash
fi
ln -sf pip3 ${ROOTFS_DIR}/usr/bin/pip-3.2
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/python_games
tar xvf files/python_games.tar.gz -C ${ROOTFS_DIR}/home/pi/python_games --strip-components=1
chown 1000:1000 ${ROOTFS_DIR}/home/pi/python_games -Rv
chmod +x ${ROOTFS_DIR}/home/pi/python_games/launcher.sh
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/pi/.local/share/applications"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/BlueJ/ "${ROOTFS_DIR}/home/pi/Documents/BlueJ Projects"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/doc/Greenfoot/ "${ROOTFS_DIR}/home/pi/Documents/Greenfoot Projects"
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/scratch/Projects/Demos/ "${ROOTFS_DIR}/home/pi/Documents/Scratch Projects"
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/pcmanfm
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/openbox
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/lxsession
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.themes
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/gtk-3.0
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/.config/lxpanel
install -v -o 1000 -g 1000 -d ${ROOTFS_DIR}/home/pi/Desktop
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/pcmanfm/LXDE-pi/pcmanfm.conf ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/pcmanfm/LXDE-pi/desktop-items-0.conf ${ROOTFS_DIR}/home/pi/.config/pcmanfm/LXDE-pi/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/openbox/lxde-pi-rc.xml ${ROOTFS_DIR}/home/pi/.config/openbox/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/etc/xdg/lxsession/LXDE-pi ${ROOTFS_DIR}/home/pi/.config/lxsession/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/usr/share/themes/PiX ${ROOTFS_DIR}/home/pi/.themes/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/usr/share/raspi-ui-overrides/gtk.css ${ROOTFS_DIR}/home/pi/.config/gtk-3.0/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/usr/share/raspi-ui-overrides/Trolltech.conf ${ROOTFS_DIR}/home/pi/.config/
install -v -m 644 -o 1000 -g 1000 ${ROOTFS_DIR}/etc/xdg/lxpanel/launchtaskbar.cfg ${ROOTFS_DIR}/home/pi/.config/lxpanel/
rsync -a --chown=1000:1000 ${ROOTFS_DIR}/etc/xdg/lxpanel/profile/LXDE-pi ${ROOTFS_DIR}/home/pi/.config/lxpanel/