github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/scripts/image-pusher/init.wrapper (about)

     1  #! /bin/bash --posix
     2  
     3  mount -n none -t tmpfs /mnt
     4  cd /
     5  cp -ax . /mnt
     6  if [ -d /proc/1 ]; then
     7      mount -n none -t proc /mnt/proc
     8  fi
     9  cd /mnt
    10  ln sbin/init.real init
    11  pivot_root . mnt
    12  umount /mnt/* /mnt/dev/*
    13  mount -n -o remount,rw /mnt
    14  exec chroot . /init