s243a

run_psandbox2.sh

Jan 17th, 2021 (edited)
873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.88 KB | None | 0 0
  1. #!/bin/bash
  2. #input_method=1
  3. rm ./sandbox.out #For now I don't want to use the previous config.
  4. SB_PREFIX=$(realpath ./psandbox)
  5. OS_HOME=$(realpath .)
  6. PSUBDIR=${OS_HOME#/mnt/*/}
  7. MP=${OS_HOME%"$PSUBDIR"}
  8. mkdir -p "$MP"
  9. #OS_HOME="$MP/$PSUBDIR"
  10. LOGFILE="$OS_HOME/sandbox.log" #don't use realpath because busybox doesn't support the -m option.
  11.  
  12. #B1_source="/aufs/devsave/Dropbox (Maestral)/s243a Personal"
  13. #B1_target=/Remote/jobs #Sometimes I might get this folder via samaba isntead of a bind.
  14. #B1_source=/samba
  15. #B1_target=/samba  
  16. #rev_B1_source=/
  17. #rev_B1_target='$FAKEROOT/samba'
  18.  
  19. #if [ -f ./sandbox.out ]; then
  20. #  bash -x "$SB_PREFIX"/usr/bin/psandbox.sh --logfile "$LOGFILE" -f "$OS_HOME"/sandbox.out -o "$OS_HOME"/sandbox.out --pdrv #"$MP" --maybe-psubdir "$PSUBDIR" -e "devx_fossapup64_9.5.sfs" --no-exit --rw-layer "$RW_LAYER" --copy-Xauth --bind-X11-#sockets --copy-resolv_conf --bind "$B1_source" "$B1_target"
  21. #
  22. #else
  23.   #bash -x "$SB_PREFIX"/usr/bin/psandbox.sh --trace --logfile "$LOGFILE" -o "$OS_HOME"/sandbox.out --pdrv "$MP" --maybe-psubdir "$PSUBDIR" -e "devx_fossapup64_9.5.sfs" --no-exit --rw-layer "$RW_LAYER" --copy-Xauth --bind-X11-sockets --copy-resolv_conf --rev_bind "$B1_source"--rev_bind "$B1_target" --bind "$B1_source" --bind  "$B1_target" ----before-chroot "/etc/init.d/rc.samba start || /etc/init.d/rc.samba restart"
  24.  
  25.   #don't use --no-exit --copy-Xauth for now.
  26.  # bash -x "$SB_PREFIX"/usr/bin/psandbox2.sh --trace --logfile "$LOGFILE" -o "$OS_HOME"/sandbox.out --pdrv "$MP" --maybe-psubdir "$PSUBDIR" --no-exit --rw-layer "$RW_LAYER" --bind-X11-sockets --copy-resolv_conf --rev_bind "$B1_source" --rev_bind "$B1_target" --bind "$B1_source" --bind  "$B1_target" --before-chroot "/etc/init.d/rc.samba start || /etc/init.d/rc.samba restart"
  27.  if [ -z "$input_method" ]; then
  28.    echo "Select the layring method:
  29.   1. Merge Components into "'"/"'". Using Hardlinks since Creasting symlink /cont -> / doesn't accomplish this.
  30.   2. Symlink cont dirs. E.g. Creates /bin -> /cont/bin
  31.   3. Sylink component files into "'/'". This is a tinycore-like approach
  32.   4. None, Use save file to handle symlink creation
  33.  
  34.   5. Use Simplified Iron Chroot Script
  35.   6. Start Iron as Portable Browser"
  36.    read input_method
  37.  fi
  38.  case "$input_method" in
  39.  1|2|3)
  40.    RW_LAYER="$OS_HOME/savefiles/slackosave_$input_method"
  41.   ;;
  42.  5)
  43.    COMMAND=( bash -x "$OS_HOME/iron_scripts/ironchroot" --chroot-command ./iron )
  44.    ;;
  45.  6)
  46.    COMMAND=( bash -x "$OS_HOME/iron_scripts/ironchroot" --command ./iron )
  47.    ;;
  48. *)
  49.   RW_LAYER="$OS_HOME/savefiles/slackosave_test1"
  50.   ;;
  51. esac
  52. mkdir -p "$RW_LAYER"
  53. case "$input_method" in
  54.   1)
  55.     MERGE_LAYER=./symlinks/merge_components
  56.     SYMLINK_LAYER="$(realpath $MERGE_LAYER)"
  57.   ;;
  58.   2)
  59.     SYMLINK_LAYER="./symlinks/symlink_cont_dirs"
  60.     SYMLINK_LAYER="$(realpath $MERGE_LAYER)"
  61.   ;;
  62.   3)
  63.     SYMLINK_LAYER="./symlinks/symlink_cont_dirs"
  64.     SYMLINK_LAYER="$(realpath $MERGE_LAYER)"
  65.   ;;
  66. esac
  67. case "$input_method" in
  68. 2|3)
  69.   SYMLINK_LAYER="$(realpath $MERGE_LAYER)"
  70.   ;;
  71. esac
  72. case "$input_method" in
  73.   1|2|3)
  74.    merge_layer=./
  75.    "$SB_PREFIX"/usr/bin/psandbox2.sh --trace --logfile "$LOGFILE" -o "$OS_HOME"/sandbox.out --pdrv "$MP" \
  76.                                                               --layer "$SYMLINK_LAYER" \
  77.                                                               --maybe-psubdir "$PSUBDIR" --no-exit \
  78.                                                               --rw-layer "$RW_LAYER"  --bind-X11-sockets --copy-resolv_conf
  79.                                                                
  80.   ;;
  81.   5|6)
  82.     "${COMMAND[@]}"
  83.   ;;
  84.   *)
  85.    
  86.    "$SB_PREFIX"/usr/bin/psandbox2.sh --trace --logfile "$LOGFILE" -o "$OS_HOME"/sandbox.out --pdrv "$MP" --maybe-psubdir "$PSUBDIR" --no-exit \
  87.                                                               --rw-layer "$RW_LAYER" --bind-X11-sockets --copy-resolv_conf  
  88.   ;;
  89. esac
  90.  
Add Comment
Please, Sign In to add comment