Skip to content

Commit

Permalink
debian: use maruos APT server for dependencies
Browse files Browse the repository at this point in the history
This points to maruos's APT server to download the latest cleanly
packaged mclient instead of shipping a binary artifact.

Signed-off-by: Preetam D'Souza <preetamjdsouza@gmail.com>
  • Loading branch information
pdsouza committed Dec 14, 2016
1 parent 1d51e35 commit a72e2c1
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 25 deletions.
17 changes: 15 additions & 2 deletions README.md
Expand Up @@ -2,11 +2,11 @@

[![Build Status](https://travis-ci.org/maruos/blueprints.svg?branch=master)](https://travis-ci.org/maruos/blueprints)

Builds container images for Maru OS based on a set of "blueprints".
Container image builder for Maru OS.

### Blueprints

Image building logic is separated into standalone blueprint plugins.
Image building logic is separated into standalone plugins called blueprints.

To create your own blueprint, all you need to do is:

Expand All @@ -24,6 +24,19 @@ To create your own blueprint, all you need to do is:

See blueprint/debian as the canonical example for Debian.

### Examples

Build a Debian Jessie armhf container called 'debian' (option defaults):

$ ./build.sh

Build a Debian Jessie arm64 container called 'jessie64':

$ ./build.sh -b debian -n jessie64 -- -a arm64

*Tip: You will need root privileges to mount binfmt_misc for bootstrapping
foreign architecture containers.*

### Contributing

See the [main Maru OS repository](https://github.com/maruos/maruos) for more
Expand Down
2 changes: 1 addition & 1 deletion blueprint/debian/Makefile
Expand Up @@ -17,7 +17,7 @@
NAME=maru
VERSION=0.1
PKG_VERSION=1
ARCH=armhf
ARCH=all
PKG=$(NAME)_$(VERSION)-$(PKG_VERSION)_$(ARCH).deb

pkg:
Expand Down
2 changes: 1 addition & 1 deletion blueprint/debian/chroot-configure.sh
Expand Up @@ -46,7 +46,7 @@ apt-get -y install xfce4-terminal \
dpkg -i maru_* || true

# install all missing packages in "Depends"
apt-get -y install -f
apt-get -y --allow-unauthenticated install -f

# get rid of xscreensaver and annoying warning
apt-get -y purge xscreensaver xscreensaver-data
Expand Down
7 changes: 4 additions & 3 deletions blueprint/debian/debpkg/DEBIAN/control
Expand Up @@ -2,12 +2,13 @@ Package: maru
Version: 0.1-1
Section: x11
Priority: optional
Architecture: armhf
Depends: libc6, libx11-6, libxfixes3, libxext6, libxdamage1, libxi6, libxrandr2,
Architecture: all
Depends: libc6,
xserver-xorg-video-dummy,
xfce4,
lightdm,
sudo, rsync
sudo, rsync,
maru-mflinger-client
Recommends: xfce4-terminal, xfce4-screenshooter,
lxtask,
vim,
Expand Down
3 changes: 0 additions & 3 deletions blueprint/debian/debpkg/DEBIAN/postinst
Expand Up @@ -65,9 +65,6 @@ adduser "$USER" sdcard_rw
# so disable it using update-rc.d
/usr/sbin/update-rc.d networking disable

# start mclient service on startup
ln -s /lib/systemd/system/mclient.service /etc/systemd/system/multi-user.target.wants/mclient.service

## udev ##

# remove any persistent interface naming rules
Expand Down
3 changes: 0 additions & 3 deletions blueprint/debian/debpkg/DEBIAN/prerm
Expand Up @@ -20,6 +20,3 @@
#
# Stop any daemons associated with the package before removal.
#

# remove mclient from systemd startup
systemctl disable mclient
12 changes: 0 additions & 12 deletions blueprint/debian/debpkg/lib/systemd/system/mclient.service

This file was deleted.

Binary file removed blueprint/debian/debpkg/usr/bin/mclient
Binary file not shown.
11 changes: 11 additions & 0 deletions blueprint/debian/plugin.sh
Expand Up @@ -20,6 +20,8 @@ BLUEPRINT_NAME="DEBIAN"
DEFAULT_RELEASE="jessie"
DEFAULT_ARCH="armhf"

DEFAULT_MARU_RELEASE="testing"

# tweaks to upstream template, must be absolute path
# note: this is only used because older versions of LXC do not support
# cross-debootstrapping in the debian template
Expand Down Expand Up @@ -78,6 +80,11 @@ EOF
# make sure we have a dynamic mirror for installing packages
cat > "${rootfs}/etc/apt/sources.list" <<EOF
deb http://httpredir.debian.org/debian ${release} main
EOF

# add maru apt repository for installing dependencies
cat > "${rootfs}/etc/apt/sources.list.d/maruos.list" <<EOF
deb http://packages.maruos.com/debian ${DEFAULT_MARU_RELEASE}/
EOF

# disable any default.target
Expand All @@ -99,6 +106,10 @@ EOF
pecho "configuring rootfs..."
cp "$CHROOT_SCRIPT" "${rootfs}/tmp"
chroot "$rootfs" bash -c "cd /tmp && ./${CHROOT_SCRIPT}"

# delete maru apt repository for now (upgrades not tested)
rm "${rootfs}/etc/apt/sources.list.d/maruos.list"

}

blueprint_build () {
Expand Down

0 comments on commit a72e2c1

Please sign in to comment.