Initial commit
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
Executable
+13
@@ -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
|
||||
Executable
+12
@@ -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
|
||||
Executable
+35
@@ -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 $?
|
||||
Reference in New Issue
Block a user