initrd_layer_test 382 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. LAYERFS="unionfs"
  3. [ "`lsmod | grep '^aufs'`" != "" ] && LAYERFS="aufs"
  4. mkdir /pup_rw
  5. mkdir /pup_ro1
  6. mkdir /pup_new
  7. mount -o ro,rbind / /pup_ro1
  8. if [ "$LAYERFS" = "aufs" ];then
  9. mount -t aufs -o br:/pup_rw:/pup_ro1 aufs /pup_new
  10. else
  11. mount -t unionfs -o dirs=/pup_rw:/pup_ro1 unionfs /pup_new
  12. fi
  13. echo '#!/bin/sh' > /pup_new/etc/rc.d/rc.sysinit
  14. #exec chroot /pup_new