mirror of
https://github.com/source4learn/raspberry-pi-os-image-builder.git
synced 2025-08-03 15:55:28 +00:00
Added splash screen changes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
# Cache objects
|
||||
packer-builder-arm-image
|
||||
packer_cache/
|
||||
|
||||
# Crash log
|
||||
|
@ -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
|
||||
|
50
packer-raspberry-pi-os-lite.json
Normal file
50
packer-raspberry-pi-os-lite.json
Normal 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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
4
scripts/.bash_profile
Normal file
4
scripts/.bash_profile
Normal file
@ -0,0 +1,4 @@
|
||||
if [ -z $DISPLAY ] && [ $(tty) = /dev/tty1 ]
|
||||
then
|
||||
startx >/dev/null 2>&1
|
||||
fi
|
4
scripts/.xinitrc
Normal file
4
scripts/.xinitrc
Normal 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
14
scripts/run.sh
Normal 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
|
9
scripts/splashscreen.service
Normal file
9
scripts/splashscreen.service
Normal 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
|
Reference in New Issue
Block a user