Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit 9f70ad9

Browse files
geordieintheshellcodeAlex Reid
andauthored
Make target_core_user and uio mandatory (#26)
* And remove target_core_file, which is no longer needed Co-authored-by: Alex Reid <[email protected]>
1 parent b1393f6 commit 9f70ad9

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

scripts/01-lio/enable-lio.sh

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function module_error_log() {
1010
echo -e "${RE}ERROR: The kernel module $mod couldn't load properly. Please try to run${NC} modprobe $mod ${RE}. Once loaded, the directory $mod_dir should be accessible. Otherwise the module has not been loaded as expected.${NC}"
1111
}
1212

13-
# Configfs can be built in the kernel, hence the module
13+
# Configfs can be built in the kernel, hence the module
1414
# initstate file will not exist. Even though, the mount
1515
# is present and working
1616
echo "Checking configfs"
@@ -40,21 +40,17 @@ loop_dir="$target_dir"/loopback
4040

4141
# Enable a mod if not present
4242
# /sys/module/$modname/initstate has got the word "live"
43-
# in case the kernel module is loaded and running
44-
for mod in target_core_mod tcm_loop target_core_file uio target_core_user; do
43+
# in case the kernel module is loaded and running
44+
for mod in target_core_mod tcm_loop uio target_core_user; do
4545
state_file=/sys/module/$mod/initstate
4646
if [ -f "$state_file" ] && grep -q live "$state_file"; then
4747
echo "Module $mod is running"
48-
else
48+
else
4949
echo "Module $mod is not running"
5050
echo "--> executing \"modprobe -b $mod\""
5151
if ! modprobe -b $mod; then
52-
# core_user and uio are not mandatory
53-
if [ "$mod" != "target_core_user" ] && [ "$mod" != "uio" ]; then
54-
exit 1
55-
else
56-
echo "Couldn't enable $mod"
57-
fi
52+
echo "Couldn't enable kernel module $mod"
53+
exit 1
5854
fi
5955
# Enable module at boot
6056
mkdir -p /etc/modules-load.d
@@ -66,7 +62,7 @@ done
6662
# directories available on top of configfs
6763

6864
[ ! -d "$target_dir" ] && echo "$target_dir doesn't exist" && module_error_log "target_core_mod" "$target_dir"
69-
[ ! -d "$core_dir" ] && echo "$core_dir doesn't exist" && module_error_log "target_core_file" "$core_dir"
65+
[ ! -d "$core_dir" ] && echo "$core_dir doesn't exist" && module_error_log "target_core_user" "$core_dir"
7066
[ ! -d "$loop_dir" ] && echo "$loop_dir doesn't exist. Creating dir manually..." && mkdir $loop_dir
7167

7268
echo "LIO set up is ready!"

0 commit comments

Comments
 (0)