[lxc-devel] [lxc-ci/master] Add PLD Linux

mistoo on Github lxc-bot at linuxcontainers.org
Fri Mar 13 16:28:08 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 424 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200313/8ebb0fe1/attachment-0001.bin>
-------------- next part --------------
From bd1f238307b80f3ae1d5c3322132f49c10b02beb Mon Sep 17 00:00:00 2001
From: Pawel Gajda <mis at pld-linux.org>
Date: Fri, 13 Mar 2020 17:18:23 +0100
Subject: [PATCH] Add PLD Linux

Signed-off-by: Pawel Gajda <mis at pld-linux.org>
---
 images/pld.yaml             | 146 ++++++++++++++++++++++++++++++++++++
 jenkins/jobs/image-pld.yaml |  71 ++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 images/pld.yaml
 create mode 100644 jenkins/jobs/image-pld.yaml

diff --git a/images/pld.yaml b/images/pld.yaml
new file mode 100644
index 0000000..f84a944
--- /dev/null
+++ b/images/pld.yaml
@@ -0,0 +1,146 @@
+image:
+  distribution: pld
+
+source:
+  downloader: docker-http
+  url: pldlinux/i686:latest
+
+targets:
+  lxc:
+    create-message: |-
+      You just created a {{ image.description }} container.
+    config:
+    - type: all
+      content: |-
+        lxc.include = LXC_TEMPLATE_CONFIG/common.conf
+    - type: user
+      content: |-
+        lxc.include = LXC_TEMPLATE_CONFIG/userns.conf
+    - type: all
+      content: |-
+        lxc.arch = {{ image.architecture_personality }}
+
+packages:
+  custom-manager:
+    refresh:
+      cmd: poldek
+      flags: [ --noprogress, --up ]
+    install:
+      cmd: poldek
+      flags: [ --noprogress, --noask, -u ]
+    remove:
+      cmd: poldek
+      flags: [ --noprogress, --noask, -e ]
+    update:
+      cmd: poldek
+      flags: [ --noprogress, --noask, --upgrade-dist ]
+    clean:
+      cmd: poldek
+      flags: [ --clean ]
+
+actions:
+  - trigger: post-unpack
+    action: |-
+      #!/bin/sh
+      set -eux
+      # re-enable network initialization disabled in docker image
+      rm -f /var/lock/subsys/network
+      # disable i18n installing
+      sed -i '$ a%_install_langs C' /etc/rpm/macros
+      # no systemd here
+      sed -i '/^RPM_ENABLE_SYSTEMD_SERVICE=/ s/=yes/=no/' /etc/sysconfig/rpm
+  - trigger: post-packages
+    action: |-
+      #!/bin/sh
+      set -eux
+
+      # system config
+      for op in RC_PROMPT RUN_DEPMOD SELINUX SET_SLINKS \
+                START_UDEV EVMS_LVM_COMPAT_NODES LVM2 \
+                DMRAID MDADM DM_MULTIPATH \
+                VSERVER_ISOLATION_NET; do
+          sed -i "/^${op}=/ s/=.*/=no/" /etc/sysconfig/system
+      done
+
+      for op in FASTRC VSERVER; do
+          sed -i "/^${op}=/ s/=.*/=yes/" /etc/sysconfig/system
+      done
+
+      # disable ttys
+      sed -i '/^[^#].*:respawn:/ s/^/#/' /etc/inittab
+      # shutdown immediately
+      sed -i '/^pf::powerfail.*\+2/ s/\+2/now/' /etc/inittab
+
+      # disable irrelevant sysctls
+      sed -i '/^kernel.sysrq/ s/^/#/' /etc/sysctl.conf
+
+      # fix: check lsmod existence
+      sed -i -e '/if *\! *lsmod / i [ -x /sbin/lsmod ] || return 1' /lib/rc-scripts/functions
+
+      # fix: loopback is initialized by lxd
+      sed -i -e '/^[ \t]*ip addr add 127\.0\.0\.1\/8 dev lo/ s/^/(ip addr show dev lo | grep -q 127.0.0.1) ||/' /lib/rc-scripts/functions.network
+
+      # locale
+      cat << EOF >> /etc/sysconfig/i18n
+      LANG="C.UTF-8"
+      SUPPORTED_LOCALES="C.UTF-8/UTF-8"
+      EOF
+
+      localedb-gen
+
+      # uninstall needless systemd-units
+      rpm -q systemd-units >/dev/null && rpm -e systemd-units --nodeps --noscripts
+
+      # cleanup
+      rpm -e localedb-src
+      rm -f /var/cache/hrmib/*
+      rm -f /var/lib/rpm/__db.*
+
+packages:
+  update: false
+  cleanup: true
+  sets:
+  - packages:
+    - dhcp-client
+    - localedb-src
+    - rc-scripts
+    - tzdata
+    - vim
+    action: install
+
+files:
+  - name: hostname
+    path: /etc/hostname
+    generator: hostname
+    when: create
+  - path: /etc/machine-id
+    generator: dump
+    when: create
+  - name: network
+    path: /etc/sysconfig/network
+    generator: dump
+    templated: true
+    content: |-
+      NETWORKING=yes
+      IPV4_NETWORKING=yes
+      IPV6_NETWORKING=no
+      HOSTNAME=LXC_NAME
+  - name: network.lxd
+    path: /etc/sysconfig/network
+    generator: template
+    content: |-
+      NETWORKING=yes
+      IPV4_NETWORKING=yes
+      IPV6_NETWORKING=no
+      HOSTNAME={{ container.name }}
+  - name: ifcfg-eth0
+    path: /etc/sysconfig/interfaces/ifcfg-eth0
+    generator: dump
+    templated: true
+    content: |-
+      DEVICE=eth0
+      ONBOOT=yes
+      BOOTPROTO=dhcp
+      # static ip configuration
+      #BOOTPROTO=none
+      #IPADDR=10.1.1.10/24
diff --git a/jenkins/jobs/image-pld.yaml b/jenkins/jobs/image-pld.yaml
new file mode 100644
index 0000000..5bd3e2f
--- /dev/null
+++ b/jenkins/jobs/image-pld.yaml
@@ -0,0 +1,71 @@
+- job:
+    name: "image-pld"
+    concurrent: false
+    description: PLD Linux images for LXC and LXD.
+    node: master
+    project-type: matrix
+
+    axes:
+    - axis:
+        name: architecture
+        type: slave
+        values:
+        - amd64
+        - i386
+
+    - axis:
+        name: release
+        type: user-defined
+        values:
+        - current
+
+    - axis:
+        name: variant
+        type: user-defined
+        values:
+        - default
+
+    builders:
+    - shell: |-
+        cd /lxc-ci
+        LXD_ARCHITECTURE="${architecture}"
+
+        ARCH=${architecture}
+        [ "${ARCH}" = "amd64" ] && ARCH="x86_64"
+        [ "${ARCH}" = "i386" ] && ARCH="i686"
+
+        TYPE="container"
+
+        exec sudo /lxc-ci/bin/build-distro /lxc-ci/images/pld.yaml \
+            ${LXD_ARCHITECTURE} container 1800 ${WORKSPACE} \
+            -o image.architecture=${ARCH} -o image.release=${release} \
+            -o source.url="pldlinux/${ARCH}:latest"
+
+    properties:
+    - build-discarder:
+        num-to-keep: 2
+
+    - raw:
+        !include: ../includes/webhook.yaml.inc
+
+    publishers:
+    - archive:
+        artifacts: "*.qcow2,*.tar.xz,*.squashfs,image.yaml,serial"
+        only-if-success: true
+
+    - workspace-cleanup:
+        fail-build: false
+
+    - naginator:
+        rerun-unstable-builds: true
+        rerun-matrix-part: true
+        max-failed-builds: 3
+        progressive-delay-increment: 300
+        progressive-delay-maximum: 900
+
+    triggers:
+    - timed: '@daily'
+
+    wrappers:
+    - ansicolor:
+        colormap: xterm


More information about the lxc-devel mailing list