Skip to content
Open
Changes from 2 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
19 changes: 19 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,22 @@ 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
if [ "$(find /etc/update-motd.d/ -type f | wc -l)" != 2 ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not quite a content change check, if a file is replaced it will pass

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, thanks for this! I updated the test now to actually look at the content.

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