Initial commit

This commit is contained in:
2018-05-15 16:11:21 +02:00
commit 9d1907616b
15 changed files with 274 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
image boot.vfat {
vfat {
files = {
"bcm2710-rpi-3-b.dtb",
"bcm2710-rpi-3-b-plus.dtb",
"bcm2710-rpi-cm3.dtb",
"rpi-firmware/bootcode.bin",
"rpi-firmware/cmdline.txt",
"rpi-firmware/config.txt",
"rpi-firmware/fixup.dat",
"rpi-firmware/start.elf",
"rpi-firmware/overlays",
"zImage"
}
}
size = 32M
}
image sdcard.img {
hdimage {
}
partition boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}
partition rootfs {
partition-type = 0x83
image = "rootfs.ext4"
}
}
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -u
set -e
# Mount first partition to access config files
if [ -e ${TARGET_DIR}/etc/fstab ]; then
if ! grep -qE '^\/dev\/mmcblk0p1' "${TARGET_DIR}/etc/fstab"; then
cat << __EOF__ >> "${TARGET_DIR}/etc/fstab"
/dev/mmcblk0p1 /mnt vfat defaults,ro 0 0
__EOF__
fi
fi
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
# Enable SPI
if ! grep -qE '^dtparam=spi=on' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
# enable SPI
dtparam=spi=on
__EOF__
fi
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
#
# Load SPI modules
#
start() {
printf "Load SPI kernel modules: "
modprobe spi-bcm2835
modprobe spidev
}
stop() {
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?