From: Paul Hänsch Date: Sat, 9 Mar 2019 23:35:32 +0000 (+0100) Subject: improved rollout of some config files X-Git-Url: http://git.plutz.net/?p=rpi_small;a=commitdiff_plain;h=dd95be3d806b5ff3aaaff23d926b1f9b3d92fe3a;hp=f98e135b355deaade003bde2b2bf5fcb0e517696 improved rollout of some config files --- diff --git a/.gitignore b/.gitignore index 8eb0369..38d45b6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,5 @@ config.mk files/etc/inetd.conf files/srv/gummikraken/ files/usr/local/ -files/root/.ssh/authorized_keys -files/etc/network/interfaces.d/wifi id_rsa id_rsa.pub diff --git a/Makefile b/Makefile index 4b7f0bd..5d4e7f0 100644 --- a/Makefile +++ b/Makefile @@ -26,18 +26,16 @@ 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 psmisc 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 = - IMGFILE = raspi.img 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 + export SOURCES +export WIFI_CFG raspi_root: btrfs subvolume create "$@" || mkdir "$@" @@ -72,19 +70,6 @@ raspi_root/: raspi_root norecommends apt_keys .FORCE 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,24 @@ 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/." "$>"$"$