mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-19 18:01:01 +00:00
Add osbuilder support to build a rootfs and image based on the CBL-Mariner Linux distro Fixes: #6462 Signed-off-by: Dallas Delaney <dadelan@microsoft.com>
27 lines
664 B
Bash
27 lines
664 B
Bash
# Copyright (c) 2023 Microsoft Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
build_rootfs()
|
|
{
|
|
# Mandatory
|
|
local ROOTFS_DIR="$1"
|
|
|
|
[ -z "$ROOTFS_DIR" ] && die "need rootfs"
|
|
|
|
# In case of support EXTRA packages, use it to allow
|
|
# users add more packages to the base rootfs
|
|
local EXTRA_PKGS=${EXTRA_PKGS:-""}
|
|
|
|
check_root
|
|
mkdir -p "${ROOTFS_DIR}"
|
|
PKG_MANAGER="tdnf"
|
|
|
|
DNF="${PKG_MANAGER} -y --installroot=${ROOTFS_DIR} --noplugins --releasever=${OS_VERSION}"
|
|
|
|
info "install packages for rootfs"
|
|
$DNF install ${EXTRA_PKGS} ${PACKAGES}
|
|
|
|
rm -rf ${ROOTFS_DIR}/usr/share/{bash-completion,cracklib,doc,info,locale,man,misc,pixmaps,terminfo,zoneinfo,zsh}
|
|
}
|