All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Michal Orzel <michal.orzel@amd.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [PATCH v2 4/7] Shrink the rootfs substantially
Date: Mon, 14 Apr 2025 13:25:18 +0200	[thread overview]
Message-ID: <Z_zwnpmO_6VLwoMM@mail-itl> (raw)
In-Reply-To: <20250414101843.2348330-5-andrew.cooper3@citrix.com>

[-- Attachment #1: Type: text/plain, Size: 3256 bytes --]

On Mon, Apr 14, 2025 at 11:18:40AM +0100, Andrew Cooper wrote:
> bash, busybox, musl and zlib are all in the base container.
> 
> python3 and ncurses are in principle used by bits of Xen, but not in anything
> we test in CI.  argp-standlone, curl, dbus, libfdt, libgcc and sudo aren't
> used at all (for x86 at least).
> 
> libbz2 and libuuid were pulled in transitively before, and need to be included
> explicitly now.
> 
> Use apk --no-cache to avoid keeping a ~2M package index on disk.
> 
> Remove the modules scan on boot.  We don't have or build any.  This removes a
> chunk of warnings on boot.

Strictly speaking there is xen-argo.ko, but that's handled manually
anyway, so probably not worth mentioning.

> This shrinks the rootfs from ~30M down to ~8M.
> 
> No practical change.

This also adds some preparation (the case on `uname -m`) for ARM64
rootfs, would be nice to mention it too. Especially since libfdt removed
here will be re-added for ARM.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Doug Goldstein <cardoe@cardoe.com>
> CC: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  scripts/alpine-rootfs.sh | 60 +++++++++++++++++++++++-----------------
>  1 file changed, 34 insertions(+), 26 deletions(-)
> 
> diff --git a/scripts/alpine-rootfs.sh b/scripts/alpine-rootfs.sh
> index 75e2f8648ce5..72c29e0a0a13 100755
> --- a/scripts/alpine-rootfs.sh
> +++ b/scripts/alpine-rootfs.sh
> @@ -4,33 +4,42 @@ set -eu
>  
>  WORKDIR="${PWD}"
>  COPYDIR="${WORKDIR}/binaries"
> +UNAME=$(uname -m)
>  
> -apk update
> +apk --no-cache update

This is no-op, no? IIUC the only thing `apk update` does is updating the
cache, which you disabled...

> -# xen runtime deps
> -apk add musl
> -apk add libgcc
> -apk add openrc
> -apk add busybox
> -apk add sudo
> -apk add dbus
> -apk add bash
> -apk add python3
> -apk add zlib
> -apk add lzo
> -apk add ncurses
> -apk add yajl
> -apk add libaio
> -apk add xz
> -apk add util-linux
> -apk add argp-standalone
> -apk add libfdt
> -apk add glib
> -apk add pixman
> -apk add curl
> -apk add udev
> -apk add pciutils
> -apk add libelf
> +PKGS=(
> +    # System
> +    openrc
> +    udev
> +    util-linux
> +
> +    # Xen toolstack runtime deps
> +    libbz2
> +    libuuid
> +    lzo
> +    xz
> +    yajl
> +
> +    # QEMU
> +    glib
> +    libaio
> +    pixman
> +    )
> +
> +case $UNAME in
> +    x86_64)
> +        PKGS+=(
> +            # System
> +            pciutils
> +
> +            # QEMU
> +            libelf
> +            )
> +        ;;
> +esac
> +
> +apk add --no-cache "${PKGS[@]}"
>  
>  # Xen
>  cd /
> @@ -45,7 +54,6 @@ rc-update add dmesg sysinit
>  rc-update add hostname boot
>  rc-update add hwclock boot
>  rc-update add hwdrivers sysinit
> -rc-update add modules boot
>  rc-update add killprocs shutdown
>  rc-update add mount-ro shutdown
>  rc-update add savecache shutdown
> -- 
> 2.39.5
> 

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-04-14 11:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 10:18 [PATCH TEST-ARTEFACTS v2 0/7] Rootfs/argo cleanup and microcode support Andrew Cooper
2025-04-14 10:18 ` [PATCH v2 1/7] Rename and adjust x86 containers Andrew Cooper
2025-04-14 11:12   ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 2/7] Overhaul how Argo is built and packged Andrew Cooper
2025-04-14 10:35   ` Marek Marczykowski-Górecki
2025-04-14 10:38     ` Andrew Cooper
2025-04-14 10:55   ` Daniel P. Smith
2025-04-15 23:48   ` Stefano Stabellini
2025-04-16 10:15     ` Andrew Cooper
2025-04-16 10:21       ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 3/7] Rework rootfs generation to make a cpio archive Andrew Cooper
2025-04-14 11:15   ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 4/7] Shrink the rootfs substantially Andrew Cooper
2025-04-14 11:25   ` Marek Marczykowski-Górecki [this message]
2025-04-14 11:35     ` Andrew Cooper
2025-04-14 11:52   ` [PATCH v2.1 " Andrew Cooper
2025-04-14 14:22     ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 5/7] Adjust directory layout for rootfs.cpio.gz Andrew Cooper
2025-04-14 14:21   ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 6/7] Provide an ARM64 rootfs too Andrew Cooper
2025-04-14 14:23   ` Marek Marczykowski-Górecki
2025-04-14 10:18 ` [PATCH v2 7/7] Package microcode for the x86 hardware runners Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_zwnpmO_6VLwoMM@mail-itl \
    --to=marmarek@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=cardoe@cardoe.com \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.