From cf6339f0b4e4d6563fe21ba7af97704453d2a997 Mon Sep 17 00:00:00 2001 From: coderus Date: Thu, 11 Apr 2019 19:31:17 +0300 Subject: [PATCH] [sdk] Sailfish OS Platform SDK --- .gitignore | 2 ++ .travis.yml | 27 ++++++++++++++++++ Dockerfile | 25 ++++++++++++++++ README.md | 1 + build-all.sh | 8 ++++++ build.sh | 11 +++++++ docker_push | 9 ++++++ mer-tooling-chroot | 8 ++++++ platformsdk.ks | 55 +++++++++++++++++++++++++++++++++++ target.ks | 71 ++++++++++++++++++++++++++++++++++++++++++++++ tooling.ks | 57 +++++++++++++++++++++++++++++++++++++ 11 files changed, 274 insertions(+) create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 build-all.sh create mode 100755 build.sh create mode 100644 docker_push create mode 100755 mer-tooling-chroot create mode 100644 platformsdk.ks create mode 100644 target.ks create mode 100644 tooling.ks diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30023e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +build/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..27eb7ec --- /dev/null +++ b/.travis.yml @@ -0,0 +1,27 @@ +language: generic + +env: + - RELEASE=3.0.2.8 + +services: + - docker + +before_install: + - docker pull coderus/sailfishos-baseimage + - docker run --rm --privileged -it + -e RELEASE=$RELEASE + -v $(pwd):/share -w /share + coderus/sailfishos-baseimage + bash build-all.sh + +script: + - docker import build/platformsdk-i486.tar coderus/sailfishos-platform-sdk-base:latest + - docker tag coderus/sailfishos-platform-sdk-base:latest coderus/sailfishos-platform-sdk-base:$RELEASE + - docker build --build-arg RELEASE=$RELEASE -t coderus/sailfishos-buildengine:latest . + - docker tag coderus/sailfishos-buildengine:latest coderus/sailfishos-buildengine:$RELEASE + +deploy: + provider: script + script: bash docker_push + on: + branch: master diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a169f59 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM coderus/sailfishos-platform-sdk-base +MAINTAINER Andrey Kozhevnikov + +ARG RELEASE + +COPY build/tooling-i486.tar /tooling-i486.tar +COPY build/target-i486.tar /target-i486.tar +COPY build/target-armv7hl.tar /target-armv7hl.tar + +USER nemo +WORKDIR /home/nemo + +RUN set -ex ;\ + sudo mkdir /host_targets ;\ + sudo zypper ref ;\ + sudo zypper -qn in tar ;\ + sdk-assistant -y create SailfishOS-$RELEASE /tooling-i486.tar ;\ + sudo rm -f /tooling-i486.tar ;\ + sdk-assistant -y create SailfishOS-$RELEASE-i486 /target-i486.tar ;\ + sudo rm -f /target-i486.tar ;\ + sdk-assistant -y create SailfishOS-$RELEASE-armv7hl /target-armv7hl.tar ;\ + sudo rm -f /target-armv7hl.tar ;\ + sudo rm -rf /var/cache/zypp/* ;\ + sudo rm -rf /srv/mer/targets/SailfishOS-$RELEASE-armv7hl/var/cache/zypp/* ;\ + sudo rm -rf /srv/mer/targets/SailfishOS-$RELEASE-i486/var/cache/zypp/* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..89430c4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +docker-sailfishos-platform-sdk diff --git a/build-all.sh b/build-all.sh new file mode 100755 index 0000000..9e549ae --- /dev/null +++ b/build-all.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex + +bash build.sh platformsdk.ks i486 $RELEASE +bash build.sh tooling.ks i486 $RELEASE +bash build.sh target.ks i486 $RELEASE +bash build.sh target.ks armv7hl $RELEASE \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..3c3fd36 --- /dev/null +++ b/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +mic \ + create fs \ + -v \ + -d \ + --tokenmap=ARCH:"$2",RELEASE:"$3" \ + --arch="$2" \ + --outdir="/share/build" \ + --pack-to="@NAME@-$2.tar" \ + "$1" \ No newline at end of file diff --git a/docker_push b/docker_push new file mode 100644 index 0000000..facec61 --- /dev/null +++ b/docker_push @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + +docker push coderus/sailfishos-platform-sdk-base:latest +docker push coderus/sailfishos-platform-sdk-base:$RELEASE + +docker push coderus/sailfishos-platform-sdk:latest +docker push coderus/sailfishos-platform-sdk:$RELEASE diff --git a/mer-tooling-chroot b/mer-tooling-chroot new file mode 100755 index 0000000..b364931 --- /dev/null +++ b/mer-tooling-chroot @@ -0,0 +1,8 @@ +#!/bin/bash +# Hack to prevent a chroot when already running in a container + +if [[ $# -ne 0 ]]; then + "${@}" +else + /bin/bash --login +fi diff --git a/platformsdk.ks b/platformsdk.ks new file mode 100644 index 0000000..2823382 --- /dev/null +++ b/platformsdk.ks @@ -0,0 +1,55 @@ +user --name nemo --groups audio,input,video --password nemo +timezone --utc UTC +lang en_US.UTF-8 +keyboard us + +part / --fstype=ext4 --ondisk=sda --size=8192 --label=system + +repo --name=adaptation0-jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla-hw/adaptation-jolla-x86-emul/@ARCH@/ +repo --name=hotfixes-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/ +repo --name=jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/ +repo --name=sdk-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/sdk/@ARCH@/ + +%packages +@Jolla Configuration Platform SDK Chroot +ssu-vendor-data-jolla +%end + +%pre +touch $INSTALL_ROOT/.bootstrap +%end + +%post +echo -n "@ARCH@-meego-linux" > /etc/rpm/platform +echo "arch = @ARCH@" >> /etc/zypp/zypp.conf +rm -f /var/lib/rpm/__db* +rpm --rebuilddb +rm -f /.bootstrap + +export LANG=en_US.UTF-8 +export LC_COLLATE=en_US.UTF-8 +export GSETTINGS_BACKEND=gconf + +UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2) +DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'` + +if [ -x /usr/bin/oneshot ]; then + su -c "/usr/bin/oneshot --mic" + su -c "/usr/bin/oneshot --mic" $DEVICEUSER +fi + +ssu domain sailfish +ssu re @RELEASE@ +ssu ur + +chmod +w /etc/sudoers +echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +chmod -w /etc/sudoers + +%end + +%post --nochroot +if [ -n "$IMG_NAME" ]; then + echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release +fi +%end diff --git a/target.ks b/target.ks new file mode 100644 index 0000000..0dfb80b --- /dev/null +++ b/target.ks @@ -0,0 +1,71 @@ +user --name nemo --groups audio,input,video --password nemo +timezone --utc UTC +lang en_US.UTF-8 +keyboard us + +part / --fstype=ext4 --ondisk=sda --size=8192 --label=system + +repo --name=customer-jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/features/@RELEASE@/customers/jolla/@ARCH@/ +repo --name=hotfixes-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/ +repo --name=jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/ +repo --name=sdk-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/sdk/@ARCH@/ +repo --name=apps-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/jolla-apps/@RELEASE@/@ARCH@/ + +%packages +# @Jolla Configuration Sailfish SDK Target +patterns-sailfish-qt5-devel-full +busybox-symlinks-diffutils +busybox-symlinks-grep +busybox-symlinks-findutils +patterns-sailfish-target-support +sdk-target-configs +#patterns-sailfish-silica-devel +maliit-framework-wayland-devel +sailfishsilica-qt5 +desktop-file-utils +mapplauncherd-qt5-devel +#ambienced-devel +mlite-qt5-devel +libsailfishapp-devel +# end of @Jolla Configuration Sailfish SDK Target +ssu-vendor-data-jolla +%end + +%pre +touch $INSTALL_ROOT/.bootstrap +%end + +%post +echo -n "@ARCH@-meego-linux" > /etc/rpm/platform +echo "arch = @ARCH@" >> /etc/zypp/zypp.conf +rm -f /var/lib/rpm/__db* +rpm --rebuilddb +rm -f /.bootstrap + +export LANG=en_US.UTF-8 +export LC_COLLATE=en_US.UTF-8 +export GSETTINGS_BACKEND=gconf + +UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2) +DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'` + +if [ -x /usr/bin/oneshot ]; then + su -c "/usr/bin/oneshot --mic" + su -c "/usr/bin/oneshot --mic" $DEVICEUSER +fi + +ssu domain sailfish +ssu re @RELEASE@ +ssu ur + +chmod +w /etc/sudoers +echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +chmod -w /etc/sudoers + +%end + +%post --nochroot +if [ -n "$IMG_NAME" ]; then + echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release +fi +%end diff --git a/tooling.ks b/tooling.ks new file mode 100644 index 0000000..b8b2d96 --- /dev/null +++ b/tooling.ks @@ -0,0 +1,57 @@ +user --name nemo --groups audio,input,video --password nemo +timezone --utc UTC +lang en_US.UTF-8 +keyboard us + +part / --fstype=ext4 --ondisk=sda --size=8192 --label=system + +repo --name=adaptation0-jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla-hw/adaptation-jolla-x86-emul/@ARCH@/ +repo --name=hotfixes-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/ +repo --name=jolla-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/ +repo --name=sdk-@RELEASE@-@ARCH@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/sdk/@ARCH@/ + +%packages +@Jolla Configuration Sailfish SDK Tooling +ssu-vendor-data-jolla +%end + +%pre +touch $INSTALL_ROOT/.bootstrap +%end + +%post +echo -n "@ARCH@-meego-linux" > /etc/rpm/platform +echo "arch = @ARCH@" >> /etc/zypp/zypp.conf +rm -f /var/lib/rpm/__db* +rpm --rebuilddb +rm -f /.bootstrap + +export LANG=en_US.UTF-8 +export LC_COLLATE=en_US.UTF-8 +export GSETTINGS_BACKEND=gconf + +UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2) +DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'` + +if [ -x /usr/bin/oneshot ]; then + su -c "/usr/bin/oneshot --mic" + su -c "/usr/bin/oneshot --mic" $DEVICEUSER +fi + +ssu domain sailfish +ssu re @RELEASE@ +ssu ur + +chmod +w /etc/sudoers +echo "ALL ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers +chmod -w /etc/sudoers + +%end + +%post --nochroot +if [ -n "$IMG_NAME" ]; then + echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release +fi + +cp -f /share/mer-tooling-chroot $INSTALL_ROOT/ +%end