From 5ef5a5420ee2f0e9520b60fe745eea2c232404c1 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 12 Nov 2023 20:25:43 +0000 Subject: [PATCH 01/10] Update ynh-dev for amhf wip --- ynh-dev | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ynh-dev b/ynh-dev index a143d0a..ce10cff 100755 --- a/ynh-dev +++ b/ynh-dev @@ -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" From ae2b8b610824ea521421f6325f26dec9013764a4 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 12 Nov 2023 23:39:11 +0000 Subject: [PATCH 02/10] Update ynh-dev armhf wip2 --- ynh-dev | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ynh-dev b/ynh-dev index ce10cff..9201542 100755 --- a/ynh-dev +++ b/ynh-dev @@ -226,22 +226,22 @@ function rebuild_ynhdev() set -x sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force 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 + sudo apt install debootstrap + sudo mkdir -p ~/lxc-images/debian-$DIST + sudo debootstrap $DIST ~/lxc-images/debian-$DIST + sudo tar -cvzf rootfs.tar.gz -C ~/lxc-images/debian-$DIST + sudo cat << EOF > ~/lxc-images/debian-$DIST/metadata.yaml architecture: "armhf" -creation_date: ${date +%s} +creation_date: $(date +%s) properties: architecture: "armhf" -description: "Debian Oldstable (bullseye)" +description: "Debian ($DIST)" 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 + sudo tar -cvzf ~/lxc-images/debian-$DIST/metadata.tar.gz ~/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 else sudo lxc launch images:debian/$DIST/$ARCH $BOX-rebuild -c security.nesting=true -c security.privileged=true fi From d557bd391adc5b994b99044eee312736cc7fbff6 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 12 Nov 2023 23:44:51 +0000 Subject: [PATCH 03/10] Update ynh-dev armhf wip3 --- ynh-dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ynh-dev b/ynh-dev index 9201542..5217458 100755 --- a/ynh-dev +++ b/ynh-dev @@ -226,7 +226,7 @@ function rebuild_ynhdev() set -x sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force if [[ ${ARCH} eq "armhf" ]] - sudo apt install debootstrap + sudo apt install debootstrap -y sudo mkdir -p ~/lxc-images/debian-$DIST sudo debootstrap $DIST ~/lxc-images/debian-$DIST sudo tar -cvzf rootfs.tar.gz -C ~/lxc-images/debian-$DIST From dbad961abe6d84344e32f241f436b276b84b2d95 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sun, 12 Nov 2023 23:54:37 +0000 Subject: [PATCH 04/10] Update ynh-dev armhf wip4 --- ynh-dev | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ynh-dev b/ynh-dev index 5217458..f109d97 100755 --- a/ynh-dev +++ b/ynh-dev @@ -225,19 +225,19 @@ function rebuild_ynhdev() set -x sudo lxc info $BOX-rebuild >/dev/null && sudo lxc delete $BOX-rebuild --force - if [[ ${ARCH} eq "armhf" ]] + if [[ ${ARCH} -eq "armhf" ]] ; + then sudo apt install debootstrap -y sudo mkdir -p ~/lxc-images/debian-$DIST sudo debootstrap $DIST ~/lxc-images/debian-$DIST sudo tar -cvzf rootfs.tar.gz -C ~/lxc-images/debian-$DIST sudo cat << EOF > ~/lxc-images/debian-$DIST/metadata.yaml -architecture: "armhf" creation_date: $(date +%s) properties: -architecture: "armhf" -description: "Debian ($DIST)" +architecture: "$ARCH" +description: "Yunohost Debian ($DIST)" os: "debian" -release: "bullseye" +release: "$DIST" EOF sudo tar -cvzf ~/lxc-images/debian-$DIST/metadata.tar.gz ~/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 From 5570660d7cea8b02cc33ee83a1d1fc1a41743a1d Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 13 Nov 2023 00:06:44 +0000 Subject: [PATCH 05/10] Update ynh-dev armhf wip5 --- ynh-dev | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ynh-dev b/ynh-dev index f109d97..8283183 100755 --- a/ynh-dev +++ b/ynh-dev @@ -228,9 +228,9 @@ function rebuild_ynhdev() if [[ ${ARCH} -eq "armhf" ]] ; then sudo apt install debootstrap -y - sudo mkdir -p ~/lxc-images/debian-$DIST - sudo debootstrap $DIST ~/lxc-images/debian-$DIST - sudo tar -cvzf rootfs.tar.gz -C ~/lxc-images/debian-$DIST + sudo mkdir -p ~/lxc-images/debian-$DIST/img + sudo debootstrap $DIST ~/lxc-images/debian-$DIST/img + sudo tar -cvzf ~/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: From ccdf9691f4a07c0161d8f4a24ec1fb5aa458183e Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 13 Nov 2023 00:33:50 +0000 Subject: [PATCH 06/10] Update ynh-dev armhf wip6 --- ynh-dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ynh-dev b/ynh-dev index 8283183..247fb93 100755 --- a/ynh-dev +++ b/ynh-dev @@ -239,7 +239,7 @@ description: "Yunohost Debian ($DIST)" os: "debian" release: "$DIST" EOF - sudo tar -cvzf ~/lxc-images/debian-$DIST/metadata.tar.gz ~/lxc-images/debian-$DIST/metadata.yaml + sudo tar -cvzf ~/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 else From 2e55f03163a4e7f9ff2d55686f7c2cb526e61b1f Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 13 Nov 2023 00:57:32 +0000 Subject: [PATCH 07/10] Update ynh-dev armhf wip7 --- ynh-dev | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ynh-dev b/ynh-dev index 247fb93..d713223 100755 --- a/ynh-dev +++ b/ynh-dev @@ -230,7 +230,7 @@ function rebuild_ynhdev() sudo apt install debootstrap -y sudo mkdir -p ~/lxc-images/debian-$DIST/img sudo debootstrap $DIST ~/lxc-images/debian-$DIST/img - sudo tar -cvzf ~/lxc-images/debian-$DIST/rootfs.tar.gz -C ~/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: @@ -239,11 +239,18 @@ description: "Yunohost Debian ($DIST)" os: "debian" release: "$DIST" EOF - sudo tar -cvzf ~/lxc-images/debian-$DIST/metadata.tar.gz -C ~/lxc-images/debian-$DIST/ metadata.yaml + 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 -- 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 + 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 From c46ff104ad473e063bf0a17f3a652ac85a3cbe3c Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 13 Nov 2023 16:10:01 +0000 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58c02de..191f57e 100644 --- a/README.md +++ b/README.md @@ -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). From 8a47d099fd3b2a9c595a35569cfeefcc9b377b74 Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Mon, 13 Nov 2023 23:43:30 +0000 Subject: [PATCH 09/10] Update ynh-dev armhf wip8 --- ynh-dev | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ynh-dev b/ynh-dev index bad5662..d0eb0d7 100755 --- a/ynh-dev +++ b/ynh-dev @@ -243,12 +243,11 @@ EOF 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 -- cat << EOF > /etc/network/interfaces.d/eth0 + sudo lxc exec $BOX-rebuild -- bash -c "cat << EOF > /etc/network/interfaces.d/eth0 auto eth0 iface eth0 inet dhcp allow-hotplug eth0 -EOF - +EOF" else sudo lxc launch images:debian/$DIST/$ARCH $BOX-rebuild -c security.nesting=true -c security.privileged=true fi From f40a104a49fa1cb271f938e1a45a83e7978d9b2c Mon Sep 17 00:00:00 2001 From: rosbeef andino Date: Sat, 18 Nov 2023 23:37:47 +0000 Subject: [PATCH 10/10] Update ynh-dev --- ynh-dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ynh-dev b/ynh-dev index d0eb0d7..ff7b96a 100755 --- a/ynh-dev +++ b/ynh-dev @@ -230,7 +230,7 @@ function rebuild_ynhdev() 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 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: