差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
raspberry_pi:0060overlayfs [2017/07/07 06:12]
admin
raspberry_pi:0060overlayfs [2017/07/22 22:18] (現在)
admin
ライン 7: ライン 7:
   ​   ​
   ​   ​
-ルートフォルダの整理+====ルートフォルダの整理====
   # rm /​restoresymtable   # rm /​restoresymtable
   # rm /null   # rm /null
ライン 13: ライン 13:
  
  
-init.dスクリプトの追加 +====init.dスクリプトの追加==== 
-  vi /​etc/​init.d/​mount-overlay +cd /​etc/​init.d/​ 
-  ---+# vi mount-overlay 
-  #!/bin/sh +<code bash mount-overlay> 
-     +#! /bin/sh 
-  ​### BEGIN INIT INFO +### BEGIN INIT INFO 
-  # Provides: mount-overlay +# Provides: mount-overlay 
-  # Required-Start:​ mountall-bootclean +# Required-Start:​ mountall-bootclean 
-  # Required-Stop:​ +# Required-Stop:​ 
-  # Default-Start:​ S +# Default-Start:​ S 
-  # Default-Stop:​ +# Default-Stop:​ 
-  # X-Start-Before:​ procps udev-mtab urandom +# X-Start-Before:​ procps udev-mtab urandom 
-  # Short-Description:​ overlay mode +# Short-Description:​ overlay mode 
-  # Descrition: Shutdown process will not be required +# Descrition: Shutdown process will not be required 
-  ### END INIT INFO+### END INIT INFO
   ​   ​
-  ​/bin/mount /boot +/bin/mount /boot 
-  cd /boot +cd /boot 
-  file=nofsprotect +file=nofsprotect 
-  if [ -e ${file} ]; then +if [ -e ${file} ]; then 
-  exit 0 +exit 0 
-  fi +fi 
-  /bin/mount -t tmpfs tmpfs /​fsprotect +/bin/mount -t tmpfs tmpfs /​fsprotect 
-  for d in etc home root var usr opt +for d in etc home root var usr opt 
-  do +do 
-  mkdir /​fsprotect/​${d} +mkdir /​fsprotect/​${d} 
-  mkdir /​fsprotect/​${d}_rw +mkdir /​fsprotect/​${d}_rw 
-  OPTS="​-o lowerdir=/​${d},​upperdir=/​fsprotect/​${d},​workdir=/​fsprotect/​${d}_rw"​ +OPTS="​-o lowerdir=/​${d},​upperdir=/​fsprotect/​${d},​workdir=/​fsprotect/​${d}_rw"​ 
-  /bin/mount -t overlay ${OPTS} overlay /${d} +/bin/mount -t overlay ${OPTS} overlay /${d} 
-  done +done 
-  exit 0+exit 0 
 +</​code>​
   ​   ​
-  ​# chmod 755 mount-overlay +# chmod 755 mount-overlay 
-  # update-rc.d mount-overlay defaults 01 10+# update-rc.d mount-overlay defaults 01 10 
 +# ls /​etc/​rc*.d/​*mount-overlay
  
-rc.localへ追加+====rc.localへ追加====
   # vi /​etc/​rc.local   # vi /​etc/​rc.local
-  ---- +(最初の方が望ましい) 
-  ​(最初の方が望ましい) +<code bash rc.local>​ 
-  # overlayfs +# overlayfs 
-  cd /boot +cd /boot 
-  file=nofsprotect +file=nofsprotect 
-  if [ -e ${file} ]; then +if [ -e ${file} ]; then 
-  mount -o rw,remount / +mount -o rw,remount / 
-  mount -o rw,remount /boot +mount -o rw,remount /boot 
-  fi+fi 
 +</​code>​
  
 fstab修正 fstab修正
-  ​# vi /​etc/​fstab +# vi /​etc/​fstab 
-  ---- +<code txt fstab> 
-  proc            /proc           ​proc ​   defaults ​            ​0 ​      0 +proc            /proc           ​proc ​   defaults ​            ​0 ​      0 
-  /​dev/​mmcblk0p1 ​ /boot           ​vfat ​   ro,​defaults ​         0       2 +/​dev/​mmcblk0p1 ​ /boot           ​vfat ​   ro,​defaults ​         0       2 
-  /​dev/​mmcblk0p2 ​ /               ​ext4 ​   ro,​defaults,​noatime ​ 0       1 +/​dev/​mmcblk0p2 ​ /               ​ext4 ​   ro,​defaults,​noatime ​ 0       1 
-  tmpfs           /​tmp ​           tmpfs   ​defaults ​            ​0 ​      0+tmpfs           /​tmp ​           tmpfs   ​defaults ​            ​0 ​      0 
 +</​code>​
  
 nofsprotectスクリプト nofsprotectスクリプト
-  ​# vi nofsprotect +# vi nofsprotect 
-  ---- +<code bash nofsprotect>​ 
-  #!/bin/sh +#!/bin/sh 
-  mount -o rw,remount /boot +mount -o rw,remount /boot 
-  file=nofsprotect +file=nofsprotect 
-  cd /boot +cd /boot 
-  if [ ! -e ${file} ]; then +if [ ! -e ${file} ]; then 
-    # rm ${file} +  # rm ${file} 
-    touch ${file} +  touch ${file} 
-  fi +fi 
-  if [ -e ${file} ]; then +if [ -e ${file} ]; then 
-    echo "​nofsprotect mode"​ +  echo "​nofsprotect mode"​ 
-  else +else 
-    echo "​fsprotect mode"​ +  echo "​fsprotect mode"​ 
-  fi +fi 
-  mount -o ro,remount /boot +mount -o ro,remount /boot 
-  echo "​reboot..."​ +echo "​reboot..."​ 
-  sleep 5 +sleep 5 
-  sync; sync; sync; +sync; sync; sync; 
-  reboot +reboot 
-   +</​code> ​  
-  # chmod a+x nofsprotect+ 
 +# chmod a+x nofsprotect
  
 fsprotectスクリプト fsprotectスクリプト
-  ​# vi fsprotect +# vi fsprotect 
-  ---- +<code bash fsprotect>​ 
-  #!/bin/sh +#!/bin/sh 
-  mount -o rw,remount /boot +mount -o rw,remount /boot 
-  file=nofsprotect +file=nofsprotect 
-  cd /boot +cd /boot 
-  if [ -e ${file} ]; then +if [ -e ${file} ]; then 
-    rm ${file} +  rm ${file} 
-  fi +fi 
-  if [ -e ${file} ]; then +if [ -e ${file} ]; then 
-    echo "​nofsprotect mode"​ +  echo "​nofsprotect mode"​ 
-  else +else 
-    echo "​fsprotect mode"​ +  echo "​fsprotect mode"​ 
-  fi +fi 
-  mount -o ro,remount /boot +mount -o ro,remount /boot 
-  echo "​reboot..."​ +echo "​reboot..."​ 
-  sleep 5 +sleep 5 
-  sync; sync; sync; +sync; sync; sync; 
-  reboot +reboot 
-   +</​code> ​  
-  # chmod a+x fsprotect+ 
 +# chmod a+x fsprotect
  
 状況 状況
 +<​code>​
   devtmpfs ​      dev   devtmpfs ​      dev
   proc                 proc   proc                 proc
ライン 139: ライン 146:
   RO srv   RO srv
   RO lost+found   RO lost+found
 +</​code>​
  
  
raspberry_pi/0060overlayfs.1499407966.txt.gz · 最終更新: 2017/07/07 06:12 by admin
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0