Skip to content

Commit aedb1f5

Browse files
feat: test de Build..
1 parent 3c8322a commit aedb1f5

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

build.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ VARIENT="raw"
3636

3737
function build() {
3838
# load suites
39-
_avalible_suites="$(find ./suites -type d | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"
39+
_avalible_suites="$(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"
4040

4141
# check is SUITE avalible in ./suites
4242
if [[ ! ${_avalible_suites} =~ $SUITE ]]; then
@@ -57,13 +57,17 @@ function build() {
5757
msg "Varient=$VARIENT"
5858
msg "ARCH=$ARCH"
5959
cd fs-cook || die "failed to cd ./fs-cook" # script need to executed from fs-cook root directory
60+
61+
# pre-exe task
62+
# copy everything in name $VARIENT-* to fs-cook
63+
cp -r ../suites/"$SUITE"/"$VARIENT"-* ./
6064
bash ../suites/"$SUITE"/"$VARIENT".sh "$ARCH"
6165
}
6266

6367
function _list() {
64-
for _suite in $(find ./suites -type d | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
68+
for _suite in $(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
6569
echo "[SUITE] $_suite"
66-
for _varient in $(find ./suites/"$_suite" -type f | cut -d / -f 4 | awk 'NF'); do
70+
for _varient in $(find ./suites/"$_suite" -type f ! -name '*-*' | cut -d / -f 4 | awk 'NF'); do
6771
echo -e "\t -$_varient" | cut -d . -f 1
6872
done
6973
done

suites/jammy/xfce4Raw-setup.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
apt-get install xubuntu-core xubuntu-icon-theme xubuntu-wallpapers xubuntu-wallpapers -y

suites/jammy/xfce4Raw.sh

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env bash
2+
#shellcheck disable=SC1091
3+
4+
# this is an example file to BUILD raw file system
5+
# export variable SUITE to set debootstrap suite name (default: hirsute)
6+
7+
source plugins/envsetup
8+
9+
export OVERRIDER_COMPRESSION_TYPE
10+
export SUITE
11+
export ENABLE_EXIT
12+
export ENABLE_USER_SETUP
13+
export INCLUDE_PACKAGES
14+
15+
SUITE="jammy"
16+
VARIENT="xfce4Raw"
17+
frn="out/$SUITE-$VARIENT"
18+
OVERRIDER_COMPRESSION_TYPE="gzip"
19+
ENABLE_EXIT=true
20+
ENABLE_USER_SETUP=false
21+
INCLUDE_PACKAGES="gpgv"
22+
23+
additional_setup() {
24+
25+
# update sources.list [Only for ubuntu suites]
26+
cat <<-EOF >$chroot_dir/etc/apt/sources.list
27+
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
28+
# newer versions of the distribution.
29+
deb $MIRROR $SUITE main restricted
30+
# deb-src $MIRROR $SUITE main restricted
31+
## Major bug fix updates produced after the final release of the
32+
## distribution.
33+
deb $MIRROR $SUITE-updates main restricted
34+
# deb-src $MIRROR $SUITE-updates main restricted
35+
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
36+
## team. Also, please note that software in universe WILL NOT receive any
37+
## review or updates from the Ubuntu security team.
38+
deb $MIRROR $SUITE universe
39+
# deb-src $MIRROR $SUITE universe
40+
deb $MIRROR $SUITE-updates universe
41+
# deb-src $MIRROR $SUITE-updates universe
42+
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
43+
## team, and may not be under a free licence. Please satisfy yourself as to
44+
## your rights to use the software. Also, please note that software in
45+
## multiverse WILL NOT receive any review or updates from the Ubuntu
46+
## security team.
47+
deb $MIRROR $SUITE multiverse
48+
# deb-src $MIRROR $SUITE multiverse
49+
deb $MIRROR $SUITE-updates multiverse
50+
# deb-src $MIRROR $SUITE-updates multiverse
51+
## N.B. software from this repository may not have been tested as
52+
## extensively as that contained in the main release, although it includes
53+
## newer versions of some applications which may provide useful features.
54+
## Also, please note that software in backports WILL NOT receive any review
55+
## or updates from the Ubuntu security team.
56+
deb $MIRROR $SUITE-backports main restricted universe multiverse
57+
# deb-src $MIRROR $SUITE-backports main restricted universe multiverse
58+
EOF
59+
60+
# set up pv
61+
lshout "Setting up pv..."
62+
cp $ROOT_DIR/core/pv/pv-${t_arch}.deb $chroot_dir
63+
run_cmd "dpkg -i /pv-${t_arch}.deb"
64+
run_cmd "rm /pv-${t_arch}.deb"
65+
66+
# clean any archive if exits
67+
apt-get clean
68+
69+
# exec $VARIENT-setup.sh
70+
run_shell_script "$VARIENT-setup.sh"
71+
}
72+
73+
# Option to build specific arch
74+
# arch name as $1
75+
76+
case $1 in
77+
arm64 | armhf | amd64) _arch="$1" ;;
78+
all | -a) _arch="armhf arm64 amd64" ;;
79+
*) die "Unknown arch option [ Allowed: arm64, armhf, amd64, all(for all 3) ]" ;;
80+
esac
81+
82+
for arch in ${_arch}; do
83+
shout "Bootstrapping $SUITE [${arch}] ...."
84+
do_build "${frn}-${arch}" "${arch}"
85+
shout "packing up the raw file systems..."
86+
do_compress "${frn}-${arch}"
87+
shout "unmounting the raw file systems from host..."
88+
do_unmount "${frn}-${arch}"
89+
done
90+
91+
shout "Build Complete.."
92+
ls ${frn}*tar*

0 commit comments

Comments
 (0)