Can I run a script to scp files as part of the snapshot make? [SOLVED]

I'm doing the scp and make twice to hopefully get the nlbw files in /root/nlbw/

ssh root@192.168.1.2 'nlbw -c commit'
scp -rp root@192.168.1.2:/root/nlbw/ files/root/nlbw/


make image PROFILE=rpi-4 PACKAGES="kmod-usb-net-rtl8152 kmod-mt76 kmod-mt76x2u kmod-mt76x02-usb kmod-mt76x2 kmod-mt76-usb kmod-mt76x2-common kmod-mt76x2u luci usbutils wireless-tools pciutils luci-app-nlbwmon sqlite3-cli bcm27xx-userland openssl-util luci-app-openvpn openvpn-openssl luci-app-vpnbypass htop -cypress-firmware-43455-sdio -cypress-firmware-43455-sdio-rpi-4b -brcmfmac-firmware-usb -kmod-brcmfmac -kmod-brcmutil" FILES=files/
ssh root@192.168.1.2 'nlbw -c commit'
scp -rp root@192.168.1.2:/root/nlbw/ files/root/nlbw/


make image PROFILE=rpi-4 PACKAGES="kmod-usb-net-rtl8152 kmod-mt76 kmod-mt76x2u kmod-mt76x02-usb kmod-mt76x2 kmod-mt76-usb kmod-mt76x2-common kmod-mt76x2u luci usbutils wireless-tools pciutils luci-app-nlbwmon sqlite3-cli bcm27xx-userland openssl-util luci-app-openvpn openvpn-openssl luci-app-vpnbypass htop -cypress-firmware-43455-sdio -cypress-firmware-43455-sdio-rpi-4b -brcmfmac-firmware-usb -kmod-brcmfmac -kmod-brcmutil" FILES=files/

Can I run a script to scp the /root/nlbw/ files as part of the make?

Just create a script that runs what you have in there. It looks fine to me. I do not see what's the problem exactly.

When it does the make it downloads packages which are not counted in the nlbw I previously copied which is why I do the copy the nlbw files and do the make twice (it hopefully caches stuff). I would like to scp the nlbw files as late in the make as possible. Can I make the make run a script before it creates the image?

You can run your script modifying the Makefile to do so, probably inserting your script here, right after $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG):

You can even take advantage of the already defined variables.

1 Like

Perfect, thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.