X-Git-Url: https://git.plutz.net/?p=rpi_small;a=blobdiff_plain;f=Makefile;h=6a35118c906b0f6990c563898a7282a5f61cdf14;hp=ed769e66dd5d9ae84abfd4d994e1b1f09c87d652;hb=4bb200e9c0d07b49a199f865bd9b0cd66a818a1f;hpb=fbf0b5869a923fc36722bd345208dee5f077ae44 diff --git a/Makefile b/Makefile index ed769e6..6a35118 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,20 @@ +# Generator for Oktopus boot media +# Copyright (C) 2018 Hochschule für Technik und Wirtschaft Berlin +# written by Paul Hänsch +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + .FORCE: BOOTSTRAP = http://raspbian.raspberrypi.org/raspbian @@ -7,17 +24,22 @@ deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi\ deb http://archive.raspberrypi.org/debian stretch main\n endef -PACKAGES := apt apt-transport-https bluez bluez-firmware bluez-tools bridge-utils btrfs-tools busybox-static bzip2 ca-certificates cron deborphan dnsmasq 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 pi-bluetooth rpi-update rsync ssh sshfs sudo systemd traceroute unace unrar-free unzip vim wget wireless-tools wpasupplicant xz-utils zip +PACKAGES := apt bluez bluez-firmware bluez-tools btrfs-tools busybox-static bzip2 ca-certificates cron debian-archive-keyring deborphan firmware-brcm80211 firmware-linux-free firmware-misc-nonfree gzip htop ifupdown init iputils-ping irqbalance isc-dhcp-client less libraspberrypi-bin libraspberrypi0 make net-tools nmap ntpdate openssh-client openssh-server pi-bluetooth raspberrypi-bootloader raspberrypi-kernel rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip # Do not change, only override in config.mk WIFI-SSID = WIFI-PASS = -include config.mk - config.mk: config.example cp -n "$<" "$@" +.PHONY: imgfile imgmount root_copy norecommends apt_keys + +IMGFILE = raspi.img + +include config.mk +include *.mk + raspi_root: btrfs subvolume create "$@" || mkdir "$@" mkdir -p "$@/usr/bin" @@ -27,9 +49,19 @@ raspi_root: --arch=armhf --variant=minbase \ stretch "$@/" "${BOOTSTRAP}" -raspi_root/: raspi_root .FORCE - printf '${SOURCES}' >$@/etc/apt/sources.list +norecommends: raspi_root/etc/apt/apt.conf.d/10norecommends +raspi_root/etc/apt/apt.conf.d/10norecommends: raspi_root + mkdir -p "$"$@" + chmod 644 "$@" + +apt_keys: + -chroot "$@" apt-key add - <./raspbian-archive-keyring.gpg -chroot "$@" apt-key add - <./raspberrypi-archive-keyring.gpg + -chroot "$@" apt-key add - <./debian-archive-stretch-stable.gpg + +raspi_root/: raspi_root norecommends apt_keys .FORCE + printf '${SOURCES}' >$@/etc/apt/sources.list -cp /etc/resolv.conf "$@etc/" -chroot "$@" sh -c 'apt-mark showmanual |xargs apt-mark auto' -chroot "$@" apt-get update @@ -37,8 +69,6 @@ raspi_root/: raspi_root .FORCE chroot "$@" apt-get --yes install ${PACKAGES} chroot "$@" apt-get --yes --auto-remove purge chroot "$@" apt-get --yes --auto-remove upgrade - chroot "$@" rpi-update - sync chroot "$@" apt-get clean chroot "$@" rm /usr/local/sbin/invoke-rc.d touch "$@" @@ -56,24 +86,32 @@ files/root/.ssh/authorized_keys: id_rsa.pub chmod 700 files/root/ files/root/.ssh/ chmod 600 '$@' -raspi.img: raspi_root/ files/ partitions files/root/.ssh/authorized_keys files/etc/network/interfaces.d/wifi - -rmdir "$@.mnt" - mkdir "$@.mnt" # fail receipe if dir is nonempty - dd bs=1M count=0 seek=1024 of="$@" # set up sparse file - sfdisk "$@"