Giter Site home page Giter Site logo

Comments (4)

yuval-k avatar yuval-k commented on August 16, 2024

yea write to bin_fmt requires root; if there a shell command we can use to do this? this way we can prefix it with sudo.
also, how does this work for you - does sudo not need a password?

from packer-plugin-arm-image.

joshuaspence avatar joshuaspence commented on August 16, 2024

Actually I've started looking into a new approach, using systemd-nspawn instead of chroot. This would not only remove the need for sudo with the chroot command but also remove a lot of mount commands (as systemd-nspawn can handle this as well). I'm not sure if you'd be open to using systemd-nspawn so I might fork this plugin instead.

Regarding step_register_bin_fmt, does this need to be done every time Packer runs? On my system, the qemu-user-static package has a post-install script that sets up binfmt:

case "$DPKG_MAINTSCRIPT_NAME:$1" in

    postinst:configure)
	for fmt in $fmts ; do

	    eval "case $fmt in $omit) magic= ;; *) magic=\"\$${fmt}_magic\" mask=\"\$${fmt}_mask\" ;; esac"
	    if [ -n "$magic" ]; then
		update-binfmts --package qemu-user-static --install qemu-$fmt /usr/bin/qemu-$fmt-static \
			--magic "$magic" --mask "$mask" --offset 0 --credential yes --fix-binary yes
	    else
		remove_binfmt $fmt
	    fi
	done
	;;

    prerm:remove)
	for fmt in $fmts ; do
	    remove_binfmt $fmt
	done
	;;

esac

from packer-plugin-arm-image.

yuval-k avatar yuval-k commented on August 16, 2024

i'm open to add systemd-nspawn as an option (even one that's enabled by default, and assuming it works for everyone deprecate the old way). as for registration, it doesn't need to be done every run, i mainly do that for simplicity for the user; we can add a test if the required value is there, and only write it if its not there

from packer-plugin-arm-image.

joshuaspence avatar joshuaspence commented on August 16, 2024

Thanks for the feedback. I might work on this if I have some spare time :)

from packer-plugin-arm-image.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.