Skip to content

Instantly share code, notes, and snippets.

@detly
Last active January 15, 2017 19:07
Show Gist options
  • Save detly/23fde5e17ac92a70dec47c4b109f863b to your computer and use it in GitHub Desktop.
Save detly/23fde5e17ac92a70dec47c4b109f863b to your computer and use it in GitHub Desktop.

Things to try:

  • Copy DTB (device tree) to root of live media
  • Copy everything from /boot in chroot to root of live media (why not?)
  • Move kernel image to kernel.img instead of using config.txt entry
    • What about the initrd?

Notes:

  • live-build binary hooks are executed in build/binary
  • Seems like Qemu doesn't care what files are on the root media, it just takes whatever DTB etc. you give it on the command line. The DTB should still be necessary for real booting though.
@detly
Copy link
Author

detly commented Jan 15, 2017

#!/usr/bin/make

BUILD_LOG := build.log

BUILD_OPTIONS = \
	--apt-indices none \
	--apt-secure false \
	--apt-source-archives false \
	--cache-stages false \
	--compression none \
	--distribution jessie \
	--mode debian \
	--security false \
	--binary-filesystem fat32 \
	--binary-images hdd \
	--chroot-filesystem squashfs \
	--hdd-size 512 \
	--initramfs live-boot \
	--system live \
	--architectures armhf \
	--bootstrap-qemu-arch armhf \
	--bootstrap-qemu-static /usr/bin/qemu-arm-static \
	--firmware-binary false \
	--firmware-chroot false \
	--linux-flavours "rpi2-rpfv" \
	--apt-http-proxy "http://localhost:3142/" \
	--parent-mirror-bootstrap http://localhost:3142/archive.raspbian.org/raspbian \
	--parent-mirror-chroot http://localhost:3142/archive.raspbian.org/raspbian \
	--parent-mirror-chroot-security http://localhost:3142/archive.raspbian.org/raspbian \
	--parent-mirror-binary http://localhost:3142/archive.raspbian.org/raspbian \
	--parent-mirror-binary-security http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-bootstrap http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-chroot http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-chroot-security http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-binary http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-binary-security http://localhost:3142/archive.raspbian.org/raspbian \
	--mirror-debian-installer http://localhost:3142/archive.raspbian.org/raspbian \
	--updates false \

.PHONY: clean image

default: image

image: live-image-armhf.img

live-image-armhf.img:
	env DEBOOTSTRAP_OPTIONS="--keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg" \
		LB_BOOTSTRAP_INCLUDE="apt-transport-https gnupg" \
		lb config $(BUILD_OPTIONS)
	( sudo DEBOOTSTRAP_OPTIONS="--keyring=/usr/share/keyrings/raspbian-archive-keyring.gpg" lb build ) 2>&1 | tee $(BUILD_LOG)

clean:
	sudo lb clean
	sudo lb clean --purge
	rm -fr config
	rm -fr $(BUILD_LOG)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment