Skip to content
Snippets Groups Projects
  • lemoer's avatar
    d4dee692
    contrib: add push_pkg.sh to enhance package development workflow (v2) (#2023) · d4dee692
    lemoer authored
    v2: In contrast to the last patches, this is now built on top of ssh
        only, without using e.g. 9pfs. Furthermore it works also with
        arbitary remote hosts on any target/architecture. Also the
        scripts were renamed and moved to /scripts.
    
    The aim of this commit is to allow fast rebuild cycles during the
    development of gluon packages.
    
    Currently the following workflow can be used:
    
    	# start a local qemu instance
    	scripts/run_qemu.sh output/images/factory/[...].img
    
    	# do your changes in the file you want to patch
    	vi package/gluon-ebtables/files/etc/init.d/gluon-ebtables
    
    	# rebuild and update the package
    	scripts/push_pkg.sh package/gluon-ebtables/
    
    	# test your changes
    	...
    
    	# do more changes
    	...
    
    	# rebuild and update the package
    	scripts/push_pkg.sh package/gluon-ebtables/
    
    	# test your changes
    	...
    
    	(and so on...)
    
    Implementation details:
    - Currently this is based on ssh/scp.
    - Opkg is used to install/update the packages in the remote machine.
    
    Benefits:
    - This works with compiled and non-compiled packages.
    - This works with native OpenWrt and Gluon packages.
    - This even performs the check_site.lua checks as they are integrated
      as post_install scripts into the openwrt package.
    - It works for all architectures/targets.
    contrib: add push_pkg.sh to enhance package development workflow (v2) (#2023)
    lemoer authored
    v2: In contrast to the last patches, this is now built on top of ssh
        only, without using e.g. 9pfs. Furthermore it works also with
        arbitary remote hosts on any target/architecture. Also the
        scripts were renamed and moved to /scripts.
    
    The aim of this commit is to allow fast rebuild cycles during the
    development of gluon packages.
    
    Currently the following workflow can be used:
    
    	# start a local qemu instance
    	scripts/run_qemu.sh output/images/factory/[...].img
    
    	# do your changes in the file you want to patch
    	vi package/gluon-ebtables/files/etc/init.d/gluon-ebtables
    
    	# rebuild and update the package
    	scripts/push_pkg.sh package/gluon-ebtables/
    
    	# test your changes
    	...
    
    	# do more changes
    	...
    
    	# rebuild and update the package
    	scripts/push_pkg.sh package/gluon-ebtables/
    
    	# test your changes
    	...
    
    	(and so on...)
    
    Implementation details:
    - Currently this is based on ssh/scp.
    - Opkg is used to install/update the packages in the remote machine.
    
    Benefits:
    - This works with compiled and non-compiled packages.
    - This works with native OpenWrt and Gluon packages.
    - This even performs the check_site.lua checks as they are integrated
      as post_install scripts into the openwrt package.
    - It works for all architectures/targets.
run_qemu.sh 562 B
#!/bin/sh

# Note: You can exit the qemu instance by first pressing "CTRL + a" then "c".
#       Then you enter the command mode of qemu and can exit by typing "quit".

qemu-system-x86_64 \
    -d 'cpu_reset' \
    -enable-kvm \
    -gdb tcp::1234 \
    -nographic \
    -netdev user,id=wan,hostfwd=tcp::2223-10.0.2.15:22 \
    -device virtio-net-pci,netdev=wan,addr=0x06,id=nic1 \
    -netdev user,id=lan,hostfwd=tcp::6080-192.168.1.1:80,hostfwd=tcp::2222-192.168.1.1:22,net=192.168.1.100/24 \
    -device virtio-net-pci,netdev=lan,addr=0x05,id=nic2 \
    "$@"