Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converting read-only initramfs-tools pre-mount script into regular li…
…ve-boot script.
- Loading branch information
1 parent
4af5ca4
commit 5d6acf5
Showing
4 changed files
with
29 additions
and
35 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
#set -e | ||
|
||
Read_only () | ||
{ | ||
# Marking the usual block devices for harddisks read-only | ||
for _DEVICE in /dev/sd* /dev/vd* | ||
do | ||
if [ -b "${_DEVICE}" ] | ||
then | ||
printf "Setting device %-9s to read-only mode:" ${_DEVICE} > /dev/console | ||
|
||
blockdev --setro ${_DEVICE} && printf " done [ execute \"blockdev --setrw %-9s\" to unlock]\n" ${_DEVICE} > /dev/console || printf "failed\n" > /dev/console | ||
fi | ||
done | ||
} |