Skip to content

Commit

Permalink
contrib/generate-releases.sh: add WSL routine (.tar.gz)
Browse files Browse the repository at this point in the history
  • Loading branch information
MingcongBai committed Jan 1, 2024
1 parent ec3e1f2 commit 056bf6d
Showing 1 changed file with 90 additions and 68 deletions.
158 changes: 90 additions & 68 deletions contrib/generate-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,82 +20,104 @@ Usage:
}

if [[ $# -eq 0 || "$1" == "--help" || "$1" == "-h" ]]; then
_help_message
exit 0
_help_message
exit 0
fi

export TZ='UTC'

mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}

for i in $@; do
rm -r $i
rm -r $i

if [[ "$RETRO" != "1" ]]; then
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/$i
if [[ "$STAGE2" != "1" ]]; then
echo "Generating mainline release ($i) ..."
aoscbootstrap \
${BRANCH:-stable} $i ${REPO:-https://repo.aosc.io/debs} \
--config /usr/share/aoscbootstrap/config/aosc-mainline.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s \
/usr/share/aoscbootstrap/scripts/reset-repo.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-nvidia-drivers.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-dkms.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
else
echo "Generating mainline release ($i, stage2) ..."
aoscbootstrap \
${ARCH:-$(dpkg --print-architecture)}-bring-up $i ${REPO:-https://repo.aosc.io/debs} \
--config /usr/share/aoscbootstrap/config/aosc-mainline.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s \
/usr/share/aoscbootstrap/scripts/reset-repo.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-nvidia-drivers.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-dkms.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
if [[ "$RETRO" != "1" ]]; then
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/$i
if [[ "$STAGE2" != "1" ]]; then
if [[ "$i" != "wsl" ]]; then
echo "Generating mainline release ($i) ..."
aoscbootstrap \
${BRANCH:-stable} $i ${REPO:-https://repo.aosc.io/debs} \
--config /usr/share/aoscbootstrap/config/aosc-mainline.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s \
/usr/share/aoscbootstrap/scripts/reset-repo.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-nvidia-drivers.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-dkms.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
else
echo "Generating WSL release ..."
aoscbootstrap \
${BRANCH:-stable} $i ${REPO:-https://repo.aosc.io/debs} \
--config /usr/share/aoscbootstrap/config/aosc-mainline.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s \
/usr/share/aoscbootstrap/scripts/reset-repo.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-nvidia-drivers.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-dkms.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/$i/
cd $i
tar czf \
../os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.gz \
*
cd ..
fi
else
echo "Generating mainline release ($i, stage2) ..."
aoscbootstrap \
${ARCH:-$(dpkg --print-architecture)}-bring-up $i ${REPO:-https://repo.aosc.io/debs} \
--config /usr/share/aoscbootstrap/config/aosc-mainline.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s \
/usr/share/aoscbootstrap/scripts/reset-repo.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-nvidia-drivers.sh \
-s \
/usr/share/aoscbootstrap/scripts/enable-dkms.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/$i/aosc-os_${i}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
fi
else
if [[ "$STAGE2" != "1" ]]; then
echo "Generating Retro release ($i) ..."
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}
aoscbootstrap \
${BRANCH:-stable} $i ${REPO:-https://repo.aosc.io/debs-retro} \
--config /usr/share/aoscbootstrap/config/aosc-retro.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s /usr/share/aoscbootstrap/scripts/reset-repo.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
else
echo "Generating Retro release ($i, stage2) ..."
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}
aoscbootstrap \
${ARCH:-$(dpkg --print-architecture)}-bring-up $i ${REPO:-https://repo.aosc.io/debs-retro} \
--config /usr/share/aoscbootstrap/config/aosc-retro.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s /usr/share/aoscbootstrap/scripts/reset-repo.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
fi
fi
else
if [[ "$STAGE2" != "1" ]]; then
echo "Generating Retro release ($i) ..."
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}
aoscbootstrap \
${BRANCH:-stable} $i ${REPO:-https://repo.aosc.io/debs-retro} \
--config /usr/share/aoscbootstrap/config/aosc-retro.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s /usr/share/aoscbootstrap/scripts/reset-repo.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
else
echo "Generating Retro release ($i, stage2) ..."
mkdir -pv os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}
aoscbootstrap \
${ARCH:-$(dpkg --print-architecture)}-bring-up $i ${REPO:-https://repo.aosc.io/debs-retro} \
--config /usr/share/aoscbootstrap/config/aosc-retro.toml \
-x \
--arch ${ARCH:-$(dpkg --print-architecture)} \
-s /usr/share/aoscbootstrap/scripts/reset-repo.sh \
--include-files /usr/share/aoscbootstrap/recipes/$i.lst \
--export-tar os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.tar.xz \
--export-squashfs os-${ARCH:-$(dpkg --print-architecture)}/${i/retro-/}/aosc-os_${i/retro-/}-stage2_$(date +%Y%m%d)_${ARCH:-$(dpkg --print-architecture)}.squashfs
fi
fi
rm -r $i
rm -r $i

# Hack, just to make sure that things are catching up (we observed a weird caching issue on kp920).
sync
sleep 1
# Hack, just to make sure that things are catching up (we observed a weird caching issue on kp920).
sync
sleep 1
done

0 comments on commit 056bf6d

Please sign in to comment.