Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solution: regenerate
- Loading branch information
Showing
12 changed files
with
402 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
libzmq | ||
raspbian-boot | ||
raspbian-root | ||
tmp/ | ||
tools/ | ||
|
||
*.img | ||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Raspberry Pi | ||
|
||
Cross compile environment for the Raspberry Pi (all models) | ||
|
||
## Cross compile for Raspbian | ||
|
||
Simply run | ||
|
||
./build.sh | ||
|
||
Once the build script finishes the installation data is located at `tmp/`. | ||
To copy those files to your Raspberry Pi you can use `rsync`. Therefore | ||
you'll have to make sure rsync is installed on the Raspberry Pi | ||
|
||
apt-get install rsync | ||
|
||
Next make sure your Pi user has sufficient access rights to copy data to | ||
`/usr/local`. To force this you can use the following command to change | ||
the ownership of the directory accordingly. | ||
|
||
chown -R root:users /usr/local/ | ||
|
||
And finally sync your libraries to the Pi | ||
|
||
rsync -avz tmp/ <pi-user>@<pi-ip>:/usr/local | ||
|
||
The first time you install a library onto the Raspberry Pi you'll need to run | ||
|
||
sudo ldconfig | ||
|
||
## Cross compile and install to Raspbian image | ||
|
||
This requires sudo access rights on your local maschine. Also make sure | ||
you have `kpartx`, `qemu-user` and `proot` installed. | ||
|
||
To cross compile and install this project to an raspbian image run | ||
|
||
./build_image.sh | ||
|
||
This script will download the latest Raspbian image extend it so we can install | ||
software into it and finally copy the cross compiled stuff to it. Once it's done | ||
simple copy the image to a SD card and plug it into your Raspberry Pi. | ||
|
||
``` | ||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#!/usr/bin/env bash | ||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ | ||
|
||
# Download cross compiler and sysroot | ||
if [ ! -d $PWD/tools ]; then | ||
git clone --depth 1 https://github.com/raspberrypi/tools | ||
else | ||
( cd tools && git pull --rebase --quiet ) || exit 1 | ||
fi | ||
|
||
# Cross build for the Raspberry Pi | ||
mkdir -p $PWD/tmp | ||
BUILD_PREFIX=$PWD/tmp | ||
TOOLCHAIN_HOST="arm-linux-gnueabihf" | ||
TOOLCHAIN_PATH="${PWD}/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin" | ||
SYSROOT=$PWD/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/arm-linux-gnueabihf/sysroot | ||
|
||
CFLAGS="--sysroot=${SYSROOT} -I${BUILD_PREFIX}/include" | ||
CPPFLAGS="--sysroot=${SYSROOT} -I${BUILD_PREFIX}/include" | ||
CXXFLAGS="--sysroot=${SYSROOT} -I${BUILD_PREFIX}/include" | ||
LDFLAGS="-L${BUILD_PREFIX}/lib" | ||
|
||
CONFIG_OPTS=() | ||
CONFIG_OPTS+=("CFLAGS=${CFLAGS}") | ||
CONFIG_OPTS+=("CPPFLAGS=${CPPFLAGS}") | ||
CONFIG_OPTS+=("CXXFLAGS=${CXXFLAGS}") | ||
CONFIG_OPTS+=("LDFLAGS=${LDFLAGS}") | ||
CONFIG_OPTS+=("PKG_CONFIG_DIR=") | ||
CONFIG_OPTS+=("PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/share/pkgconfig") | ||
CONFIG_OPTS+=("PKG_CONFIG_SYSROOT=${SYSROOT}") | ||
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig") | ||
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}") | ||
CONFIG_OPTS+=("--host=${TOOLCHAIN_HOST}") | ||
CONFIG_OPTS+=("--with-docs=no") | ||
|
||
CPP="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-cpp" | ||
CC="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-gcc" | ||
CXX="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-g++" | ||
LD="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ld" | ||
AS="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-as" | ||
AR="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ar" | ||
RANLIB="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ranlib" | ||
|
||
CONFIG_OPTS+=("CPP=${CPP}") | ||
CONFIG_OPTS+=("CC=${CC}") | ||
CONFIG_OPTS+=("CXX=${CXX}") | ||
CONFIG_OPTS+=("LD=${LD}") | ||
CONFIG_OPTS+=("AS=${AS}") | ||
CONFIG_OPTS+=("AR=${AR}") | ||
CONFIG_OPTS+=("RANLIB=${RANLIB}") | ||
|
||
# Clone and build dependencies | ||
if [ ! -e libzmq ]; then | ||
git clone --quiet --depth 1 https://github.com/zeromq/libzmq libzmq | ||
fi | ||
pushd libzmq | ||
( | ||
git --no-pager log --oneline -n1 | ||
if [ -e autogen.sh ]; then | ||
./autogen.sh 2> /dev/null | ||
fi | ||
if [ -e buildconf ]; then | ||
./buildconf 2> /dev/null | ||
fi | ||
./configure "${CONFIG_OPTS[@]}" | ||
make -j4 | ||
make install | ||
) || exit 1 | ||
popd | ||
|
||
|
||
# Cross build this project | ||
pushd ../.. | ||
( | ||
./autogen.sh 2> /dev/null | ||
./configure --enable-drafts=yes "${CONFIG_OPTS[@]}" | ||
make -j4 | ||
make install | ||
) || exit 1 | ||
popd | ||
|
||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ | ||
|
||
# Cross compile this project and its dependencies | ||
./build.sh | ||
|
||
# Get the latest Raspbian image and enlarge it so there is enough space to | ||
# install to it. | ||
sudo ./prepare_img.sh | ||
|
||
# Sync with image | ||
sudo rsync -avz --no-p --no-g --chmod=ugo=rwX tmp/ raspbian-root/usr | ||
sudo proot -Q qemu-arm -B -r raspbian-root -b raspbian-boot:/boot sudo ldconfig | ||
|
||
# Umount image | ||
sync; sudo umount ./raspbian-boot ./raspbian-root | ||
# Make sure all allocated loop devices are free'd | ||
for i in {0..7}; | ||
do | ||
sudo sudo dmsetup clear loop${i}p1 && | ||
sudo sudo dmsetup clear loop${i}p2 && | ||
sudo sudo dmsetup remove loop${i}p1 && | ||
sudo sudo dmsetup remove loop${i}p2 && | ||
sudo sudo losetup -d /dev/loop$i | ||
done | ||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/usr/bin/env bash | ||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ | ||
|
||
if [ ! -f $PWD/raspbian_lite_latest.zip ]; then | ||
wget --connect-timeout=10 https://downloads.raspberrypi.org/raspbian_lite_latest -O raspbian_lite_latest.zip | ||
fi | ||
|
||
RASPBIAN_IMG=$(unzip -Z1 raspbian_lite_latest.zip) | ||
if [ ! -f $PWD/$RASPBIAN_IMG ]; then | ||
unzip raspbian_lite_latest.zip | ||
fi | ||
|
||
if [ ! -f $PWD/raspbian_czmq.img ]; then | ||
|
||
# Allocate disk space for extended image | ||
truncate -s 1536M raspbian_czmq.img | ||
|
||
# Begin partitioning disk image. | ||
# Creating two partitions: | ||
# BOOT = 100 MB | ||
# ROOT = 1536 MB | ||
fdisk raspbian_czmq.img <<EOF | ||
o | ||
n | ||
p | ||
1 | ||
+100M | ||
t | ||
c | ||
n | ||
p | ||
2 | ||
w | ||
EOF | ||
|
||
# Create a loop device and mount the extended image's partitions | ||
export LOOPDEV_EX="$(losetup --show --find raspbian_czmq.img)" | ||
|
||
# Use sudo kpartx to create partitions in /dev/mapper | ||
kpartx -av $LOOPDEV_EX | ||
dmsetup --noudevsync mknodes | ||
|
||
# Create partition names to mount | ||
export BOOTPARTION_EX=$(echo $LOOPDEV_EX | sed 's|'/dev'/|'/dev/mapper/'|')p1 | ||
export ROOTPARTION_EX=$(echo $LOOPDEV_EX | sed 's|'/dev'/|'/dev/mapper/'|')p2 | ||
|
||
# Create file systems for the partitions | ||
mkfs.vfat $BOOTPARTION_EX | ||
mkfs.ext4 $ROOTPARTION_EX | ||
|
||
# Create a loop device and mount the original image's partitions | ||
export LOOPDEV_ORIG="$(losetup --show --find $RASPBIAN_IMG)" | ||
|
||
# Use sudo kpartx to create partitions in /dev/mapper | ||
kpartx -av $LOOPDEV_ORIG | ||
dmsetup --noudevsync mknodes | ||
|
||
# Create partition names to mount | ||
export BOOTPARTION_ORIG=$(echo $LOOPDEV_ORIG | sed 's|'/dev'/|'/dev/mapper/'|')p1 | ||
export ROOTPARTION_ORIG=$(echo $LOOPDEV_ORIG | sed 's|'/dev'/|'/dev/mapper/'|')p2 | ||
|
||
# Copy data from original image to extended image | ||
dd if=$BOOTPARTION_ORIG of=$BOOTPARTION_EX bs=64K conv=noerror,sync | ||
dd if=$ROOTPARTION_ORIG of=$ROOTPARTION_EX bs=64K conv=noerror,sync | ||
|
||
# Remove loop devices for original image | ||
dmsetup clear $BOOTPARTION_ORIG | ||
dmsetup clear $ROOTPARTION_ORIG | ||
dmsetup remove $BOOTPARTION_ORIG | ||
dmsetup remove $ROOTPARTION_ORIG | ||
losetup -d $LOOPDEV_ORIG | ||
fi | ||
|
||
# Try to mount extended image | ||
if [ -z "$(mount|grep raspbian-boot)" ] && [ -z "$(mount|grep raspbian-root)" ]; then | ||
|
||
# Create a loop device and mount the disk image | ||
export LOOPDEV_EX="$(losetup --show --find ./raspbian_czmq.img)" | ||
|
||
# Use sudo kpartx to create partitions in /dev/mapper | ||
kpartx -av $LOOPDEV_EX | ||
dmsetup --noudevsync mknodes | ||
|
||
# Create partition names to mount | ||
export BOOTPARTION_EX=$(echo $LOOPDEV_EX | sed 's|'/dev'/|'/dev/mapper/'|')p1 | ||
export ROOTPARTION_EX=$(echo $LOOPDEV_EX | sed 's|'/dev'/|'/dev/mapper/'|')p2 | ||
|
||
# Make sure mount points exist and are clean | ||
mkdir -p raspbian-boot | ||
mkdir -p raspbian-root | ||
rm -rf raspbian-boot/* | ||
rm -rf raspbian-root/* | ||
|
||
# Mount partitions | ||
mount $BOOTPARTION_EX -t vfat raspbian-boot | ||
mount $ROOTPARTION_EX -t ext4 raspbian-root | ||
else | ||
echo "Image already mounted!" | ||
fi | ||
|
||
################################################################################ | ||
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # | ||
# Read the zproject/README.md for information about making permanent changes. # | ||
################################################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
#!/usr/bin/make -f | ||
# -*- makefile -*- | ||
|
||
DRAFTS=no | ||
|
||
# OBS build: add | ||
# Macros: | ||
# %_with_drafts 1 | ||
# at the BOTTOM of the OBS prjconf | ||
OBS_BUILD_CFG=/.build/build.dist | ||
ifeq ("$(wildcard $(OBS_BUILD_CFG))","") | ||
BUILDCONFIG=$(shell ls -1 /usr/src/packages/SOURCES/_buildconfig* | head -n 1) | ||
endif | ||
ifneq ("$(wildcard $(OBS_BUILD_CFG))","") | ||
ifneq ("$(shell grep drafts $(OBS_BUILD_CFG))","") | ||
DRAFTS=yes | ||
endif | ||
endif | ||
|
||
# User build: DEB_BUILD_OPTIONS=drafts dpkg-buildpackage | ||
ifneq (,$(findstring drafts,$(DEB_BUILD_OPTIONS))) | ||
DRAFTS=yes | ||
endif | ||
|
||
override_dh_strip: | ||
dh_strip --dbg-package=czmq-dbg | ||
|
||
override_dh_auto_test: | ||
echo "Skipped for now" | ||
|
||
override_dh_auto_configure: | ||
dh_auto_configure -- --with-systemd-units | ||
dh_auto_configure -- \ | ||
--enable-drafts=$(DRAFTS) | ||
|
||
%: | ||
dh $@ --with autoreconf,systemd | ||
|
||
dh $@ \ | ||
--with autoreconf |
Oops, something went wrong.