mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
> Tips depend on target shell and yours is unknown. Add a shebang. Add ``` #!/usr/bin/env bash ``` Signed-off-by: stevenhorsman <steven@uk.ibm.com>
29 lines
686 B
Bash
29 lines
686 B
Bash
#!/usr/bin/env 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}
|
|
}
|