Last active
April 23, 2016 10:12
-
-
Save meeuw/d42076688d99bf150a97 to your computer and use it in GitHub Desktop.
dracut module for loop mounting a root filesystem
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
#!/bin/sh | |
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
# ex: ts=8 sw=4 sts=4 et filetype=sh | |
if getargbool 0 rd.loop; then | |
info "Mount /sysroot as r/w" | |
mount -o remount,rw /sysroot | |
mkdir /run/initramfs/loop | |
mount -o bind /sysroot /run/initramfs/loop | |
umount /sysroot | |
info "Mount /sysroot/loop.img to /sysroot" | |
mount -o loop /run/initramfs/loop/loop.raw /sysroot | |
need_shutdown | |
fi |
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
#!/bin/sh | |
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | |
# ex: ts=8 sw=4 sts=4 et filetype=sh | |
if getargbool 0 rd.loop; then | |
info "Unmount /run/iniramfs/loop" | |
umount /oldsys/run/initramfs/loop | |
fi |
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
#!/bin/bash | |
check() { | |
return 0 | |
} | |
depends() { | |
return 0 | |
} | |
installkernel() { | |
instmods loop | |
} | |
install() { | |
inst_hook pre-pivot 99 "$moddir/loopmount.sh" | |
inst_hook shutdown 99 "$moddir/loopumount.sh" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment