Skip to content

Commit

Permalink
board/pluto/device_format_jffs2: Fix fs cache issue
Browse files Browse the repository at this point in the history
Unmount before erasing.

Signed-off-by: Michael Hennerich <[email protected]>
  • Loading branch information
mhennerich committed Mar 30, 2021
1 parent 45214d0 commit b079676
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions board/pluto/device_format_jffs2
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ set +e

while true;
do
read -p "Are you sure to delete/format your mtd2 JFFS2 partition? (yes/no) " answ
read -p "Are you sure to delete/format your mtd2 JFFS2 (/mnt/jffs2) partition? (yes/no) " answ
case $answ in
[Yy]* ) flash_erase -j /dev/mtd2 0 0; break;;
[Yy]* )
umount /mnt/jffs2
flash_erase -j /dev/mtd2 0 0
mount -a
break
;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
Expand Down
1 change: 1 addition & 0 deletions board/pluto/device_passwd
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ passwd
install -D /etc/passwd /etc/shadow /etc/group -t /mnt/jffs2/etc
cd /etc
md5sum passwd shadow group 2>/dev/null > /mnt/jffs2/etc/password.md5
sync

2 changes: 2 additions & 0 deletions board/pluto/device_persistent_keys
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ if [ -f ${IDFILE} ]; then
cd /root/.ssh
md5sum authorized_keys 2>/dev/null > /mnt/jffs2/root/.ssh/keys.md5
fi

sync

0 comments on commit b079676

Please sign in to comment.