I don’t know how many would use this but I haven’t seen much of these posts so I thought I share it. Someone might want it.
prereq: knowledge of how to build your custom iso with autoinstall.
I made this script called pre-install-wallpaper.sh that runs from early-commands section in autoinstall. The script will draw some infotext onto a wallpaper image (like model, ip, os version, kernel, asset tag, hostname)
the file cdrom/files/ubuntu-deployment.png is a custom wallpaper that replaces the default wallpaper during the installation.
#!/bin/bash
# updating repos
apt update
# dependencies
sudo apt install -y libglib2.0-dev-bin
sudo apt install -y imagemagick # for writing the image
sudo apt install -y curl # for grabbing info about network
# All variables
vKernel=$(uname -r)
vUbuntuversion=$(lsb_release -d | cut -d' ' -f2)
vModel=$(sudo dmidecode -s system-product-name)
vIp=$(curl ipinfo.io | grep "ip" | cut -d: -f2 | head -n1 | cut -c3-16 | sed 's/"//g')
vOrg=$(curl ipinfo.io | grep "org" | cut -d: -f2 | sed 's/,//g'| sed 's/"//g')
vHostName=$(grep -oP '(?<=hostname: ).*' /autoinstall.yaml)
vAsset_tag=$(dmidecode | grep -A 6 "Asset Tag" | grep -m 2 "Asset Tag" | tail -n 1 | awk -F ': ' '{print $2}')
#
# Create Wallpaper image
convert /cdrom/files/ubuntu-deployment.png -pointsize 40 -fill white -draw "text 1450,270 ' ${vHostName} '" \
-pointsize 15 -fill white -draw "text 1450,310 'Model: ${vModel}'" \
-pointsize 15 -fill white -draw "text 1450,330 'Asset: ${vAsset_tag}'" \
-pointsize 15 -fill white -draw "text 1450,350 'OS: Ubuntu ${vUbuntuversion} (${vKernel})'" \
-pointsize 15 -fill white -draw "text 1450,370 'IPv4: ${vIp}'" \
-pointsize 15 -fill white -draw "text 1450,390 'Net:${vOrg}'" \
-pointsize 15 -fill white -draw "text 1450,230 'System:'" /usr/share/backgrounds/warty-final-ubuntu.png
so in my yaml file it would look like this
# EARLY COMMANDS
early-commands:
- bash /cdrom/nocloud/scripts/pre-install-wallpaper.sh
I hope this helps someone.