Update ynh-dev for amhf wip

This commit is contained in:
rosbeef andino 2023-11-12 20:25:43 +00:00 committed by GitHub
parent cd8169bbfe
commit 5ef5a5420e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

25
ynh-dev
View file

@ -173,12 +173,13 @@ function start_ynhdev()
local DIST=${1:-bookworm}
local YNH_BRANCH=${3:-unstable}
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
local ARCH=$(dpkg --print-architecture)
if ! sudo lxc info $BOX &>/dev/null
then
if ! sudo lxc image info $BOX-base &>/dev/null
then
LXC_BASE="ynh-dev-$DIST-amd64-$YNH_BRANCH-base"
LXC_BASE="ynh-dev-$DIST-$ARCH-$YNH_BRANCH-base"
sudo lxc launch yunohost:$LXC_BASE $BOX -c security.nesting=true -c security.privileged=true \
|| critical "Failed to launch the container ?"
else
@ -220,10 +221,30 @@ function rebuild_ynhdev()
local DIST=${1:-bookworm}
local YNH_BRANCH=${3:-unstable}
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
local ARCH=$(dpkg --print-architecture)
set -x
sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force
sudo lxc launch images:debian/$DIST/amd64 $BOX-rebuild -c security.nesting=true -c security.privileged=true
if [[ ${ARCH} eq "armhf" ]]
apt install debootstrap
mkdir ~/lxc-images/debian-bullseye
debootstrap bullseye ~/lxc-images/debian-bullseye
tar -cvzf rootfs.tar.gz -C ~/lxc-images/debian-bullseye
cat << EOF > ~/lxc-images/debian-bullseye/metadata.yaml
architecture: "armhf"
creation_date: ${date +%s}
properties:
architecture: "armhf"
description: "Debian Oldstable (bullseye)"
os: "debian"
release: "bullseye"
EOF
tar -cvzf ~/lxc-images/debian-bullseye/metadata.tar.gz ~/lxc-images/debian-bullseye/metadata.yaml
lxc image import metadata.tar.gz rootfs.tar.gz --alias $BOX-base
lxc launch $BOX-base ynh
else
sudo lxc launch images:debian/$DIST/$ARCH $BOX-rebuild -c security.nesting=true -c security.privileged=true
fi
sleep 5
sudo lxc exec $BOX-rebuild -- apt install curl -y
INSTALL_SCRIPT="https://install.yunohost.org/$DIST"