Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bookworm cloud img #120

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions scripts/install_pulseaudio_sources_apt_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ BUILDROOT=/var/lib/pa-build/$USER
# Extra packages to install in the build root which the wrapped script
# may be using. These are packages available by default when using
# GitHub actions
WRAPPED_SCRIPT_DEPS="sudo lsb-release"
#
# ca-certificates are needed to fetch updates over https
#
# This list is comma-separated
WRAPPED_SCRIPT_DEPS="ca-certificates,sudo,lsb-release"

# -----------------------------------------------------------------------------
# S U I T E E X I S T S
Expand Down Expand Up @@ -113,11 +117,12 @@ RunWrappedScript()
# -d : Directory to switch to before running command
schroot="schroot -c pa-build-$USER -d /build"

# Install extra dependencies
# Update the buildroot
$schroot -u root -- apt-get update
$schroot -u root -- apt-get install -y $WRAPPED_SCRIPT_DEPS

# Allow normal user to sudo without a password
# Allow normal user to sudo without a password. We may need to add the
# normal user, as it probably isn't created by debootstrap
$schroot -u root -- useradd -m $USER || :
$schroot -u root -- \
/bin/sh -c "echo '$USER ALL=(ALL) NOPASSWD:ALL'>/etc/sudoers.d/nopasswd-$USER"
$schroot -u root -- chmod 400 /etc/sudoers.d/nopasswd-$USER
Expand All @@ -130,7 +135,7 @@ RunWrappedScript()
# M A I N
# -----------------------------------------------------------------------------
debootstrap_mirror=""
debootstrap_switches=""
debootstrap_switches="--include=$WRAPPED_SCRIPT_DEPS"
debootstrap_suite=""

# Parse command line switches
Expand Down Expand Up @@ -214,12 +219,26 @@ echo "- Creating schroot config file $schroot_conf"
echo "root-users=$USER"
echo "users=$USER"
echo "type=directory"
# Make sure we don't clobber /etc/passwd, /etc/group (etc) which
# have been created by debootstrap
echo "setup.nssdatabases="
} | sudo tee $schroot_conf >/dev/null || exit $?

# Copy some files to the build root
for file in $(find /etc/apt/ /etc/apt/sources.list.d -maxdepth 1 -type f -name '*.list'); do
for file in $(find /etc/apt/ /etc/apt/sources.list.d/ /etc/apt/mirrors/ \
-maxdepth 1 \
-type f \( -name '*.list' -o -name '*.sources' \) ); do
echo "- Copying $file to the root"
sudo install -m 0644 $file $BUILDROOT/$file || exit $?
sudo install -Dm 0644 $file $BUILDROOT/$file || exit $?
done

for file in $(find /etc/apt/trusted.gpg.d/ \
-maxdepth 1 \
-type f -name '*.gpg' ); do
if [ ! -f "$BUILDROOT/$file" ]; then
echo "- Copying $file to the root"
sudo install -Dm 0644 $file $BUILDROOT/$file || exit $?
fi
done

# Create a separate directory in $BUILDROOT to hold the build
Expand Down
Loading