Added custom /etc/motd to each image (based on a script)

Removed minimal use flag for pambase as it disables motd
This commit is contained in:
Albert Hopkins 2011-07-12 20:15:55 +00:00
parent 71c1b22e6d
commit acef5c4a24
10 changed files with 40 additions and 9 deletions

View File

@ -263,12 +263,13 @@ endif
device-map: $(RAW_IMAGE) device-map: $(RAW_IMAGE)
echo '(hd0) ' $(RAW_IMAGE) > device-map echo '(hd0) ' $(RAW_IMAGE) > device-map
image: software device-map grub.shell grub dev.tar.bz2 image: software device-map grub.shell grub dev.tar.bz2 motd.sh
mkdir -p loop mkdir -p loop
mount -o noatime $(NBD_DEV)p1 loop mount -o noatime $(NBD_DEV)p1 loop
mkdir -p gentoo mkdir -p gentoo
mount -o bind $(CHROOT) gentoo mount -o bind $(CHROOT) gentoo
rsync -ax $(COPY_ARGS) gentoo/ loop/ rsync -ax $(COPY_ARGS) gentoo/ loop/
./motd.sh $(EXTERNAL_KERNEL) $(VIRTIO) $(DISK_SIZE) $(SWAP_SIZE) $(UDEV) $(DASH) $(ARCH) > loop/etc/motd
ifneq ($(EXTERNAL_KERNEL),YES) ifneq ($(EXTERNAL_KERNEL),YES)
loop/sbin/grub --device-map=device-map --no-floppy --batch < grub.shell loop/sbin/grub --device-map=device-map --no-floppy --batch < grub.shell
endif endif

View File

@ -1,6 +1,5 @@
app-editors/nano ncurses app-editors/nano ncurses
dev-lang/python ssl threads xml dev-lang/python ssl threads xml
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal
net-misc/dhcp client net-misc/dhcp client

View File

@ -1,6 +1,5 @@
app-editors/nano ncurses app-editors/nano ncurses
dev-lang/python ssl sqlite threads xml dev-lang/python ssl sqlite threads xml
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal

View File

@ -1,5 +1,4 @@
app-editors/nano ncurses app-editors/nano ncurses
dev-lang/python ssl threads xml dev-lang/python ssl threads xml
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal

View File

@ -2,7 +2,6 @@ app-editors/nano ncurses
dev-lang/python ssl threads xml dev-lang/python ssl threads xml
mail-mta/ssmtp mta mail-mta/ssmtp mta
net-misc/dhcp client net-misc/dhcp client
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal

View File

@ -1,6 +1,5 @@
app-editors/nano ncurses app-editors/nano ncurses
dev-db/sqlite extensions dev-db/sqlite extensions
dev-lang/python sqlite ssl threads xml dev-lang/python sqlite ssl threads xml
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal

38
motd.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# Script for creating the motd on a virtual appliance image
EXTERNAL_KERNEL=$1
VIRTIO=$2
DISK_SIZE=$3
SWAP_SIZE=$4
UDEV=$5
DASH=$6
ARCH=$7
TZ=$TIMEZONE ; export TZ
cat << EOF
Welcome to ${HOSTNAME}!
This system created by Gentoo Virtual Appliance:
https://bitbucket.org/marduk/virtual-appliance/
The system image was built on `date -u +"%Y-%m-%d %H:%M %Z"` based on the "${APPLIANCE}"
appliance. It was built with the following features:
EOF
cat << EOF | column -c80
APPLIANCE: ${APPLIANCE}
ARCH: ${ARCH}
HOSTNAME: ${HOSTNAME}
HEADLESS: ${HEADLESS}
EXTERNAL_KERNEL: ${EXTERNAL_KERNEL}
VIRTIO: ${VIRTIO}
DISK_SIZE: ${DISK_SIZE}
SWAP_SIZE: ${SWAP_SIZE}M
UDEV: ${UDEV}
DASH: ${DASH}
EOF
echo

View File

@ -5,7 +5,6 @@ dev-python/django postgres
media-libs/flac ogg media-libs/flac ogg
media-sound/mpd audiofile ffmpeg flac id3tag lame network ogg vorbis mad sqlite media-sound/mpd audiofile ffmpeg flac id3tag lame network ogg vorbis mad sqlite
media-video/ffmpeg mmx mxext mp3 network x264 media-video/ffmpeg mmx mxext mp3 network x264
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal
virtual/ffmpeg x264 mp3 virtual/ffmpeg x264 mp3

View File

@ -1,5 +1,4 @@
dev-lang/python xml dev-lang/python xml
dev-libs/libxml2 python dev-libs/libxml2 python
sys-auth/pambase minimal
sys-libs/ncurses minimal sys-libs/ncurses minimal
x11-base/xorg-server xorg x11-base/xorg-server xorg

View File

@ -1,7 +1,6 @@
app-editors/nano ncurses app-editors/nano ncurses
dev-lang/python ssl threads xml dev-lang/python ssl threads xml
net-misc/dhcp client net-misc/dhcp client
sys-auth/pambase minimal
sys-kernel/gentoo-sources symlink sys-kernel/gentoo-sources symlink
sys-libs/ncurses minimal sys-libs/ncurses minimal
www-client/firefox bindist www-client/firefox bindist