mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
Update ynh-dev for amhf wip
This commit is contained in:
parent
cd8169bbfe
commit
5ef5a5420e
1 changed files with 23 additions and 2 deletions
25
ynh-dev
25
ynh-dev
|
@ -173,12 +173,13 @@ function start_ynhdev()
|
||||||
local DIST=${1:-bookworm}
|
local DIST=${1:-bookworm}
|
||||||
local YNH_BRANCH=${3:-unstable}
|
local YNH_BRANCH=${3:-unstable}
|
||||||
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
|
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
|
||||||
|
local ARCH=$(dpkg --print-architecture)
|
||||||
|
|
||||||
if ! sudo lxc info $BOX &>/dev/null
|
if ! sudo lxc info $BOX &>/dev/null
|
||||||
then
|
then
|
||||||
if ! sudo lxc image info $BOX-base &>/dev/null
|
if ! sudo lxc image info $BOX-base &>/dev/null
|
||||||
then
|
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 \
|
sudo lxc launch yunohost:$LXC_BASE $BOX -c security.nesting=true -c security.privileged=true \
|
||||||
|| critical "Failed to launch the container ?"
|
|| critical "Failed to launch the container ?"
|
||||||
else
|
else
|
||||||
|
@ -220,10 +221,30 @@ function rebuild_ynhdev()
|
||||||
local DIST=${1:-bookworm}
|
local DIST=${1:-bookworm}
|
||||||
local YNH_BRANCH=${3:-unstable}
|
local YNH_BRANCH=${3:-unstable}
|
||||||
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
|
local BOX=${2:-ynh-dev}-${DIST}-${YNH_BRANCH}
|
||||||
|
local ARCH=$(dpkg --print-architecture)
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force
|
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
|
sleep 5
|
||||||
sudo lxc exec $BOX-rebuild -- apt install curl -y
|
sudo lxc exec $BOX-rebuild -- apt install curl -y
|
||||||
INSTALL_SCRIPT="https://install.yunohost.org/$DIST"
|
INSTALL_SCRIPT="https://install.yunohost.org/$DIST"
|
||||||
|
|
Loading…
Add table
Reference in a new issue