Skip to content

Commit

Permalink
Update packages building code and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
zador-blood-stained committed Jun 20, 2016
1 parent fec26e0 commit 1fd33d3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
18 changes: 8 additions & 10 deletions chroot-buildpackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ create_chroot()
APT::Install-Suggests "0";
EOF
[[ -f $DEST/buildpkg/$RELEASE/etc/locale.gen ]] && sed -i "s/^# en_US.UTF-8/en_US.UTF-8/" $DEST/buildpkg/$RELEASE/etc/locale.gen
systemd-nspawn -D $DEST/buildpkg/$RELEASE /bin/bash -c "locale-gen; update-locale LANG=en_US:en LC_ALL=en_US.UTF-8"
chroot $DEST/buildpkg/$RELEASE /bin/bash -c "locale-gen; update-locale LANG=en_US:en LC_ALL=en_US.UTF-8"
printf '#!/bin/sh\nexit 101' > $DEST/buildpkg/$RELEASE/usr/sbin/policy-rc.d
chmod 755 $DEST/buildpkg/$RELEASE/usr/sbin/policy-rc.d
mkdir -p $DEST/buildpkg/$RELEASE/root/build $DEST/buildpkg/$RELEASE/root/overlay $DEST/buildpkg/$RELEASE/selinux
Expand All @@ -35,7 +35,7 @@ create_chroot()
update_chroot()
{
# apt-get update && apt-get dist-upgrade
systemd-nspawn -D $DEST/buildpkg/$RELEASE /bin/bash -c "apt-get -q update; apt-get -q -y upgrade"
systemd-nspawn -a -q -D $DEST/buildpkg/$RELEASE /bin/bash -c "apt-get -q update; apt-get -q -y upgrade"
# helper script
cat <<-'EOF' > $DEST/buildpkg/$RELEASE/root/install-deps.sh
#!/bin/bash
Expand Down Expand Up @@ -83,14 +83,15 @@ chroot_build_packages()
[[ -n "$package_commit" ]] && git checkout -f $package_commit
# unpack debianization files if needed
[[ -n "$package_overlay" ]] && tar xf /root/overlay/$package_overlay -C /root/build/$package_dir
[[ -n "$package_prebuild_eval" ]] && eval "$package_prebuild_eval"
# TODO: increment base version if needed
# set local version
debchange -l~armbian${REVISION}+ "New Armbian release"
# build
display_alert "Building package"
dpkg-buildpackage -b -uc -us -jauto
cd /root/build
display_alert "Done building"
display_alert "Done building" "$package_name" "ext"
ls *.deb
# install in chroot if other libraries depend on them
[[ "$package_install" == yes ]] && dpkg -i *.deb
Expand All @@ -99,14 +100,11 @@ chroot_build_packages()

chmod +x $DEST/buildpkg/$RELEASE/root/build.sh
# run build script in chroot
systemd-nspawn -D $DEST/buildpkg/$RELEASE --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \
systemd-nspawn -a -q -D $DEST/buildpkg/$RELEASE --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \
/bin/bash -c "/root/build.sh"
# TODO: move built packages to $DEST/debs
# mv $DEST/buildpkg/$RELEASE/root/build/*.deb $DEST/debs/
# DEBUG:
#systemd-nspawn -D $DEST/buildpkg/$RELEASE --tmpfs=/root/build --tmpfs=/tmp --bind-ro $SRC/lib/extras-buildpkgs/:/root/overlay \
# /bin/bash
# TODO: move built packages to $DEST/debs/extras
# mv $DEST/buildpkg/$RELEASE/root/build/*.deb $DEST/debs/extras
# cleanup
unset package_name package_repo package_dir package_branch package_overlay package_builddeps package_commit package_install
unset package_name package_repo package_dir package_branch package_overlay package_builddeps package_commit package_install package_prebuild_eval
done
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ local package_name="libUMP"
local package_repo="https://github.com/rellla/libump.git"
local package_dir="libump"
local package_branch="ump"
local package_overlay=""
local package_overlay="libump.tar.xz"
local package_builddeps="debhelper dh-autoreconf pkg-config"
local package_install="yes"
Binary file modified extras-buildpkgs/libdri2-1.tar.xz
Binary file not shown.
Binary file added extras-buildpkgs/libump.tar.xz
Binary file not shown.
8 changes: 8 additions & 0 deletions extras-buildpkgs/swconfig.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# swconfig
local package_name="swconfig"
local package_repo="https://github.com/jekader/swconfig.git"
local package_dir="swconfig"
local package_branch=""
local package_overlay="swconfig.tar.xz"
local package_prebuild_eval="mkdir -p /usr/local/include/linux; cp linux/switch.h /usr/local/include/linux/"
local package_builddeps="linux-headers-armmp libnl-3-dev libnl-genl-3-dev"
Binary file added extras-buildpkgs/swconfig.tar.xz
Binary file not shown.

0 comments on commit 1fd33d3

Please sign in to comment.