Refactor structure

This commit is contained in:
Source4Learn
2021-08-14 13:23:33 +05:30
parent 0c63ee09d1
commit 2c5da716fd
6 changed files with 50 additions and 52 deletions

1
.gitignore vendored
View File

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

View File

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

View File

@ -1,50 +1,49 @@
{
"variables": {
"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"
},
"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"
}
]
}
{
"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"
}
]
}

View File

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

View File

@ -10,5 +10,4 @@ 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

@ -6,4 +6,4 @@ After=local-fs.target
Type=forking
ExecStart=sudo /usr/bin/fbi -d /dev/fb0 --vt 1 --noverbose -a /home/pi/rasp.png &
[Install]
WantedBy=sysinit.target
WantedBy=sysinit.target