Skip to content
Snippets Groups Projects
Commit 7ba05757 authored by Administrator's avatar Administrator
Browse files

Merge branch 'ci' into 'reform2-upstreaming'

CI: Build image on gitlab runner (arm64 based)

See merge request reform/reform-system-image!11
parents be793795 681b7f4a
No related branches found
No related tags found
No related merge requests found
# Gitlab CI file to generate the system image .img file.
#image: debian:bullseye-slim
image: source.mnt.re:5050/reform/build-base-image-docker:latest
build:
script:
- sed -i 's|http://deb.|http://ftp.de.|g' /etc/apt/sources.list
- apt update
- apt-get -y install sudo gzip libext2fs2 pigz
- apt-get -y install bc parted multistrap udisks2 gcc-aarch64-linux-gnu make device-tree-compiler qemu-user-static binfmt-support build-essential bison flex libssl-dev bash git
- cd reform2-imx8mq/
- bash mkimage.sh
- pigz reform-system.img
artifacts:
paths:
- "reform2-imx8mq/linux/arch/arm64/boot/Image"
- "reform2-imx8mq/u-boot/flash.bin"
- "reform2-imx8mq/reform-system.img.gz"
...@@ -11,54 +11,22 @@ sudo apt-get -y install parted multistrap udisks2 gcc-aarch64-linux-gnu make dev ...@@ -11,54 +11,22 @@ sudo apt-get -y install parted multistrap udisks2 gcc-aarch64-linux-gnu make dev
./mkkernel.sh ./mkkernel.sh
# build u-boot # build u-boot
./mkuboot.sh ./mkuboot.sh
# build the debian userland and configure it # build the debian userland and configure it
sudo ./mkuserland.sh sudo ./mkuserland.sh
# chroot into the userland and build custom packages (mesa, xserver...) # chroot into the userland and build custom packages (mesa, xserver...)
sudo ./mkuserland2.sh sudo ./mkuserland2.sh
mkdir -p target # create ext4 partition from target root directory directly at 4MiB offset, 8192MiB (8GiB) image size
sudo /sbin/mke2fs -v -L 'MNTREFORM' -N 0 -O 64bit -E offset=4194304 -d target-userland -m 5 -r 1 -t ext4 reform-system.img 8188M
# change 8000 below to the number of megabytes your image file should have
if [ ! -f reform-system.img ]; then
dd if=/dev/zero of=reform-system.img bs=1M count=0 seek=8000
else
echo "reform-system.img already exists. Delete it if you want to change the image size."
fi
# can/should we use non-mbr? GPT?
/sbin/parted -s reform-system.img "mklabel msdos"
/sbin/parted -s reform-system.img "mkpart primary ext4 4MiB -1"
/sbin/parted -s reform-system.img print
LOOPDISK=$(udisksctl loop-setup -f ./reform-system.img)
LOOPDISK=$(echo $LOOPDISK | cut -f 5 -d " " | tr -d .)
echo LOOPDISK: $LOOPDISK
# format the partition
echo "About to format ${LOOPDISK}p1!"
#read -p "Are you sure? " -n 1 -r
sudo /sbin/mkfs.ext4 -q ${LOOPDISK}p1 sudo /sbin/parted -s reform-system.img "mklabel msdos"
sudo /sbin/parted -s reform-system.img "mkpart primary ext4 4MiB -1s"
sudo /sbin/parted -s reform-system.img print
# print the finished partition table
/sbin/parted -s reform-system.img print
sudo mount -t ext4 ${LOOPDISK}p1 target
# install filesystem in image
sudo cp -av target-userland/* target/
# install custom u-boot
# mkuboot.sh needs to run before. this creates flash.bin. # mkuboot.sh needs to run before. this creates flash.bin.
sudo umount target
# install u-boot for i.MX8M # install u-boot for i.MX8M
sudo dd if=./u-boot/flash.bin of=$LOOPDISK bs=1k seek=33 sudo dd if=./u-boot/flash.bin of=reform-system.img conv=notrunc bs=1k seek=33
# detach the image
sudo udisksctl loop-delete -b $LOOPDISK
echo Reform system image created: reform-system.img echo Reform system image created: reform-system.img
...@@ -5,23 +5,12 @@ ...@@ -5,23 +5,12 @@
ETC=./template-etc ETC=./template-etc
SKEL=./template-skel SKEL=./template-skel
mbind() {
for d in dev proc sys
do
mount /$d target-userland/$d -o bind || echo "Bind-mounting /$d failed"
done
}
munbind() {
for d in dev proc sys
do
umount -f target-userland/$d || echo "Umounting $d failed"
done
}
set -e set -e
[[ -e target-userland ]] && echo "WARNING: Target userland already exist" && munbind # create random chardevs (only method that works in docker)
mkdir -p target-userland/dev
mknod target-userland/dev/random c 1 8
mknod target-userland/dev/urandom c 1 9
# create debian userland # create debian userland
/usr/sbin/multistrap -d target-userland -f multistrap.conf /usr/sbin/multistrap -d target-userland -f multistrap.conf
...@@ -54,19 +43,19 @@ cp linux/arch/arm64/boot/Image target-userland/ ...@@ -54,19 +43,19 @@ cp linux/arch/arm64/boot/Image target-userland/
cp linux/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dtb target-userland/ cp linux/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dtb target-userland/
# install some kernel modules for dynamically loaded drivers # install some kernel modules for dynamically loaded drivers
mkdir -p target-userland/lib/modules #mkdir -p target-userland/lib/modules
# HDMI driver module # HDMI driver module
cp linux/drivers/gpu/drm/imx/cdns_mhdp_imx.ko target-userland/lib/modules/ #cp linux/drivers/gpu/drm/imx/cdns_mhdp_imx.ko target-userland/lib/modules/
# MIPI-DSI driver module # MIPI-DSI driver module
cp linux/drivers/gpu/drm/bridge/nwl-dsi.ko target-userland/lib/modules/ #cp linux/drivers/gpu/drm/bridge/nwl-dsi.ko target-userland/lib/modules/
# Display engine (DCSS) module # Display engine (DCSS) module
cp linux/drivers/gpu/drm/imx/dcss/imx-dcss.ko target-userland/lib/modules/ #cp linux/drivers/gpu/drm/imx/dcss/imx-dcss.ko target-userland/lib/modules/
mkdir -p target-userland/var/local/log mkdir -p target-userland/var/local/log
mkdir -p target-userland/etc/systemd/system #mkdir -p target-userland/etc/systemd/system
cp $ETC/reform-display.service target-userland/etc/systemd/system/ #cp $ETC/reform-display.service target-userland/etc/systemd/system/
cp $ETC/reform-toggle-display.sh target-userland/lib/modules/ #cp $ETC/reform-toggle-display.sh target-userland/lib/modules/
mkdir -p target-userland/etc/systemd/network mkdir -p target-userland/etc/systemd/network
cp $ETC/eth.network target-userland/etc/systemd/network/ cp $ETC/eth.network target-userland/etc/systemd/network/
...@@ -78,11 +67,6 @@ cp $ETC/asound.state target-userland/var/lib/alsa/ ...@@ -78,11 +67,6 @@ cp $ETC/asound.state target-userland/var/lib/alsa/
chown root:root -R target-userland chown root:root -R target-userland
chown root:shadow target-userland/etc/shadow chown root:shadow target-userland/etc/shadow
mbind
#mknod target-userland/dev/random c 1 8
#mknod target-userland/dev/urandom c 1 9
chroot target-userland /bin/bash <<EOF chroot target-userland /bin/bash <<EOF
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true export DEBCONF_NONINTERACTIVE_SEEN=true
...@@ -94,7 +78,7 @@ ln --force --symbolic /usr/share/zoneinfo/Europe/Berlin /etc/localtime ...@@ -94,7 +78,7 @@ ln --force --symbolic /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections
echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections
dpkg --configure -a dpkg --configure -a
systemctl enable reform-display.service #systemctl enable reform-display.service
chmod +s /usr/bin/sudo chmod +s /usr/bin/sudo
chmod +s /usr/bin/brightnessctl chmod +s /usr/bin/brightnessctl
...@@ -105,5 +89,4 @@ EOF ...@@ -105,5 +89,4 @@ EOF
mkdir -p target-userland/etc/pulseaudio mkdir -p target-userland/etc/pulseaudio
cp $ETC/daemon.conf target-userland/etc/pulse/ cp $ETC/daemon.conf target-userland/etc/pulse/
munbind
...@@ -14,18 +14,18 @@ git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git ...@@ -14,18 +14,18 @@ git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa.git
git clone --depth 1 https://github.com/swaywm/wlroots.git git clone --depth 1 https://github.com/swaywm/wlroots.git
git clone --depth 1 https://github.com/swaywm/sway.git git clone --depth 1 https://github.com/swaywm/sway.git
git clone --depth 1 https://gitlab.freedesktop.org/xorg/xserver.git git clone --depth 1 https://gitlab.freedesktop.org/xorg/xserver.git
git clone --depth 1 https://github.com/mntmn/xfce4-appfinder #git clone --depth 1 https://github.com/mntmn/xfce4-appfinder
git clone --depth 1 https://github.com/Alexays/Waybar.git git clone --depth 1 https://github.com/Alexays/Waybar.git
cd drm cd drm
meson --reconfigure build -Dplatforms=x11,wayland,drm -Dgallium-drivers=swrast,etnaviv,kmsro,virgl -Dgbm=enabled -Degl=enabled -Ddri3=enabled meson build -Detnaviv=true -Dradeon=false -Damdgpu=false -Dvmwgfx=false -Dfreedreno=false -Dvc4=false -Dnouveau=false
ninja -C build install ninja -C build install
cd .. cd ..
ldconfig ldconfig
cd mesa cd mesa
meson build -Dplatforms=x11,wayland,drm -Ddri3=true -Dgallium-drivers=swrast,etnaviv,kmsro -Dgbm=true -Degl=true meson build -Dplatforms=x11,wayland -Ddri3=true -Dgallium-drivers=swrast,etnaviv,kmsro,virgl -Dgbm=enabled -Degl=enabled
# patch that disables broken MSAA in etnaviv (not yet upstreamed for some reason) # patch that disables broken MSAA in etnaviv (not yet upstreamed for some reason)
patch -p1 <<ENDPATCH patch -p1 <<ENDPATCH
...@@ -117,11 +117,11 @@ meson build -Dxorg=true -Dxwayland=true -Dglamor=true -Dxwayland_eglstream=false ...@@ -117,11 +117,11 @@ meson build -Dxorg=true -Dxwayland=true -Dglamor=true -Dxwayland_eglstream=false
ninja -C build install ninja -C build install
cd .. cd ..
cd xfce4-appfinder #cd xfce4-appfinder
./autogen.sh #./autogen.sh
make -j$(nproc) #make -j$(nproc)
make install #make install
cd .. #cd ..
cd Waybar cd Waybar
meson build meson build
......
...@@ -10,9 +10,10 @@ cleanup=true ...@@ -10,9 +10,10 @@ cleanup=true
# TODO deb-src missing! # TODO deb-src missing!
[Debian] [Debian]
packages=adduser apt apt-utils apt-file bsdmainutils procps gpgv debian-archive-keyring readline-common gnupg cpio init-system-helpers cron manpages netbase groff-base iproute2 ifupdown isc-dhcp-common isc-dhcp-client iptables iputils-ping kmod locales less net-tools netcat-traditional nfacct traceroute curl wget whiptail openssh-server openssh-client nano vim wpasupplicant htop ncdu ntpdate ntp usbutils fbset screen tmux brightnessctl coreutils alsa-utils sudo ca-certificates parted file git ed console-setup console-data unicode-data kbd gpm pciutils cryptsetup unzip telnet busybox lm-sensors systemd libpam-systemd systemd-sysv bash-completion ncurses-term sway grim slurp xwayland xterm xfce4-terminal rofi ircii mesa-utils w3m man-db pulseaudio pavucontrol zlib1g-dev patch expat bison flex libunwind-dev libwayland-dev wayland-protocols libwayland-egl-backend-dev libx11-dev libx11-xcb-dev libxdamage-dev libxfixes-dev libxcb-dri3-dev libxcb-xfixes0-dev libxcb-sync-dev libxrandr-dev libxext-dev libxcb-glx0-dev libxcb-present-dev libxcb-dri2-0-dev gettext autopoint libpixman-1-dev libbsd-dev libxkbfile-dev libxcb-composite0-dev libxcb-xinput-dev libxcb-icccm4-dev libxfont-dev nettle-dev libdbus-1-dev libsystemd-dev libpciaccess-dev llvm-dev libudev-dev libmtdev-dev libevdev-dev libxshmfence-dev xutils-dev libdrm-dev libxxf86vm-dev meson gcc g++ python3-setuptools python3-mako xfonts-utils libepoxy-dev libjson-c-dev libpcre3-dev libpango1.0-dev libxkbcommon-dev libinput-dev autoconf make libtool intltool libxml2-dev libxfce4ui-2-dev libgarcon-1-dev xfce4-dev-tools arc-theme thunar gnome-disk-utility gnome-system-monitor policykit-1 dconf-editor eog evince mpv gedit engrampa connman-gtk gnome-icon-theme breeze-icon-theme fonts-noto-color-emoji libdbusmenu-gtk3-dev libfmt-dev libgirepository1.0-dev libgtkmm-3.0-dev libjsoncpp-dev libmpdclient-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libsigc++-2.0-dev libspdlog-dev gobject-introspection python3-psutil lxpolkit libblockdev-dm2 libblockdev-crypto2 packages=adduser apt apt-utils apt-file bsdmainutils procps gpgv debian-archive-keyring readline-common gnupg cpio init-system-helpers cron manpages netbase groff-base iproute2 ifupdown isc-dhcp-common isc-dhcp-client iptables iputils-ping kmod locales less net-tools netcat-traditional nfacct traceroute curl wget whiptail openssh-server openssh-client nano vim wpasupplicant htop ncdu ntpdate ntp usbutils fbset screen tmux brightnessctl coreutils alsa-utils sudo ca-certificates parted file git ed console-setup console-data unicode-data kbd gpm pciutils cryptsetup unzip telnet busybox lm-sensors systemd libpam-systemd systemd-sysv bash-completion ncurses-term sway grim slurp xwayland xterm xfce4-terminal rofi ircii mesa-utils w3m man-db pulseaudio pavucontrol zlib1g-dev patch expat bison flex libunwind-dev libwayland-dev wayland-protocols libwayland-egl-backend-dev libx11-dev libx11-xcb-dev libxdamage-dev libxfixes-dev libxcb-dri3-dev libxcb-xfixes0-dev libxcb-sync-dev libxrandr-dev libxext-dev libxcb-glx0-dev libxcb-present-dev libxcb-dri2-0-dev gettext autopoint libpixman-1-dev libbsd-dev libxkbfile-dev libxcb-composite0-dev libxcb-xinput-dev libxcb-icccm4-dev libxfont-dev nettle-dev libdbus-1-dev libsystemd-dev libpciaccess-dev llvm-dev libudev-dev libmtdev-dev libevdev-dev libxshmfence-dev xutils-dev libdrm-dev libxxf86vm-dev meson gcc g++ python3-setuptools python3-mako xfonts-utils libepoxy-dev libjson-c-dev libpcre3-dev libpango1.0-dev libxkbcommon-dev libinput-dev autoconf make libtool intltool libxml2-dev libxfce4ui-2-dev libgarcon-1-dev xfce4-dev-tools arc-theme thunar gnome-disk-utility gnome-system-monitor policykit-1 dconf-editor eog evince mpv gedit engrampa connman-gtk gnome-icon-theme breeze-icon-theme fonts-noto-color-emoji libdbusmenu-gtk3-dev libfmt-dev libgirepository1.0-dev libgtkmm-3.0-dev libjsoncpp-dev libmpdclient-dev libnl-3-dev libnl-genl-3-dev libpulse-dev libsigc++-2.0-dev libspdlog-dev gobject-introspection python3-psutil lxpolkit
# libblockdev-dm2 libblockdev-crypto2
# libreoffice libreoffice-gtk3 inkscape firefox-esr emacs grafx2 milkytracker # libreoffice libreoffice-gtk3 inkscape firefox-esr emacs grafx2 milkytracker
source=http://http.debian.net/debian source=http://ftp.de.debian.org/debian
keyring=debian-archive-keyring keyring=debian-archive-keyring
suite=bullseye suite=bullseye
omitdebsrc=false omitdebsrc=false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment