mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-10-10 07:38:02 +00:00
debian: Create local apt repo after build
Provide local APR repository as part of the result in the distribution's build result folder and prepare this folder as a local APT repository for easy install on a target system. Tracked-On: #6688 Signed-off-by: Helmut Buchsbaum <helmut.buchsbaum@opensource.tttech-industrial.com>
This commit is contained in:
committed by
acrnsi-robot
parent
909f6b9219
commit
c231fef961
31
debian/docker/create-apt-repo.sh
vendored
Executable file
31
debian/docker/create-apt-repo.sh
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# helper to create local APT repository includeing all package available in
|
||||
# the docker images's local apt repo
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Call with: $(basename ${BASH_SOURCE[0]}) <path to local apt directory>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $1 ]; then
|
||||
echo "Please create target directory $1 before calling this script!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n ${UID} && -n ${GID} ]]; then
|
||||
addgroup --gid ${GID} docker-build
|
||||
adduser --uid=${UID} --gid=${GID} --disabled-password --gecos '' docker-build
|
||||
else
|
||||
echo "UID/GID not set. Use docker run -e UID=$(id -u) -e GID=$(id -g)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# copy all Debian packages in local APT repo and create local APT repository
|
||||
export HOME=$(echo ~docker-build)
|
||||
sudo -E -u docker-build /bin/bash -c "\
|
||||
cd $1 && cp /opt/apt/*.deb . && \
|
||||
apt-ftparchive packages . > Packages && \
|
||||
cp /opt/apt/.Release.header Release && \
|
||||
apt-ftparchive release . >> Release"
|
||||
|
Reference in New Issue
Block a user