Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
ca06b768
Unverified
Commit
ca06b768
authored
Dec 15, 2020
by
Igor Pečovnik
Committed by
GitHub
Dec 15, 2020
Browse files
Fix overlayroot on / off (#124)
* Fix overlayroot on / off * Update debian-config-jobs
parent
92dfdfda
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-jobs
View file @
ca06b768
...
...
@@ -1513,17 +1513,26 @@ function jobs ()
dialog
--title
" Root overlay "
--backtitle
"
$BACKTITLE
"
--yes-label
"Disable"
\
--no-label
"Cancel"
\
--yesno
"
\n
Your system is already virtual read-only.
\n\n
Do you want to disable this feature and reboot?"
9 60
[[
$?
=
0
]]
&&
overlayroot-chroot
sed
-i
"s/^overlayroot=.*/overlayroot=
\"\"
/"
/etc/overlayroot.conf
&&
\
overlayroot-chroot
rm
/etc/update-motd.d/97-overlayroot
&&
reboot
if
[[
$?
=
0
]]
;
then
overlayroot-chroot
sed
-i
"s/^overlayroot=.*/overlayroot=
\"\"
/"
/etc/overlayroot.conf
sed
-i
"s/^overlayroot_cfgdisk=.*/overlayroot_cfgdisk=
\"
disabled
\"
/"
/etc/overlayroot.conf
overlayroot-chroot
rm
/etc/update-motd.d/97-overlayroot
reboot
fi
else
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confnew"
-y
--no-install-recommends
install
overlayroot
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confnew"
-y
install
overlayroot
debconf-apt-progress
--
apt-get
-f
-yy
install
echo
'#!/bin/bash'
>
/etc/update-motd.d/97-overlayroot
echo
'if [ -n "$(mount | grep -w tmpfs-root)" ]; then \
echo -e "[\e[0m \e[1mremember: your system is in virtual read only mode\e[0m ]\n";fi'
>>
/etc/update-motd.d/97-overlayroot
chmod
+x /etc/update-motd.d/97-overlayroot
dialog
--title
"Root overlay"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
\
--no-label
"Cancel"
--yesno
"
\n
Enable virtual read-only root and reboot."
7 45
[[
$?
=
0
]]
&&
sed
-i
"s/^overlayroot=.*/overlayroot=
\"
tmpfs
\"
/"
/etc/overlayroot.conf
&&
reboot
if
[[
$?
=
0
]]
;
then
sed
-i
"s/^overlayroot=.*/overlayroot=
\"
tmpfs
\"
/"
/etc/overlayroot.conf
sed
-i
"s/^overlayroot_cfgdisk=.*/overlayroot_cfgdisk=
\"
enabled
\"
/"
/etc/overlayroot.conf
reboot
fi
fi
fi
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment