X-Git-Url: http://git.plutz.net/?p=rpi_small;a=blobdiff_plain;f=Makefile;h=58c32d96fc351d068b4fa4622a836ad5f06b151c;hp=fe8971e098bedfdbcd937ec3996e5e433d40b237;hb=bf1687b229f4434fd6e775d6ae65913fb8cf7215;hpb=fa1d197fbf6dde03e3fa2363425c0f5f9b0bcd42 diff --git a/Makefile b/Makefile index fe8971e..58c32d9 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,7 @@ deb http://raspbian.raspberrypi.org/raspbian stretch main non-free firmware rpi deb http://archive.raspberrypi.org/debian stretch main endef -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 = +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 psmisc raspberrypi-bootloader raspberrypi-kernel rsync ssh sshfs sudo systemd traceroute unzip vim wget wireless-tools wpasupplicant xz-utils zip IMGFILE = raspi.img @@ -36,8 +32,10 @@ config.mk: config.example cp -n "$<" "$@" include config.mk -.PHONY: imgfile imgmount root_copy norecommends apt_keys +.PHONY: imgfile imgmount root_copy norecommends apt_keys wifi_cfg ssh_key busybox + export SOURCES +export WIFI_CFG raspi_root: btrfs subvolume create "$@" || mkdir "$@" @@ -67,24 +65,11 @@ raspi_root/: raspi_root norecommends apt_keys .FORCE chroot "$@" ln -sf /bin/true /usr/local/sbin/invoke-rc.d chroot "$@" apt-get --yes install ${PACKAGES} chroot "$@" apt-get --yes --auto-remove purge - chroot "$@" apt-get --yes --auto-remove upgrade + -chroot "$@" apt-get --yes --auto-remove upgrade chroot "$@" apt-get clean chroot "$@" rm /usr/local/sbin/invoke-rc.d touch "$@" -id_rsa.pub: - ssh-keygen -b 2048 -t rsa -N '' -f id_rsa - -files/etc/network/interfaces.d/wifi: wifi.tmpl - sed 's;#WIFI-SSID#;${WIFI-SSID};; s;#WIFI-PASS#;${WIFI-PASS};;' <'$<' >'$@' - chmod 644 '$@' - -files/root/.ssh/authorized_keys: id_rsa.pub - mkdir -p files/root/.ssh/ - cat '$<' >>'$@' - chmod 700 files/root/ files/root/.ssh/ - chmod 600 '$@' - imgfile: raspi_root/ # do not set up image file before chroot imgfile: partitions dd bs=1M count=0 seek=1280 of="${IMGFILE}" # set up sparse file @@ -105,11 +90,28 @@ imgmount: imgfile losetup -o $$((start * 512)) --sizelimit $$((size * 512)) "$${lo}" "$$image" && \ mkfs.fat -F 32 -n boot "$$lo" && mount -t vfat "$$lo" "$@/boot"; -root_copy: files/root/.ssh/authorized_keys files/etc/network/interfaces.d/wifi root_copy: imgmount raspi_root/ files/ cp -a "raspi_root/." "files/." "$>"$"$