Skip to content

Commit

Permalink
[sdk] Sailfish OS Platform SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
CODeRUS committed Apr 11, 2019
0 parents commit cf6339f
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

build/
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM coderus/sailfishos-platform-sdk-base
MAINTAINER Andrey Kozhevnikov <[email protected]>

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/*
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker-sailfishos-platform-sdk
8 changes: 8 additions & 0 deletions build-all.sh
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 9 additions & 0 deletions docker_push
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions mer-tooling-chroot
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions platformsdk.ks
Original file line number Diff line number Diff line change
@@ -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
71 changes: 71 additions & 0 deletions target.ks
Original file line number Diff line number Diff line change
@@ -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
57 changes: 57 additions & 0 deletions tooling.ks
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cf6339f

Please sign in to comment.