From: Paul Hänsch Date: Tue, 30 Oct 2018 12:01:12 +0000 (+0100) Subject: put some of the configuration in separate files X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=fba71afea1684a9d83484a8ccbebe8a24bea6da4;p=rpi_small put some of the configuration in separate files --- diff --git a/.gitignore b/.gitignore index daa9384..28f18a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .*.swp raspi_root/ raspi.img +config.mk diff --git a/Makefile b/Makefile index d8f3d96..2687a8a 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,24 @@ .FORCE: -define PARTITIONS = -label: dos\n\ -unit: sectors\n\ -\n\ -: start=8192, size=114688, type=1, type=c\n\ -: start=122880, type=83\n -endef +BOOTSTRAP = http://raspbian.raspberrypi.org/raspbian define SOURCES = deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\n\ deb http://archive.raspberrypi.org/debian stretch main\n endef -BOOTSTRAP := http://raspbian.raspberrypi.org/raspbian - -define SOURCES = -deb http://localhost/raspbian stretch main non-free firmware rpi\n -endef -BOOTSTRAP := http://localhost/raspbian PACKAGES := apt apt-transport-https bluez bluez-firmware btrfs-tools busybox-static bzip2 ca-certificates cron deborphan firmware-atheros firmware-brcm80211 firmware-libertas firmware-linux-free firmware-misc-nonfree firmware-realtek gzip htop ifupdown init iptables iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openssh-client openssh-server p7zip-full raspberrypi-bootloader raspberrypi-kernel rpi-update rsync ssh sshfs sudo systemd traceroute unace unrar-free unzip vim wget wireless-tools wpasupplicant xz-utils zip -raspi_root: /usr/bin/qemu-arm-static +include config.mk + +config.mk: config.example + cp -n "$<" "$@" + +raspi_root: btrfs subvolume create "$@" || mkdir "$@" mkdir -p "$@/usr/bin" chmod 755 -R "$@/" - cp -p "$<" "$@/usr/bin/" + cp -p "/usr/bin/qemu-arm-static" "$@/usr/bin/" debootstrap --keyring=./raspbian-archive-keyring.gpg \ --arch=armhf --variant=minbase \ stretch "$@/" "${BOOTSTRAP}" @@ -34,7 +27,6 @@ raspi_root/: raspi_root .FORCE printf '${SOURCES}' >$@/etc/apt/sources.list -chroot "$@" apt-key add - <./raspberrypi-archive-keyring.gpg -cp /etc/resolv.conf "$@etc/" - # for tree in ${CONFIG}; do for file in apt default timezone; do cp -av "$$tree/etc/$$file" "$@/etc/" || true; done; done -chroot "$@" sh -c 'apt-mark showmanual |xargs apt-mark auto' -chroot "$@" apt-get update chroot "$@" ln -sf /bin/true /usr/local/sbin/invoke-rc.d @@ -45,11 +37,11 @@ raspi_root/: raspi_root .FORCE chroot "$@" apt-get clean touch "$@" -raspi.img: raspi_root/ +raspi.img: raspi_root/ partitions -rmdir "$@.mnt" - mkdir "$@.mnt" - dd bs=1M count=0 seek=1024 of="$@" - printf '${PARTITIONS}' |sfdisk "$@" + mkdir "$@.mnt" # fail receipe if dir is nonempty + dd bs=1M count=0 seek=1024 of="$@" # set up sparse file + sfdisk "$@"