summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2019-05-21 01:28:35 -0600
committerAaron Ball <nullspoon@oper.io>2019-05-21 01:28:35 -0600
commitb8c553301f8d6ca9e4e237923a8aaf1efa1cac84 (patch)
tree7949e2a9524a0641e69476cf69408b265e3ce1e5 /init
parent539f1ad94e8d300f187820c809fd6cf3f3857ba2 (diff)
downloadmkinitramfs-b8c553301f8d6ca9e4e237923a8aaf1efa1cac84.tar.gz
mkinitramfs-b8c553301f8d6ca9e4e237923a8aaf1efa1cac84.tar.xz
init:Add support for subvol mount optionv1.1-rc8
Diffstat (limited to 'init')
-rwxr-xr-xinit10
1 files changed, 8 insertions, 2 deletions
diff --git a/init b/init
index c34eac8..9488750 100755
--- a/init
+++ b/init
@@ -20,6 +20,7 @@ export QUIET=0
export INTERACTIVE=0
export ROOTDEV=''
export CRYPTROOT=''
+export MOUNTOPTS=()
screen_init() {
# Clear screen
@@ -36,8 +37,10 @@ screen_init() {
mount_fakeroot() {
local rootdev=${1}
local fakeroot=${2}
+ shift && shift
+ local opts=(${@})
- mount -o ro ${rootdev} ${fakeroot}
+ mount -o ro ${opts[@]} ${rootdev} ${fakeroot}
}
@@ -91,6 +94,9 @@ parse_cmdline() {
CRYPTROOT="$(echo ${i} | cut -d '=' -f 2)"
fi
;;
+ subvol=*)
+ MOUNTOPTS+=(-o subvol=${i#*=})
+ ;;
initdebug)
# Enable debug mode (this is gonna be slow)
DEBUG=1
@@ -227,7 +233,7 @@ main() {
# Mount the fakeroot.
log INFO "Mounting fakeroot"
- mount_fakeroot ${ROOTDEV} ${fakeroot}
+ mount_fakeroot ${ROOTDEV} ${fakeroot} ${MOUNTOPTS[@]}
# Ensure switch_root will be possible for destination fakeroot
if [ ! -f "${fakeroot}/sbin/init" ]; then

Generated by cgit