Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ libvirt or vanilla LXCs**, especially because they all require a daemon based
on DNSmasq and therefore require to listen on port 53.

On a Debian-based system (regular Debian, Ubuntu, Mint ...), LXD can be
installed using `snapd`. On other systems like Archlinux, you will probably also
installed using `snapd` or directly with `apt` since bookworm . On other systems like Archlinux, you will probably also
be able to install `snapd` using the system package manager (or even
`lxd` directly).

Expand Down
31 changes: 29 additions & 2 deletions ynh-dev
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -220,10 +221,36 @@ 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" ]] ;
then
sudo apt install debootstrap -y
sudo mkdir -p ~/lxc-images/debian-$DIST/img
sudo debootstrap $DIST ~/lxc-images/debian-$DIST/img
sudo tar -czf ~/lxc-images/debian-$DIST/rootfs.tar.gz -C ~/lxc-images/debian-$DIST/img .
sudo cat << EOF > ~/lxc-images/debian-$DIST/metadata.yaml
creation_date: $(date +%s)
properties:
architecture: "$ARCH"
description: "Yunohost Debian ($DIST)"
os: "debian"
release: "$DIST"
EOF
sudo tar -czf ~/lxc-images/debian-$DIST/metadata.tar.gz -C ~/lxc-images/debian-$DIST/ metadata.yaml
sudo lxc image import ~/lxc-images/debian-$DIST/metadata.tar.gz ~/lxc-images/debian-$DIST/rootfs.tar.gz --alias $BOX-rebuild
sudo lxc launch $BOX-rebuild $BOX-rebuild -c security.nesting=true -c security.privileged=true
sudo lxc exec $BOX-rebuild -- dhclient
sudo lxc exec $BOX-rebuild -- bash -c "cat << EOF > /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet dhcp
allow-hotplug eth0
EOF"
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"
Expand Down