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
294 stars 59 forks source link

destroy script does not unmount if canonical path does not match #40

Open pelepelin opened 1 year ago

pelepelin commented 1 year ago

destroy script does not canonicalize script path properly and so mount points are incorrectly filtered out.

root@router:/tmp/mnt/Sea2T/root-home/alpine-chroot-install# ../alpine3/destroy 
If you want to remove /mnt/Sea2T/root-home/alpine3 directory, run: ../alpine3/destroy --remove
root@router:/tmp/mnt/Sea2T/root-home/alpine-chroot-install# /mnt/Sea2T/root-home/alpine3/destroy
If you want to remove /mnt/Sea2T/root-home/alpine3 directory, run: /mnt/Sea2T/root-home/alpine3/destroy --remove
root@router:/tmp/mnt/Sea2T/root-home/alpine-chroot-install# /tmp/mnt/Sea2T/root-home/alpine3/destroy
Unmounting /tmp/mnt/Sea2T/root-home/alpine3/sys/kernel/debug
Unmounting /tmp/mnt/Sea2T/root-home/alpine3/sys
Unmounting /tmp/mnt/Sea2T/root-home/alpine3/proc
Unmounting /tmp/mnt/Sea2T/root-home/alpine3/dev/pts
Unmounting /tmp/mnt/Sea2T/root-home/alpine3/dev
If you want to remove /tmp/mnt/Sea2T/root-home/alpine3 directory, run: /tmp/mnt/Sea2T/root-home/alpine3/destroy --remove

(Paths like /tmp/mnt are usual for routers.)