-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added initramfs scripts for debian and derivatives
- Loading branch information
1 parent
f682e17
commit 0f85292
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
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,31 @@ | ||
#!/bin/sh | ||
|
||
PREREQ="" | ||
|
||
prereqs() | ||
{ | ||
echo "$PREREQ" | ||
} | ||
|
||
|
||
case $1 in | ||
prereqs) | ||
prereqs | ||
exit 0 | ||
;; | ||
esac | ||
|
||
. /scripts/functions | ||
|
||
current_dev=$(resolve_device "${ROOT}") | ||
|
||
if [[ $(blkid "${current_dev}" -s TYPE -o value) = "btrfs" ]] && [[ $(btrfs property get ${rootmnt} ro) != "ro=false" ]]; then # run only on a read only snapshot | ||
lower_dir=$(mktemp -d -p /) | ||
ram_dir=$(mktemp -d -p /) | ||
mount --move ${rootmnt} ${lower_dir} # move new_root to lower_dir | ||
mount -t tmpfs tmpfs ${ram_dir} | ||
mkdir -p ${ram_dir}/upper | ||
mkdir -p ${ram_dir}/work | ||
mount -t overlay -o lowerdir=${lower_dir},upperdir=${ram_dir}/upper,workdir=${ram_dir}/work rootfs ${rootmnt} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
. /usr/share/initramfs-tools/hook-functions | ||
|
||
manual_add_modules btrfs | ||
manual_add_modules overlay | ||
copy_exec $(which btrfs) | ||
copy_exec $(which btrfsck) | ||
copy_exec $(which blkid) | ||
|
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