diff options
author | Alessandro Elias | 2016-02-19 13:52:03 +0100 |
---|---|---|
committer | Alessandro Elias | 2016-02-19 13:52:03 +0100 |
commit | a13ede5bcbabe41a573492da786f4c777bb5f289 (patch) | |
tree | 6be0463542579baf04ea4d5071727755f439c571 | |
parent | Enabled mount-root script, to be compatible with tor&ja. (diff) | |
download | systemd-init-a13ede5bcbabe41a573492da786f4c777bb5f289.tar.gz systemd-init-a13ede5bcbabe41a573492da786f4c777bb5f289.tar.xz systemd-init-a13ede5bcbabe41a573492da786f4c777bb5f289.zip |
Added line to probe brd kernel module.
Signed-off-by: Alessandro Elias <ae11@c3sl.ufpr.br>
-rwxr-xr-x | builder/hd-boot/hooks/prepare-root-part.sh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/builder/hd-boot/hooks/prepare-root-part.sh b/builder/hd-boot/hooks/prepare-root-part.sh index 7963ffb3..d95b5846 100755 --- a/builder/hd-boot/hooks/prepare-root-part.sh +++ b/builder/hd-boot/hooks/prepare-root-part.sh @@ -15,9 +15,6 @@ . "/usr/lib/rebash/core.sh" . "/usr/lib/hd-boot/common-lib.sh" core.import utils -core.import logging -logging.set_commands_log_level debug -logging.set_log_level debug LOOP_BACK=127.0.0.1 BLOCK_DM="root" @@ -185,6 +182,21 @@ read_only_device=$(utils.find_block_device "$SLX_SYSTEM_PARTITION_IDENTIFIER" "$ [ -z "$read_only_device" ] && \ emergency_shell -n "error" "device=\"$read_only_device\", read only block dev could not be found." +# writeable device +ramdisk_size="$SLX_RAMDISK_SIZE" +if [ "$ramdisk_size" = "" ]; then + ramdisk_size="$(cat /proc/meminfo | awk '/MemTotal/ {print $2}')" +fi +# NOTE: If the kernel modul "brd" is compiled into current kernel we can't +# configure ram disk size dynamically. In this case it have to be +# configured via kernel command line: "brd.rd_size=SITE_IN_KILOBYTE" +# statically: +#! rmmod brd 2>/dev/null +! modprobe brd rd_nr=1 max_part=1 rd_size="$ramdisk_size" && \ + emergency_shell -n "error" "Kernel module brd could not be loaded, " \ + "parameters: rd_nr=1 max_part=1 rd_size=$ramdisk_size" + + blk_dev_size=$(blockdev --getsz "$read_only_device") # make union of block device, building a layer of cow. if ! dmsetup create "$BLOCK_DM" --noudevsync --table \ |