Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(24.04): add erlang slices #384

Merged
merged 6 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions slices/erlang-asn1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: erlang-asn1

essential:
- erlang-asn1_copyright

slices:
modules:
essential:
- erlang-base_bins
- libc6_libs
contents:
/usr/lib/erlang/lib/asn1-*/ebin/**:
/usr/lib/erlang/lib/asn1-*/priv/**:
linostar marked this conversation as resolved.
Show resolved Hide resolved

copyright:
contents:
/usr/share/doc/erlang-asn1/copyright:
44 changes: 44 additions & 0 deletions slices/erlang-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package: erlang-base

essential:
- erlang-base_copyright

slices:
bins:
essential:
- bash_bins
- coreutils_bins
- erlang-base_modules
- libc6_libs
- libgcc-s1_libs
- libreadline8t64_libs
linostar marked this conversation as resolved.
Show resolved Hide resolved
- libstdc++6_libs
- libsystemd0_libs
- libtinfo6_libs
- zlib1g_libs
contents:
/usr/bin/epmd:
/usr/bin/erl:
/usr/bin/erl_call:
/usr/bin/erlc:
/usr/bin/escript:
/usr/bin/run_erl:
/usr/bin/start_embedded:
/usr/bin/to_erl:
/usr/lib/erlang/bin/**:
/usr/lib/erlang/erts-*/bin/**:
/usr/lib/erlang/lib/erl_interface-*/bin/erl_call:

modules:
contents:
/usr/lib/erlang/lib/compiler-*/ebin/**:
/usr/lib/erlang/lib/erts-*/ebin/**:
/usr/lib/erlang/lib/kernel-*/ebin/**:
/usr/lib/erlang/lib/sasl-*/ebin/**:
/usr/lib/erlang/lib/stdlib-*/ebin/**:
/usr/lib/erlang/lib/stdlib-*/include/**:
/usr/lib/erlang/releases/**:
linostar marked this conversation as resolved.
Show resolved Hide resolved

copyright:
contents:
/usr/share/doc/erlang-base/copyright:
18 changes: 18 additions & 0 deletions slices/erlang-crypto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: erlang-crypto

essential:
- erlang-crypto_copyright

slices:
modules:
essential:
- erlang-base_bins
- libc6_libs
- libssl3t64_libs
contents:
/usr/lib/erlang/lib/crypto-*/ebin/**:
/usr/lib/erlang/lib/crypto-*/priv/lib/**:
linostar marked this conversation as resolved.
Show resolved Hide resolved

copyright:
contents:
/usr/share/doc/erlang-crypto/copyright:
17 changes: 17 additions & 0 deletions slices/erlang-eldap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: erlang-eldap

essential:
- erlang-eldap_copyright

slices:
modules:
essential:
- erlang-asn1_modules
linostar marked this conversation as resolved.
Show resolved Hide resolved
- erlang-base_bins
- erlang-ssl_modules
contents:
/usr/lib/erlang/lib/eldap-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-eldap/copyright:
17 changes: 17 additions & 0 deletions slices/erlang-ftp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: erlang-ftp

essential:
- erlang-ftp_copyright

slices:
modules:
essential:
- erlang-base_bins
- erlang-runtime-tools_modules
- erlang-ssl_modules
contents:
/usr/lib/erlang/lib/ftp-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-ftp/copyright:
27 changes: 27 additions & 0 deletions slices/erlang-inets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package: erlang-inets

essential:
- erlang-inets_copyright

slices:
scripts:
essential:
- erlang-inets_modules
contents:
/usr/lib/erlang/lib/inets-*/priv/bin/runcgi.sh:
linostar marked this conversation as resolved.
Show resolved Hide resolved

modules:
essential:
- erlang-base_bins
- erlang-ftp_modules
- erlang-mnesia_modules
- erlang-runtime-tools_modules
- erlang-ssl_modules
- erlang-tftp_modules
contents:
/usr/lib/erlang/lib/inets-*/ebin/**:
/usr/lib/erlang/lib/inets-*/include/**:

copyright:
contents:
/usr/share/doc/erlang-inets/copyright:
15 changes: 15 additions & 0 deletions slices/erlang-mnesia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: erlang-mnesia

essential:
- erlang-mnesia_copyright

slices:
modules:
essential:
- erlang-base_bins
linostar marked this conversation as resolved.
Show resolved Hide resolved
contents:
/usr/lib/erlang/lib/mnesia-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-mnesia/copyright:
24 changes: 24 additions & 0 deletions slices/erlang-os-mon.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package: erlang-os-mon

essential:
- erlang-os-mon_copyright

slices:
bins:
essential:
- erlang-os-mon_modules
contents:
/usr/lib/erlang/lib/os_mon-*/priv/**:

modules:
essential:
- erlang-base_bins
- erlang-mnesia_modules
- erlang-snmp_bins
- libc6_libs
contents:
/usr/lib/erlang/lib/os_mon-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-os-mon/copyright:
15 changes: 15 additions & 0 deletions slices/erlang-parsetools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: erlang-parsetools

essential:
- erlang-parsetools_copyright

slices:
modules:
essential:
- erlang-base_bins
contents:
/usr/lib/erlang/lib/parsetools-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-parsetools/copyright:
17 changes: 17 additions & 0 deletions slices/erlang-public-key.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: erlang-public-key

essential:
- erlang-public-key_copyright

slices:
modules:
essential:
- erlang-asn1_modules
- erlang-base_bins
- erlang-crypto_modules
contents:
/usr/lib/erlang/lib/public_key-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-public-key/copyright:
18 changes: 18 additions & 0 deletions slices/erlang-runtime-tools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: erlang-runtime-tools

essential:
- erlang-runtime-tools_copyright

slices:
modules:
essential:
- erlang-base_bins
- erlang-mnesia_modules
- libc6_libs
contents:
/usr/lib/erlang/lib/runtime_tools-*/ebin/**:
/usr/lib/erlang/lib/runtime_tools-*/priv/**:
linostar marked this conversation as resolved.
Show resolved Hide resolved

copyright:
contents:
/usr/share/doc/erlang-runtime-tools/copyright:
36 changes: 36 additions & 0 deletions slices/erlang-snmp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package: erlang-snmp

essential:
- erlang-snmp_copyright

slices:
bins:
essential:
- erlang-base_bins
- erlang-crypto_modules
- erlang-mnesia_modules
- erlang-runtime-tools_modules
- erlang-snmp_config
- erlang-snmp_data
- erlang-snmp_modules
contents:
/usr/bin/snmpc:
/usr/lib/erlang/lib/snmp-*/bin/snmpc:

config:
contents:
/usr/lib/erlang/lib/snmp-*/priv/conf/**:

data:
contents:
/usr/lib/erlang/lib/snmp-*/mibs/**:
/usr/lib/erlang/lib/snmp-*/priv/mibs/**:

modules:
contents:
/usr/lib/erlang/lib/snmp-*/ebin/**:
/usr/lib/erlang/lib/snmp-*/include/**:

copyright:
contents:
/usr/share/doc/erlang-snmp/copyright:
18 changes: 18 additions & 0 deletions slices/erlang-ssl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: erlang-ssl

essential:
- erlang-ssl_copyright

slices:
modules:
essential:
- erlang-base_bins
- erlang-crypto_modules
- erlang-public-key_modules
- erlang-runtime-tools_modules
contents:
/usr/lib/erlang/lib/ssl-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-ssl/copyright:
16 changes: 16 additions & 0 deletions slices/erlang-syntax-tools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package: erlang-syntax-tools

essential:
- erlang-syntax-tools_copyright

slices:
modules:
essential:
- erlang-base_bins
contents:
/usr/lib/erlang/lib/syntax_tools-*/ebin/**:
/usr/lib/erlang/lib/syntax_tools-*/include/**:

copyright:
contents:
/usr/share/doc/erlang-syntax-tools/copyright:
15 changes: 15 additions & 0 deletions slices/erlang-tftp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: erlang-tftp

essential:
- erlang-tftp_copyright

slices:
modules:
essential:
- erlang-base_bins
contents:
/usr/lib/erlang/lib/tftp-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-tftp/copyright:
18 changes: 18 additions & 0 deletions slices/erlang-tools.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: erlang-tools

essential:
- erlang-tools_copyright

slices:
modules:
essential:
- erlang-base_bins
- erlang-runtime-tools_modules
contents:
/usr/lib/erlang/lib/tools-*/ebin/**:
/usr/lib/erlang/lib/tools-*/emacs/**:
linostar marked this conversation as resolved.
Show resolved Hide resolved
/usr/lib/erlang/lib/tools-*/priv/**:

copyright:
contents:
/usr/share/doc/erlang-tools/copyright:
15 changes: 15 additions & 0 deletions slices/erlang-xmerl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: erlang-xmerl

essential:
- erlang-xmerl_copyright

slices:
modules:
essential:
- erlang-base_bins
contents:
/usr/lib/erlang/lib/xmerl-*/ebin/**:

copyright:
contents:
/usr/share/doc/erlang-xmerl/copyright:
27 changes: 27 additions & 0 deletions tests/spread/integration/erlang/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
summary: Integration tests for Erlang

execute: |
rootfs="$(install-slices erlang-base_bins erlang-inets_scripts erlang-os-mon_bins erlang-crypto_modules erlang-eldap_modules erlang-mnesia_modules erlang-parsetools_modules erlang-public-key_modules erlang-runtime-tools_modules erlang-ssl_modules erlang-syntax-tools_modules erlang-tools_modules erlang-xmerl_modules base-files_base bash_bins coreutils_bins)"
linostar marked this conversation as resolved.
Show resolved Hide resolved

mkdir -p "$rootfs"/bin "$rootfs"/etc "$rootfs"/dev "$rootfs"/root
cp /bin/sh "$rootfs"/bin/
cp /etc/resolv.conf "$rootfs"/etc/
cp /etc/nsswitch.conf "$rootfs"/etc/
touch "$rootfs"/dev/null
chmod 777 "$rootfs"/dev/null
echo "cookie" > "$rootfs"/root/.erlang.cookie
chroot "$rootfs" chmod 400 /root/.erlang.cookie
linostar marked this conversation as resolved.
Show resolved Hide resolved
# test epmd daemon
chroot "$rootfs" /usr/bin/epmd -daemon
# test erl eval
chroot "$rootfs" /usr/bin/erl -noshell -eval 'io:format("Erlang OK~n"), halt().' | grep "Erlang OK"
# test escript by executing a simple script
echo '#!/usr/bin/escript' > test_script
echo 'main(_) -> io:format("escript OK~n").' >> test_script
chmod +x test_script
mv test_script "$rootfs"
chroot "$rootfs" /usr/bin/escript test_script
# test start_embedded to start the embedded environment
chroot "$rootfs" /usr/bin/start_embedded
# test runcgi.sh from erlang-inets
chroot "$rootfs" /usr/lib/erlang/lib/inets-8.3.1.2/priv/bin/runcgi.sh /bin
Loading