Added splash screen changes

This commit is contained in:
Source4Learn
2021-08-13 21:48:56 +05:30
parent be3171e551
commit 0c63ee09d1
8 changed files with 83 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
# Cache objects
packer-builder-arm-image
packer_cache/
# Crash log

View File

@ -1,2 +1,2 @@
# raspberry-pi-os-image-builder
Create a customized Raspberry Pi OS Image using Packer
Build custom Raspberry Pi OS Image with Packer

View File

@ -0,0 +1,50 @@
{
"variables": {
},
"builders": [
{
"type": "arm-image",
"iso_url": "https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-03-25/2021-03-04-raspios-buster-armhf-lite.zip",
"iso_checksum": "sha256:ea92412af99ec145438ddec3c955aa65e72ef88d84f3307cea474da005669d39",
"target_image_size": 2147483648
}
],
"provisioners": [
{
"type": "file",
"source": "./rasp.png",
"destination": "/home/pi/rasp.png"
},
{
"type": "file",
"source": "./scripts/.bash_profile",
"destination": "/home/pi/.bash_profile"
},
{
"type": "file",
"source": "./scripts/.xinitrc",
"destination": "/home/pi/.xinitrc"
},
{
"type": "file",
"source": "./scripts/splashscreen.service",
"destination": "/etc/systemd/system/splashscreen.service"
},
{
"type": "shell",
"inline": [
"echo 'Install APT Packages'",
"echo nameserver 8.8.8.8 > /etc/resolv.conf",
"apt-get update",
"apt-get -y install --no-install-recommends xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils fbi curl",
"rm -f /etc/motd",
"chown pi:pi -R /home/pi/"
]
},
{
"type": "shell",
"script": "./scripts/run.sh"
}
]
}

BIN
rasp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

4
scripts/.bash_profile Normal file
View File

@ -0,0 +1,4 @@
if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]
then
startx >/dev/null 2>&1
fi

4
scripts/.xinitrc Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
sudo /usr/bin/fbi -d /dev/fb0 --vt 1 --noverbose -a /home/pi/rasp.png

14
scripts/run.sh Normal file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env sh
echo "Modify Raspberry Pi Configurations"
sed -i 's/^session[ \t]*optional[ \t]*pam_lastlog.so/#session optional pam_lastlog.so/' /etc/pam.d/login
sed -i 's/^session[ \t]*optional[ \t]*pam_motd.so[ /t]*motd=\/run\/motd.dynamic/#session optional pam_motd.so motd=\/run\/motd.dynamic/' /etc/pam.d/login
sed -i 's/^session[ \t]*optional[ \t]*pam_motd.so[ /t]*noupdate/#session optional pam_motd.so noupdate/' /etc/pam.d/login
sed -i 's/^ExecStart=-\/sbin\/agetty.* --noclear %I \$TERM/ExecStart=-\/sbin\/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM/' /lib/systemd/system/getty@.service
sed -i '/^_IP=[\$]*/,+3 s/^/#/' /etc/rc.local
sed -i '/^exit[ /t]*0/i dmesg --console-off\n' /etc/rc.local
echo "Enable Raspberry Pi Default Services"
systemctl enable ssh
systemctl enable getty@
systemctl enable unblockwifi
systemctl enable splashscreen

View File

@ -0,0 +1,9 @@
[Unit]
Description=Splash screen
DefaultDependencies=no
After=local-fs.target
[Service]
Type=forking
ExecStart=sudo /usr/bin/fbi -d /dev/fb0 --vt 1 --noverbose -a /home/pi/rasp.png &
[Install]
WantedBy=sysinit.target