alpinelinux / alpine-chroot-install

Install Alpine Linux in chroot with a breeze. Build ARM on Travis CI or any other x86_64 CI.
MIT License
290 stars 59 forks source link

Support alpine host #28

Closed kasperk81 closed 3 years ago

kasperk81 commented 3 years ago

Supporting alpine vm or baremetal install would be interesting.

In my case (baremetal), I installed qemu-{aarch,riscv}64 along with qemu-openrc, then applied this quick patch:

@@ -304,16 +304,16 @@ if [ -n "$ARCH" ] && [ $(normalize_arch $ARCH) != $(normalize_arch $(uname -m))

        if [ ! -x "$QEMU_EMULATOR" ]; then
                einfo 'Installing qemu-user-static on host system...'
-               install_qemu_user
+#              install_qemu_user
        fi

        if [ ! -e /proc/sys/fs/binfmt_misc/qemu-$qemu_arch ]; then
                einfo 'Installing and enabling binfmt-support on host system...'
-               install_binfmt_support
+#              install_binfmt_support
        fi

-       mkdir -p usr/bin
-       cp -v "$QEMU_EMULATOR" usr/bin/
+#      mkdir -p usr/bin
+#      cp -v "$QEMU_EMULATOR" usr/bin/
 fi

With that sudo ./alpine-chroot-install -a aarch64 -b edge and -a riscv64 created the correct environments.

@jirutka, what do you think of install_qemu_openrc instead of install_qemu_user and install_binfmt_support when running on alpine host? Also we can improve it a bit to error out when the host is not Debian-derivative.

jirutka commented 3 years ago

You’re looking for https://github.com/alpinelinux/alpine-make-vm-image.

kasperk81 commented 3 years ago

I actually just need alpine chroot of $other architecture (riscv64, aarch64) on my alpine x64 box. alpine-chroot-install script is 99% agnostic of host except for those qemu and binfmt conditions.

kasperk81 commented 3 years ago

Since you are being a jerk.

jirutka commented 3 years ago

Since you are being a jerk.

Pardon me?! You call me a jerk because I didn’t respond or review and merge changes fast enough for you?! I’m doing it mostly in my free time, nobody pays me to work on all the open source projects I’m involved in.