Skip to content

Commit

Permalink
Support inserting certificate into mix
Browse files Browse the repository at this point in the history
Signed-off-by: Tudor Marcu <[email protected]>
  • Loading branch information
tmarcu committed Oct 3, 2016
1 parent 6c0ef19 commit c79880b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build-chroots.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ function strip_whitespace {
if [[ ! -z $BUILDERCONF ]]; then
STATE_DIR=$(grep STATE_DIR "$BUILDERCONF" | cut -d "=" -f2 | strip_whitespace)
YUM_CONF=$(grep YUM_CONF "$BUILDERCONF" | cut -d "=" -f2 | strip_whitespace)
CERT=$(grep CERT "$BUILDERCONF" | cut -d "=" -f2 | strip_whitespace)
elif [ -e "/etc/bundle-chroot-builder/builder.conf" ]; then
STATE_DIR=$(grep STATE_DIR "/etc/bundle-chroot-builder/builder.conf" | cut -d "=" -f2 | strip_whitespace)
YUM_CONF=$(grep YUM_CONF "/etc/bundle-chroot-builder/builder.conf" | cut -d "=" -f2 | strip_whitespace)
CERT=$(grep CERT "/etc/bundle-chroot-builder/builder.conf"| cut -d "=" -f2 | strip_whitespace)
else
STATE_DIR=$(grep STATE_DIR "/usr/share/defaults/bundle-chroot-builder/builder.conf" | cut -d "=" -f2 | strip_whitespace)
YUM_CONF=$(grep YUM_CONF "/usr/share/defaults/bundle-chroot-builder/builder.conf" | cut -d "=" -f2 | strip_whitespace)
CERT=$(grep CERT "/usr/share/defaults/bundle-chroot-builder/builder.conf" | cut -d "=" -f2 | strip_whitespace)
fi

if [ "$BUILDTYPE" = "clear" ]; then
Expand Down Expand Up @@ -103,6 +106,12 @@ else
sudo -E sh -c "LD_PRELOAD=/usr/lib64/nosync/nosync.so $BUILDERSCRIPT -m $BUILDVER $CLRVER"
fi

# insert the certificate needed for signing verification
if [ ! -z $CERT ]; then
echo -e "Installing certificate\n"
sudo cp $CERT "$STATE_DIR/image/$BUILDVER/os-core-update/usr/share/clear/update-ca/"
fi

# clean up the files-* entries since they are now copied into the webdir noship
for i in $(ls $STATE_DIR/image/$MIXVER | grep files-*);
do
Expand Down

0 comments on commit c79880b

Please sign in to comment.