Skip to content

Commit ecdccc4

Browse files
pieroproiettiartisan
andauthored
2024-04-10 Updated ci on github (#558)
* trying to update CI on github * reintroduced sudo * aggiornato perribrewery con sudo * checking again * introduced new 30001.run-on-almalinux.sh as sample * ok * last touch to test almalinux9 --------- Co-authored-by: artisan <artisan@minimal>
1 parent fb466c6 commit ecdccc4

30 files changed

Lines changed: 1252 additions & 696 deletions

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ perrisbrewery/workdir/*
1818
tmp
1919
mkinitcpio/*.img
2020

21+
# pods
2122
pods/ci/*.deb
22-
pods/ci/*.tar.gz
2323
pods/ci/*.pkg.tar.zst
24-
pods/ci/.pnpm*
24+
pods/ci/*.tar.gz
25+
26+
# mychroot
27+
mychroot/ci/*.deb
28+
mychroot/ci/*.pkg.tar.zst
29+
mychroot/ci/*.tar.gz
30+
mychroot/ci/iso/*
2531

26-
mychroot/ci/iso/*.tar.gz
27-
mychroot/ci/iso/*.iso

10000-ubuntu-ci-server.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ whoami
2929
# Ensure these files are preserved for future tests.
3030
npm install -g pnpm@latest-10
3131
pnpm install
32-
pnpm deb -a -r $GITHUB_RUN_NUMBER
33-
pnpm tarballs --release $GITHUB_RUN_NUMBER
34-
rsync -a ./perrisbrewery/workdir/*.deb ./mychroot/ci/
32+
pnpm deb -a
33+
rsync -a ./dist/*.deb ./mychroot/ci/
34+
35+
# tarballs
36+
pnpm tarballs
3537
rsync -a ./dist/*.tar.gz ./mychroot/ci/
3638
ls -al ./mychroot/ci/
3739

10001-build-packages-debs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ podman run \
1717
-v $PWD/mychroot/ci:/ci \
1818
-v /dev:/dev \
1919
debian:12.9 \
20-
/ci/run-build-package-debs.sh
20+
/ci/run-build-packages-debs.sh
2121

2222
df -h
2323
ls -al $PWD/mychroot/ci/iso/

mychroot/ci/30001.run-on-almalinux.sh

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,18 @@ ff02::2 ip6-allrouters
3333
cd $CMD_PATH
3434
dnf -y update
3535

36-
37-
# force install kernel on the Almalinux container
38-
mkdir /boot
39-
dnf -y install kernel
40-
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
41-
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
42-
dracut --force --kver $kernel_version
43-
4436
# packages to be added for a minimum standard installation
45-
#source ./minimal/almalinux-packages.sh
46-
47-
48-
# packages to be added tarballs
49-
source ./minimal/almalinux-tarballs-requirements.sh
50-
51-
# installing ggs
52-
source ./penguins-eggs-tarballs-install.sh
37+
source ./minimal/almalinux-container2host.sh
5338

5439
# test mount -t overlay
55-
source ./overlay-test.sh
40+
source ./kernel-overlay-install.sh
5641

57-
# using eggs
58-
eggs dad -d
59-
eggs tools clean -n
60-
eggs produce --pendrive -n
61-
echo "TIPS use: eggs export iso -c"
42+
# installing eggs
43+
source ./penguins-eggs-install.sh
6244

63-
# save iso to the host server
64-
mv /home/eggs/.mnt/*.iso /ci/iso/
65-
ls -al /ci/iso/
45+
# systemd
46+
systemctl set-default multi-user.target
47+
systemctl enable getty@tty1.service
6648

49+
# execute eggs
50+
source ./penguins-eggs-execute.sh
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
export CMD_PATH=$(cd `dirname $0`; pwd)
5+
export PROJECT_NAME="${CMD_PATH##*/}"
6+
echo $PROJECT_NAME
7+
export NEEDRESTART_MODE=a
8+
export DEBIAN_FRONTEND=noninteractive
9+
10+
####################################################################################################################################
11+
# 1 check
12+
cd $CMD_PATH
13+
env
14+
pwd
15+
whoami
16+
17+
####################################################################################################################################
18+
# 2 hostname
19+
echo -e "$(hostname)\n" > /etc/hostname
20+
21+
# 2.1 hosts
22+
echo -e "\
23+
127.0.0.1 localhost
24+
::1 localhost ip6-localhost ip6-loopback
25+
ff02::1 ip6-allnodes
26+
ff02::2 ip6-allrouters
27+
# This host address
28+
127.0.1.1 $(hostname)" > /etc/hosts
29+
30+
####################################################################################################################################
31+
# penguins-eggs mininal requisites for debian bookworm
32+
33+
cd $CMD_PATH
34+
dnf -y update
35+
36+
37+
# force install kernel on the Almalinux container
38+
mkdir /boot
39+
dnf -y install kernel
40+
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
41+
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
42+
dracut --force --kver $kernel_version
43+
44+
# packages to be added for a minimum standard installation
45+
#source ./minimal/almalinux-packages.sh
46+
47+
48+
# packages to be added tarballs
49+
source ./minimal/almalinux-tarballs-requirements.sh
50+
51+
# installing ggs
52+
source ./penguins-eggs-tarballs-install.sh
53+
54+
# test mount -t overlay
55+
source ./overlay-test.sh
56+
57+
# using eggs
58+
eggs dad -d
59+
eggs tools clean -n
60+
eggs produce --pendrive -n
61+
echo "TIPS use: eggs export iso -c"
62+
63+
# save iso to the host server
64+
mv /home/eggs/.mnt/*.iso /ci/iso/
65+
ls -al /ci/iso/
66+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
export CMD_PATH=$(cd `dirname $0`; pwd)
5+
export PROJECT_NAME="${CMD_PATH##*/}"
6+
export NEEDRESTART_MODE=a
7+
export DEBIAN_FRONTEND=noninteractive
8+
9+
cd $CMD_PATH
10+
11+
if [[ -f /etc/os-release ]]; then
12+
. /etc/os-release
13+
if [[ "$ID" == "almalinux" ]]; then
14+
echo "install the package of capsh"
15+
mkdir /boot
16+
dnf -y install kernel
17+
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
18+
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
19+
dracut --force --kver $kernel_version
20+
21+
elif [[ "$ID" == "arch" ]]; then
22+
echo "install the package of capsh"
23+
pacman -S --needed --noconfirm linux linux-headers
24+
pacman -S --needed --noconfirm libcap
25+
pacman -S --needed --noconfirmkmod
26+
27+
elif [[ "$ID" == "debian" ]]; then
28+
echo "install the package of capsh"
29+
apt update -y
30+
apt install linux-image-amd64 -y
31+
apt install -y kmod
32+
apt install -y libcap2-bin
33+
34+
elif [[ "$ID" == "devuan" ]]; then
35+
echo "install the package of capsh"
36+
apt update -y
37+
apt install linux-image-amd64 -y
38+
apt install -y kmod
39+
apt install -y libcap2-bin
40+
41+
elif [[ "$ID" == "fedora" ]]; then
42+
echo "install the package of capsh"
43+
mkdir /boot
44+
dnf -y install kernel
45+
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
46+
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
47+
dracut --force --kver $kernel_version
48+
49+
elif [[ "$ID" == "manjaro" ]]; then
50+
echo "install the package of capsh"
51+
pacman -S --needed --noconfirm linux linux-headers
52+
pacman -S --needed --noconfirm libcap
53+
pacman -S --needed --noconfirmkmod
54+
55+
elif [[ "$ID" == "opensuse" ]]; then
56+
mkdir /boot
57+
zypper install --force kernel-default kernel-default-devel
58+
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
59+
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
60+
#dracut --force --kver $kernel_version
61+
62+
elif [[ "$ID" == "opensuse-tumbleweed" ]]; then
63+
echo "install the package of capsh"
64+
zypper install -y kernel
65+
zypper install -y libcap-progs
66+
67+
elif [[ "$ID" == "rocky" ]]; then
68+
echo "install the package of capsh"
69+
mkdir /boot
70+
dnf -y install kernel
71+
kernel_version=$(rpm -q kernel --qf "%{VERSION}-%{RELEASE}.%{ARCH}\n" | tail -n 1)
72+
cp /usr/lib/modules/$kernel_version/vmlinuz /boot/vmlinuz-$kernel_version
73+
dracut --force --kver $kernel_version
74+
75+
76+
elif [[ "$ID" == "ubuntu" ]]; then
77+
echo "install the package of capsh"
78+
apt install linux-image-generic -y
79+
apt install -y kmod
80+
apt install -y libcap2-bin
81+
82+
else
83+
echo "distro not supported"
84+
exit 1
85+
fi
86+
fi
87+
88+
grep overlay /proc/filesystems
89+
modprobe overlay
90+
91+
capsh --print
92+
93+
mkdir -p $CMD_PATH/lower $CMD_PATH/upper $CMD_PATH/work $CMD_PATH/merged
94+
95+
# Add test files
96+
echo "Lower File" > $CMD_PATH/lower/test.txt
97+
echo "Upper File" > $CMD_PATH/upper/test.txt
98+
99+
mount -t overlay overlay -o lowerdir=$CMD_PATH/lower,upperdir=$CMD_PATH/upper,workdir=$CMD_PATH/work $CMD_PATH/merged
100+
101+
ls $CMD_PATH/merged
102+
cat $CMD_PATH/merged/test.txt
103+
104+
umount $CMD_PATH/merged
105+
106+
rm -rf $CMD_PATH/lower
107+
rm -rf $CMD_PATH/upper
108+
rm -rf $CMD_PATH/work
109+
rm -rf $CMD_PATH/merged
110+
date

mychroot/ci/list-packages.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)