r4s deployment testing

This commit is contained in:
2023-01-31 10:03:42 -05:00
parent e61493239e
commit 824c23901d
2 changed files with 21 additions and 20 deletions

View File

@@ -614,9 +614,8 @@ fromSource() {
debug "${FUNCNAME[0]}" debug "${FUNCNAME[0]}"
declare src_url="https://github.com/openwrt/openwrt.git" declare src_url="https://github.com/openwrt/openwrt.git"
declare pkg kopt opt commit declare pkg kopt opt commit gitworktreedir seed_file
declare -a make_opts config_opts declare -a make_opts config_opts
declare -g SEED_FILE="$GITWORKTREEDIR/.config"
echo "Building from source is under development" echo "Building from source is under development"
@@ -632,16 +631,23 @@ fromSource() {
debug "commit hash: $commit" debug "commit hash: $commit"
if [[ $RELEASE == "snapshot" ]]; then if [[ $RELEASE == "snapshot" ]]; then
git -C "$GITSRCDIR" worktree add -d "$GITWORKTREEDIR" master gitworktreedir="$SRCDIR/$profile/$RELEASE-$commit"
git -C "$GITSRCDIR" worktree add -d "$gitworktreedir" master
else else
git -C "$GITSRCDIR" worktree add -d "$GITWORKTREEDIR" "v$RELEASE" gitworktreedir="$SRCDIR/$profile/$RELEASE"
git -C "$GITSRCDIR" worktree add -d "$gitworktreedir" "v$RELEASE"
fi fi
pushd "$GITWORKTREEDIR" &>/dev/null || return 1 seed_file="$gitworktreedir/.config"
debug "gitworktreedir: $gitworktreedir"
debug "seed_file: $seed_file"
pushd "$gitworktreedir" &>/dev/null || return 1
# Grab the release seed config # Grab the release seed config
if ! curl -so "$SEED_FILE" "$SEED_URL"; then if ! curl -so "$seed_file" "$SEED_URL"; then
echo "Could not obtain $SEED_FILE from $SEED_URL" echo "Could not obtain $seed_file from $SEED_URL"
return 1 return 1
fi fi
@@ -663,7 +669,7 @@ fromSource() {
done done
# Only compile selected fs # Only compile selected fs
sed -i '/CONFIG_TARGET_ROOTFS_/d' "$SEED_FILE" sed -i '/CONFIG_TARGET_ROOTFS_/d' "$seed_file"
config_opts+=("CONFIG_TARGET_PER_DEVICE_ROOTFS=n") config_opts+=("CONFIG_TARGET_PER_DEVICE_ROOTFS=n")
if [[ $FILESYSTEM == "squashfs" ]]; then if [[ $FILESYSTEM == "squashfs" ]]; then
config_opts+=("CONFIG_TARGET_ROOTFS_EXT4FS=n") config_opts+=("CONFIG_TARGET_ROOTFS_EXT4FS=n")
@@ -674,7 +680,7 @@ fromSource() {
fi fi
# Only compile selected target # Only compile selected target
sed -i '/CONFIG_TARGET_DEVICE_/d' "$SEED_FILE" sed -i '/CONFIG_TARGET_DEVICE_/d' "$seed_file"
config_opts+=("CONFIG_TARGET_MULTI_PROFILE=n") config_opts+=("CONFIG_TARGET_MULTI_PROFILE=n")
config_opts+=("CONFIG_TARGET_PROFILE=DEVICE_${P_ARR[profile]}") config_opts+=("CONFIG_TARGET_PROFILE=DEVICE_${P_ARR[profile]}")
config_opts+=("CONFIG_TARGET_${P_ARR[target]//\//_}_DEVICE_${P_ARR[profile]}=y") config_opts+=("CONFIG_TARGET_${P_ARR[target]//\//_}_DEVICE_${P_ARR[profile]}=y")
@@ -685,8 +691,8 @@ fromSource() {
# Write options to config seed file # Write options to config seed file
for opt in "${config_opts[@]}"; do for opt in "${config_opts[@]}"; do
debug "Writing $opt to $SEED_FILE" debug "Writing $opt to $seed_file"
echo "$opt" >> "$SEED_FILE" echo "$opt" >> "$seed_file"
done done
# Update package feed # Update package feed
@@ -726,10 +732,11 @@ fromSource() {
# Make the output tree match Image Builder's (non-destructively) # Make the output tree match Image Builder's (non-destructively)
linkSourceImage() { linkSourceImage() {
debug "${FUNCNAME[0]}"
declare out_file declare out_file
declare -a out_files=("$THIS_BINDIR/targets/${P_ARR[target]}/"*.{img,img.gz,ubi}) declare -a out_files=("$THIS_BINDIR/targets/${P_ARR[target]}/"*.{img,img.gz,ubi})
for out_file in "${out_files[@]}"; do for out_file in "${out_files[@]}"; do
[[ -f $out_file ]] && ln -s "$out_file" "$THIS_BINDIR/${out_file##*/}" [[ -f $out_file ]] && ln -fs "$out_file" "$THIS_BINDIR/${out_file##*/}"
done done
} }
@@ -859,9 +866,7 @@ main() {
declare -g SOURCESYSUPGRADEIMG="$THIS_BINDIR/targets/$img_fname-sysupgrade.img" declare -g SOURCESYSUPGRADEIMG="$THIS_BINDIR/targets/$img_fname-sysupgrade.img"
declare -g SOURCESYSUPGRADEIMGGZ="$THIS_BINDIR/targets/$img_fname-sysupgrade.img.gz" declare -g SOURCESYSUPGRADEIMGGZ="$THIS_BINDIR/targets/$img_fname-sysupgrade.img.gz"
declare -g SOURCESYSUPGRADEIMGGZFNAME="${SOURCESYSUPGRADEIMGGZ##*/}" declare -g SOURCESYSUPGRADEIMGGZFNAME="${SOURCESYSUPGRADEIMGGZ##*/}"
declare -g GITWORKTREEDIR="$SRCDIR/$profile/$RELEASE"
declare -g SEED_URL="$url_prefix/config.buildinfo" declare -g SEED_URL="$url_prefix/config.buildinfo"
declare -g SEED_FILE="$GITWORKTREEDIR/.config"
if (( DEBUG )); then if (( DEBUG )); then
echo "Profile settings:" echo "Profile settings:"
@@ -882,7 +887,6 @@ main() {
IB_URL=$IB_URL IB_URL=$IB_URL
IB_ARCHIVE=$IB_ARCHIVE IB_ARCHIVE=$IB_ARCHIVE
SEED_URL=$SEED_URL SEED_URL=$SEED_URL
SEED_FILE=$SEED_FILE
IB_SHA256_URL=$IB_SHA256_URL IB_SHA256_URL=$IB_SHA256_URL
IB_SHA256_FILE=$IB_SHA256_FILE IB_SHA256_FILE=$IB_SHA256_FILE
IB_OUT_SHA256_FILE=$IB_OUT_SHA256_FILE IB_OUT_SHA256_FILE=$IB_OUT_SHA256_FILE
@@ -895,7 +899,6 @@ main() {
SOURCESYSUPGRADEIMG=$SOURCESYSUPGRADEIMG SOURCESYSUPGRADEIMG=$SOURCESYSUPGRADEIMG
SOURCESYSUPGRADEIMGGZ=$SOURCESYSUPGRADEIMGGZ SOURCESYSUPGRADEIMGGZ=$SOURCESYSUPGRADEIMGGZ
SOURCESYSUPGRADEIMGGZFNAME=$SOURCESYSUPGRADEIMGGZFNAME SOURCESYSUPGRADEIMGGZFNAME=$SOURCESYSUPGRADEIMGGZFNAME
GITWORKTREEDIR=$GITWORKTREEDIR
EOF EOF
fi fi

View File

@@ -14,10 +14,10 @@ default_packages="\
iperf3 \ iperf3 \
bash \ bash \
rsync \ rsync \
openssh-sftp-server \
luci-app-wireguard \ luci-app-wireguard \
luci-proto-wireguard \ luci-proto-wireguard \
luci-app-statistics \ luci-app-statistics \
luci-app-attendedsysupgrade \
collectd-mod-sensors \ collectd-mod-sensors \
collectd-mod-thermal \ collectd-mod-thermal \
collectd-mod-conntrack \ collectd-mod-conntrack \
@@ -90,8 +90,6 @@ r4s['filesystem']="ext4"
r4s['packages']="\ r4s['packages']="\
$default_packages \ $default_packages \
luci-app-upnp \ luci-app-upnp \
luci-app-wireguard \
luci-proto-wireguard \
luci-app-ddns \ luci-app-ddns \
luci-app-sqm \ luci-app-sqm \
irqbalance \ irqbalance \