Difference between revisions of "Building LinuxMCE"

From LinuxMCE
Jump to: navigation, search
(Phenigma moved page Building LinuxMCE to Building LinuxMCE 1204: data is not relevant for recent releases)
 
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
#REDIRECT [[Building LinuxMCE 1204]]
+
[[Category: Building]]
 +
[[category: programmer's Guide]]
 +
{| align="right"
 +
  | __TOC__
 +
  |}
 +
 
 +
{{versioninfo|1404Status=relevant|1404UpdatedDate=10 November 2016|1404UpdatedBy=phenigma}}
 +
The following steps explain how to install a development environment onto your core in a chroot environment, so that your running core and its database are not affected. Alternatively, you could build on a separate machine or virtual machine with a clean Kubuntu install. There are notes to this effect at the end of the page.
 +
 
 +
==Setting up a chroot environment==
 +
Start with becoming root on your core (or standalone builder). The  following steps will need to be done using super user privileges.
 +
  sudo su -
 +
 
 +
===Create the environment===
 +
Note: these steps must be performed only once, if you are creating a chroot environment to build in (recommended)
 +
apt-get install debootstrap
 +
debootstrap --arch i386 trusty /opt/builder-ubuntu-trusty-i386/
 +
 
 +
====Mount required directories====
 +
Note: these steps must be performed after each reboot (or put in /etc/fstab of the root machine), if you are using a chroot environment
 +
mount --bind /dev /opt/builder-ubuntu-trusty-i386/dev
 +
mount none /opt/builder-ubuntu-trusty-i386/sys -t sysfs
 +
mount none /opt/builder-ubuntu-trusty-i386/proc -t proc
 +
mount none /opt/builder-ubuntu-trusty-i386/dev/pts -t devpts
 +
 
 +
====Change-root into the environment====
 +
Note: these steps must be performed after each reboot to access to build environment (if in a chroot)
 +
chroot /opt/builder-ubuntu-trusty-i386
 +
 
 +
===Verify apt's list of repositories===
 +
Make sure ''/etc/apt/sources.list'' (inside the chroot) contains something very similar to:
 +
deb    <nowiki>http://</nowiki>''archive.ubuntu.com''/ubuntu/ trusty main restricted universe multiverse
 +
deb-src <nowiki>http://</nowiki>''archive.ubuntu.com''/ubuntu/ trusty main restricted universe
 +
deb    <nowiki>http://</nowiki>''archive.ubuntu.com''/ubuntu/ trusty-updates  main restricted universe multiverse
 +
deb-src <nowiki>http://</nowiki>''archive.ubuntu.com''/ubuntu/ trusty-updates  main restricted universe
 +
deb    <nowiki>http://</nowiki>security.ubuntu.com/ubuntu trusty-security  main restricted universe
 +
deb-src <nowiki>http://</nowiki>security.ubuntu.com/ubuntu trusty-security  main restricted universe
 +
deb    <nowiki>http://deb.linuxmce.org/ubuntu/ trusty main</nowiki>
 +
 
 +
 
 +
===Installing needed packages===
 +
'''Important!''' Perform these also '''after''' chrooting if you are building in a chrooted environment.
 +
 
 +
If you get messages like ''/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory'', that meens that $LANG is set. Either clear the LANG or install the needed language pack (english given example given in the code-snip below).
 +
 
 +
(Leave the root password for MySQL empty.)
 +
apt-get update
 +
 +
# add english language pack (required for reporting issues) (see explanation above)
 +
unset LANG
 +
apt-get install language-pack-en-base
 +
 +
apt-get dist-upgrade
 +
apt-get install aptitude openssh-client mysql-server
 +
 
 +
====Reconfigure MySQL to not open a TCP-IP network port====
 +
(only needed if you are building in a chrooted environment)
 +
<nowiki>sed 's/^[^#]*bind-address[[:space:]]*=.*$/#&\nskip-networking/' -i /etc/mysql/my.cnf</nowiki>
 +
 
 +
====Start MySQL Server====
 +
Do not execute the mysql start before doing the sed statement listed above.
 +
service mysql stop
 +
service mysql start
 +
 
 +
==Building from source==
 +
For a more in detail description of all the steps involved see [[Building LinuxMCE 0804]]
 +
 
 +
===Getting started===
 +
You should only have to do this part once initially.
 +
 
 +
====Obtaining the build scripts====
 +
cd ~
 +
apt-get install git
 +
git clone https://git.linuxmce.org/linuxmce/buildscripts.git
 +
 
 +
====Installing the build scripts====
 +
cd Ubuntu_Helpers_NoHardcode
 +
./install.sh
 +
 
 +
====Configuring the build scripts====
 +
cat >/etc/lmce-build/builder.custom.conf <<EOF
 +
  # Avoid DVD build step[s]
 +
do_not_build_sl_dvd="yes"
 +
do_not_build_dl_dvd="yes"
 +
 
 +
# Create fake win32 binaries
 +
win32_create_fake="yes"
 +
 +
# Point to the production sqlCVS server
 +
sqlcvs_host="schema.linuxmce.org"
 +
EOF
 +
 
 +
===Preparing for build===
 +
 
 +
cd /usr/local/lmce-build
 +
 
 +
The preparation steps one at a time (recommended):
 +
prepare-scripts/install-build-pkgs.sh
 +
#prepare-scripts/cd1-prepare.sh
 +
#prepare-scripts/cd2-prepare.sh
 +
prepare-scripts/create-diskless-debootstrap.sh
 +
prepare-scripts/import-external-files.sh
 +
prepare-scripts/preseed-build-pkgs.sh
 +
 
 +
Or, you could do them all in one go with:
 +
./prepare.sh
 +
 
 +
===Building from source===
 +
 
 +
All the build steps can be executed seperately (recommended at least the first time):
 +
build-scripts/clone-git.sh
 +
build-scripts/import-win32bins.sh
 +
build-scripts/build-replacements.sh
 +
build-scripts/build-makerelease.sh
 +
build-scripts/import-databases.sh
 +
build-scripts/build-maindebs.sh
 +
build-scripts/get-closed-source-debs.sh
 +
build-scripts/create-repo.sh
 +
#build-scripts/cd1-build.sh
 +
#build-scripts/cd2-build.sh
 +
 
 +
Or the following script will run them all:
 +
./build.sh
 +
 
 +
== Using the build's output ==
 +
The build.sh script puts all created deb-files under /var/www. Setup a web server to point to that directory.
 +
sudo apt-get install apache2
 +
 
 +
In the machine, where you want to test the build, follow the instructions on using the alpha build. After the step pre-install-from-repo.sh, go into /etc/apt/sources.list, and replace the deb.linuxmce.org line with
 +
deb <ip-address-of-your-builder> ./
 +
and re-run apt-get update
 +
 
 +
== Notes ==
 +
If you want to speed up building on a multi-core machine, create (or append) /etc/lmce-build/builder.custom.conf and add a line such as:
 +
NUMJOBS=4
 +
to build using 4 threads.  Adjust for you cpu core # +1 for optimal build efficiency.
 +
 
 +
=== Without -j 2 ===
 +
23:36:44  Compiling and building packages
 +
01:42:50  *** STEP: Download closed source debs
 +
 
 +
Total: roughly 2h 6minutes for compiling
 +
 
 +
=== With -j 2 ===
 +
13:13:44  Compiling and building packages
 +
14:51:56  *** STEP: Download closed source debs
 +
 
 +
Total: roughly 1h 38minutes for compiling
 +
 
 +
=== Notes for installing on a virgin Kubuntu installation (no chroot) ===
 +
* There is no need to run the command below, IF you are not chroot'ing, but it also doesn't hurt unless you expect to access the db from an external system.
 +
  sed 's/^[^#]*bind-address[[:space:]]*=.*$/#&\nskip-networking/' -i /etc/mysql/my.cnf
 +
 
 +
* After you reboot, you will notice that KDE mysteriously vanished, and you will go to a gnome desktop.  I'm not sure why this is, but it does not seem to affect the builder any. -- is this still the case???  <phenigma>
 +
 
 +
* If you want to run this builder headless (or just want to ability to ssh in to it), then you must configure it for ssh access by installing an ssh server
 +
sudo apt-get install openssh-server

Latest revision as of 20:46, 10 November 2017

Version Status Date Updated Updated By
710 Unknown N/A N/A
810 Unknown N/A N/A
1004 Unknown N/A N/A
1204 Unknown N/A N/A
1404 relevant 10 November 2016 phenigma
Usage Information

The following steps explain how to install a development environment onto your core in a chroot environment, so that your running core and its database are not affected. Alternatively, you could build on a separate machine or virtual machine with a clean Kubuntu install. There are notes to this effect at the end of the page.

Setting up a chroot environment

Start with becoming root on your core (or standalone builder). The following steps will need to be done using super user privileges.

 sudo su -

Create the environment

Note: these steps must be performed only once, if you are creating a chroot environment to build in (recommended)

apt-get install debootstrap
debootstrap --arch i386 trusty /opt/builder-ubuntu-trusty-i386/

Mount required directories

Note: these steps must be performed after each reboot (or put in /etc/fstab of the root machine), if you are using a chroot environment

mount --bind /dev /opt/builder-ubuntu-trusty-i386/dev
mount none /opt/builder-ubuntu-trusty-i386/sys -t sysfs
mount none /opt/builder-ubuntu-trusty-i386/proc -t proc
mount none /opt/builder-ubuntu-trusty-i386/dev/pts -t devpts

Change-root into the environment

Note: these steps must be performed after each reboot to access to build environment (if in a chroot)

chroot /opt/builder-ubuntu-trusty-i386

Verify apt's list of repositories

Make sure /etc/apt/sources.list (inside the chroot) contains something very similar to:

deb     http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb     http://archive.ubuntu.com/ubuntu/ trusty-updates  main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates  main restricted universe
deb     http://security.ubuntu.com/ubuntu trusty-security  main restricted universe
deb-src http://security.ubuntu.com/ubuntu trusty-security  main restricted universe
deb     http://deb.linuxmce.org/ubuntu/ trusty main


Installing needed packages

Important! Perform these also after chrooting if you are building in a chrooted environment.

If you get messages like /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory, that meens that $LANG is set. Either clear the LANG or install the needed language pack (english given example given in the code-snip below).

(Leave the root password for MySQL empty.)

apt-get update

#  add english language pack (required for reporting issues) (see explanation above)
unset LANG
apt-get install language-pack-en-base

apt-get dist-upgrade
apt-get install aptitude openssh-client mysql-server

Reconfigure MySQL to not open a TCP-IP network port

(only needed if you are building in a chrooted environment)

sed 's/^[^#]*bind-address[[:space:]]*=.*$/#&\nskip-networking/' -i /etc/mysql/my.cnf

Start MySQL Server

Do not execute the mysql start before doing the sed statement listed above.

service mysql stop
service mysql start

Building from source

For a more in detail description of all the steps involved see Building LinuxMCE 0804

Getting started

You should only have to do this part once initially.

Obtaining the build scripts

cd ~
apt-get install git
git clone https://git.linuxmce.org/linuxmce/buildscripts.git

Installing the build scripts

cd Ubuntu_Helpers_NoHardcode
./install.sh

Configuring the build scripts

cat >/etc/lmce-build/builder.custom.conf <<EOF
 # Avoid DVD build step[s]
do_not_build_sl_dvd="yes"
do_not_build_dl_dvd="yes"
 
# Create fake win32 binaries
win32_create_fake="yes"

# Point to the production sqlCVS server
sqlcvs_host="schema.linuxmce.org"
EOF

Preparing for build

cd /usr/local/lmce-build

The preparation steps one at a time (recommended):

prepare-scripts/install-build-pkgs.sh
#prepare-scripts/cd1-prepare.sh
#prepare-scripts/cd2-prepare.sh
prepare-scripts/create-diskless-debootstrap.sh
prepare-scripts/import-external-files.sh
prepare-scripts/preseed-build-pkgs.sh

Or, you could do them all in one go with:

./prepare.sh

Building from source

All the build steps can be executed seperately (recommended at least the first time):

build-scripts/clone-git.sh
build-scripts/import-win32bins.sh
build-scripts/build-replacements.sh
build-scripts/build-makerelease.sh
build-scripts/import-databases.sh
build-scripts/build-maindebs.sh
build-scripts/get-closed-source-debs.sh
build-scripts/create-repo.sh
#build-scripts/cd1-build.sh
#build-scripts/cd2-build.sh

Or the following script will run them all:

./build.sh

Using the build's output

The build.sh script puts all created deb-files under /var/www. Setup a web server to point to that directory.

sudo apt-get install apache2

In the machine, where you want to test the build, follow the instructions on using the alpha build. After the step pre-install-from-repo.sh, go into /etc/apt/sources.list, and replace the deb.linuxmce.org line with

deb <ip-address-of-your-builder> ./

and re-run apt-get update

Notes

If you want to speed up building on a multi-core machine, create (or append) /etc/lmce-build/builder.custom.conf and add a line such as:

NUMJOBS=4

to build using 4 threads. Adjust for you cpu core # +1 for optimal build efficiency.

Without -j 2

23:36:44  Compiling and building packages
01:42:50  *** STEP: Download closed source debs
Total: roughly 2h 6minutes for compiling

With -j 2

13:13:44  Compiling and building packages
14:51:56  *** STEP: Download closed source debs
Total: roughly 1h 38minutes for compiling

Notes for installing on a virgin Kubuntu installation (no chroot)

  • There is no need to run the command below, IF you are not chroot'ing, but it also doesn't hurt unless you expect to access the db from an external system.
 sed 's/^[^#]*bind-addressspace:*=.*$/#&\nskip-networking/' -i /etc/mysql/my.cnf
  • After you reboot, you will notice that KDE mysteriously vanished, and you will go to a gnome desktop. I'm not sure why this is, but it does not seem to affect the builder any. -- is this still the case??? <phenigma>
  • If you want to run this builder headless (or just want to ability to ssh in to it), then you must configure it for ssh access by installing an ssh server
sudo apt-get install openssh-server