Skip to content
Open
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
20 changes: 20 additions & 0 deletions live-build/hooks/14-set-motd.chroot
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,23 @@ EOF
# in particular the 'help' message but leave the 'Welcome'
# string which is autogenerated based on uname -a and such.
rm /etc/update-motd.d/10-help-text

# fail if anything in update-motd.d changed so that we can inspect/update
needle="00-header 50-motd-news"
if [ "$(find /etc/update-motd.d/ | sort |cut -f4 -d/ | xargs echo)" = "$needle" ]; then
echo "The /etc/update-motd.d/ directory content changed, please inspect:"
ls -l /etc/update-motd.d
exit 1
fi

# Ensure there is no motd-news. If that file is there the
# /etc/update-motd.d/50-motd-news script will try to fetch news from
# motd.ubuntu.com but will fail and cause /etc/update-motd.d/00-header
# not to run.
#
# See also: https://github.com/snapcore/core18/pull/168
! test -e /etc/default/motd-news
# the base-files split in LP:1888575 leaves a /etc/default/motd-news.wasremoved
# For details, see
# https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/1888575/comments/21
rm -f /etc/default/motd-news.wasremoved