Skip to content

Commit

Permalink
1. See adafruit#92
Browse files Browse the repository at this point in the history
ntpd started from 'systemctl' (via dhcpcd hook) can not follow symlink
from /etc/resolv.conf to /tmp/dhcpcd.resolv.conf. For now should remain
in /etc/resolv.conf (hard coded).
stat64("/etc/resolv.conf", 0xbea7af80) = -1 ENOENT (No such file or
directory)
2. Never fsck on any volumne. Linux runs a fsck every 6 month even on
ro-volumnes. Any fs corruption makes fsck stall during bootup and
requires user to confirm to continue.
3. Disable viminfo to stop vim from complaining about ~/.viminfo not
writeable.
  • Loading branch information
SkyperTHC committed Jun 7, 2020
1 parent 673a7cf commit 6ccbc2e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions read-only-fs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,24 @@ replaceAppend /etc/ssh/sshd_config "^.*UsePrivilegeSeparation.*$" "UsePrivilegeS
replace /usr/lib/tmpfiles.d/var.conf "spool\s*0755" "spool 1777"

# Move dhcpd.resolv.conf to tmpfs
touch /tmp/dhcpcd.resolv.conf
rm /etc/resolv.conf
ln -s /tmp/dhcpcd.resolv.conf /etc/resolv.conf
#touch /tmp/dhcpcd.resolv.conf
#rm /etc/resolv.conf
#ln -s /tmp/dhcpcd.resolv.conf /etc/resolv.conf

# Make edits to fstab
# make / ro
# tmpfs /var/log tmpfs nodev,nosuid 0 0
# tmpfs /var/tmp tmpfs nodev,nosuid 0 0
# tmpfs /tmp tmpfs nodev,nosuid 0 0
replace /etc/fstab "vfat\s*defaults\s" "vfat defaults,ro "
replace /etc/fstab "ext4\s*defaults,noatime\s" "ext4 defaults,noatime,ro "
replace /etc/fstab "vfat\s*defaults\s.*" "vfat defaults,ro\t0\t0"
replace /etc/fstab "ext4\s*defaults,noatime\s.*" "ext4 defaults,noatime,ro\t0\t0"
append1 /etc/fstab "/var/log" "tmpfs /var/log tmpfs nodev,nosuid 0 0"
append1 /etc/fstab "/var/tmp" "tmpfs /var/tmp tmpfs nodev,nosuid 0 0"
append1 /etc/fstab "\s/tmp" "tmpfs /tmp tmpfs nodev,nosuid 0 0"

# Stop vim creating tmp files in ~/.viminfo (ro)
echo 'set viminfo=""' >>/etc/vim/vimrc.local

# PROMPT FOR REBOOT --------------------------------------------------------

echo "Done."
Expand Down

0 comments on commit 6ccbc2e

Please sign in to comment.