mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Add support for iscsi on boot to initrd (only built and added if ISCSI_SUPPORT is enabled in options).
This commit is contained in:
parent
e7e4f54f16
commit
d00667dbe4
@ -34,3 +34,7 @@ PKG_LONGDESC="debug is a Metapackage for installing initramfs"
|
|||||||
PKG_IS_ADDON="no"
|
PKG_IS_ADDON="no"
|
||||||
|
|
||||||
PKG_AUTORECONF="no"
|
PKG_AUTORECONF="no"
|
||||||
|
|
||||||
|
if [ -n "$ISCSI_SUPPORT" ] && [ "$ISCSI_SUPPORT" = yes ]; then
|
||||||
|
PKG_DEPENDS="$PKG_DEPENDS open-iscsi"
|
||||||
|
fi
|
@ -4,6 +4,7 @@
|
|||||||
# This file is part of OpenELEC - http://www.openelec.tv
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
|
||||||
# Copyright (C) 2010-2011 Roman Weber (roman@openelec.tv)
|
# Copyright (C) 2010-2011 Roman Weber (roman@openelec.tv)
|
||||||
|
# Copyright (C) 2012 Yann Cézard (eesprit@free.fr)
|
||||||
#
|
#
|
||||||
# This Program is free software; you can redistribute it and/or modify
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -66,6 +67,36 @@ NBD_DEVS="0"
|
|||||||
break=*)
|
break=*)
|
||||||
BREAK="${arg#*=}"
|
BREAK="${arg#*=}"
|
||||||
;;
|
;;
|
||||||
|
iscsi_auto)
|
||||||
|
ISCSI_AUTO=yes
|
||||||
|
;;
|
||||||
|
iscsi_initiator=*)
|
||||||
|
ISCSI_INITIATOR="${arg#iscsi_initiator=}"
|
||||||
|
;;
|
||||||
|
iscsi_target_name=*)
|
||||||
|
ISCSI_TARGET_NAME="${arg#iscsi_target_name=}"
|
||||||
|
;;
|
||||||
|
iscsi_target_ip=*)
|
||||||
|
ISCSI_TARGET_IP="${arg#iscsi_target_ip=}"
|
||||||
|
;;
|
||||||
|
iscsi_target_port=*)
|
||||||
|
ISCSI_TARGET_PORT="${arg#iscsi_target_port=}"
|
||||||
|
;;
|
||||||
|
iscsi_target_group=*)
|
||||||
|
ISCSI_TARGET_GROUP="${arg#iscsi_target_group=}"
|
||||||
|
;;
|
||||||
|
iscsi_username=*)
|
||||||
|
ISCSI_USERNAME="${arg#iscsi_username=}"
|
||||||
|
;;
|
||||||
|
iscsi_password=*)
|
||||||
|
ISCSI_PASSWORD="${arg#iscsi_password=}"
|
||||||
|
;;
|
||||||
|
iscsi_in_username=*)
|
||||||
|
ISCSI_IN_USERNAME="${arg#iscsi_in_username=}"
|
||||||
|
;;
|
||||||
|
iscsi_in_password=*)
|
||||||
|
ISCSI_IN_PASSWORD="${arg#iscsi_in_password=}"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -230,6 +261,30 @@ NBD_DEVS="0"
|
|||||||
error "load_modules" "Failed to load kernel module $module"
|
error "load_modules" "Failed to load kernel module $module"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_iscsi_login ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/bin/busybox modprobe iscsi_tcp
|
||||||
|
|
||||||
|
if [ -z $ISCSI_AUTO ]; then
|
||||||
|
for i in $ISCSI_TARGET_IP; do
|
||||||
|
/sbin/iscsistart -i $ISCSI_INITIATOR -t $ISCSI_TARGET_NAME \
|
||||||
|
-g $ISCSI_TARGET_GROUP -a $i \
|
||||||
|
-p $ISCSI_TARGET_PORT \
|
||||||
|
${ISCSI_USERNAME:+-u "$ISCSI_USERNAME"} \
|
||||||
|
${ISCSI_PASSWORD:+-w "$ISCSI_PASSWORD"} \
|
||||||
|
${ISCSI_IN_USERNAME:+-U "$ISCSI_IN_USERNAME"} \
|
||||||
|
${ISCSI_IN_PASSWORD:+-W "$ISCSI_IN_PASSWORD"}
|
||||||
|
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo "Network configuration based on iBFT."
|
||||||
|
/sbin/iscsistart -N
|
||||||
|
echo "iSCSI auto connect based on iBFT."
|
||||||
|
/sbin/iscsistart -b
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_disks() {
|
check_disks() {
|
||||||
progress "Checking disks"
|
progress "Checking disks"
|
||||||
@ -301,6 +356,10 @@ NBD_DEVS="0"
|
|||||||
|
|
||||||
[ -f "/sysroot/sbin/init" ] || error "final_check" "Could not find system."
|
[ -f "/sysroot/sbin/init" ] || error "final_check" "Could not find system."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ -n "$ISCSI_AUTO" -o -n "$ISCSI_TARGET_NAME" ]; then
|
||||||
|
do_iscsi_login
|
||||||
|
fi
|
||||||
|
|
||||||
# main boot sequence
|
# main boot sequence
|
||||||
for BOOT_STEP in \
|
for BOOT_STEP in \
|
||||||
|
31
packages/initramfs/sysutils/open-iscsi/build
Executable file
31
packages/initramfs/sysutils/open-iscsi/build
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2012 Yann Cézard (eesprit@free.fr)
|
||||||
|
#
|
||||||
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This Program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. config/options $1
|
||||||
|
|
||||||
|
cd $PKG_BUILD/utils/open-isns
|
||||||
|
./configure CFLAGS="$(OPTFLAGS)" --with-security=no \
|
||||||
|
--host=$TARGET_NAME \
|
||||||
|
--build=$HOST_NAME
|
||||||
|
cd $PKG_BUILD
|
||||||
|
make user
|
31
packages/initramfs/sysutils/open-iscsi/install
Executable file
31
packages/initramfs/sysutils/open-iscsi/install
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2012 Yann Cézard (eesprit@free.fr)
|
||||||
|
#
|
||||||
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This Program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
. config/options $1
|
||||||
|
|
||||||
|
OPEN_ISCSI_DIR="$BUILD/open-iscsi-$PKG_VERSION"
|
||||||
|
|
||||||
|
INSTALL=$ROOT/$BUILD/image/initramfs/root-image
|
||||||
|
|
||||||
|
mkdir -p $INSTALL/sbin
|
||||||
|
cp -P $OPEN_ISCSI_DIR/usr/iscsistart $INSTALL/sbin
|
37
packages/initramfs/sysutils/open-iscsi/meta
Normal file
37
packages/initramfs/sysutils/open-iscsi/meta
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
################################################################################
|
||||||
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||||
|
# Copyright (C) 2012 Yann Cézard (eesprit@free.fr)
|
||||||
|
#
|
||||||
|
# This Program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
# any later version.
|
||||||
|
#
|
||||||
|
# This Program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||||
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
PKG_NAME="open-iscsi"
|
||||||
|
PKG_VERSION="git20120226"
|
||||||
|
PKG_REV="1"
|
||||||
|
PKG_ARCH="any"
|
||||||
|
PKG_LICENSE="GPL"
|
||||||
|
PKG_SITE="http://eesprit.free.fr"
|
||||||
|
PKG_URL="$PKG_SITE/openelec.tv/bits/$PKG_NAME-$PKG_VERSION.tgz"
|
||||||
|
PKG_DEPENDS=""
|
||||||
|
PKG_BUILD_DEPENDS="toolchain util-linux"
|
||||||
|
PKG_PRIORITY="optional"
|
||||||
|
PKG_SECTION="initramfs/system"
|
||||||
|
PKG_SHORTDESC="open-iscsi: system utilities for Linux to access iSCSI targets"
|
||||||
|
PKG_LONGDESC="The open-iscsi package allows you to mount iSCSI targets. This package add support for using iscsi target as root device."
|
||||||
|
PKG_IS_ADDON="no"
|
||||||
|
|
||||||
|
PKG_AUTORECONF="no"
|
@ -0,0 +1,11 @@
|
|||||||
|
--- a/usr/Makefile 2011-08-05 11:54:52.000000000 +0200
|
||||||
|
+++ b/usr/Makefile 2011-08-05 11:55:06.000000000 +0200
|
||||||
|
@@ -63,7 +63,7 @@
|
||||||
|
|
||||||
|
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
|
||||||
|
iscsistart.o statics.o
|
||||||
|
- $(CC) $(CFLAGS) -static $^ -o $@
|
||||||
|
+ $(CC) $(CFLAGS) $^ -o $@
|
||||||
|
clean:
|
||||||
|
rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user