Skip to content

Instantly share code, notes, and snippets.

@lucize
Last active June 1, 2020 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucize/edb9ec682d9e24ffe414a6076f9da93a to your computer and use it in GitHub Desktop.
Save lucize/edb9ec682d9e24ffe414a6076f9da93a to your computer and use it in GitHub Desktop.
scst WIP
#
# Copyright (C) 2020 Lucian Cristian <lucian.critian@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=scst
PKG_VERSION:=3.4.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/scst
PKG_HASH:=4c8c70b869c5b2c44de8904507ded7078a49aa15b928cd2ae7f21ccf21e04497
PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define Package/scst
SECTION:=net
CATEGORY:=Network
DEPENDS:=
TITLE:=SCSI target subsystem for Linux utils
URL:=http://scst.sourceforge.net
endef
define Package/scst/description
A generic SCSI target subsystem for Linux that allows to convert any Linux
server into a sophisticated storage server. The three layers in SCST are the
target driver layer; the SCSI target core and the device handler layer. SCST
target drivers realize communication with an initiator and implement a storage
protocol like iSCSI, FC or SRP. SCST device handlers implement a SCSI
interface on top of local storage.
endef
define KernelPackage/scsi-scst
SUBMENU:=Block Devices
TITLE:=SCSI target subsystem for Linux
URL:=http://scst.sourceforge.net
DEPENDS:=+kmod-lib-crc-t10dif +kmod-scsi-generic
FILES:= \
$(PKG_INSTALL_DIR)/lib/modules/$(LINUX_VERSION)/extra/*
endef
define KernelPackage/scsi-scst/description
SCST target drivers realize communication with an initiator and implement a storage
protocol like iSCSI, FC or SRP. SCST device handlers implement a SCSI interface
on top of local storage.
endef
define Build/Prepare
$(call Build/Prepare/Default)
$(SED) 's,^SCST_LOCAL_DIR,#SCST_LOCAL_DIR,' \
$(PKG_BUILD_DIR)/Makefile
$(SED) 's,^QLA_DIR,#QLA_DIR,' \
$(PKG_BUILD_DIR)/Makefile
$(SED) 's,^EMULEX_DIR,#EMULEX_DIR,' \
$(PKG_BUILD_DIR)/Makefile
$(SED) 's,\@if \[ -d $$$$(SCST_LOCAL_DIR),#\@if \[ -d $$$$(SCST_LOCAL_DIR),' \
$(PKG_BUILD_DIR)/Makefile
$(SED) 's,\@if \[ -d $$$$(QLA_DIR),#\@if \[ -d $$$$(QLA_DIR),' \
$(PKG_BUILD_DIR)/Makefile
$(SED) 's,\@if \[ -d $$$$(EMULEX_DIR),#\@if \[ -d $$$$(EMULEX_DIR);,' \
$(PKG_BUILD_DIR)/Makefile
endef
MAKE_FLAGS += \
KERNEL_PATH="$(LINUX_DIR)" \
KERNEL_SRC="$(LINUX_DIR)" \
KDIR="$(LINUX_DIR)" \
KVER="$(LINUX_VERSION)" \
BUILD_CC="$(TARGET_CC)" \
PREFIX=/usr \
2release
TARGET_CFLAGS += -Dloff_t=off_t -flto
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
#define Package/scst/conffiles
#/etc/scst.conf
#endef
define Package/scst/install
$(INSTALL_DIR) $(1)/usr/bin \
$(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/bin/scst/* \
$(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
$(1)/usr/sbin/
# $(INSTALL_DIR) $(1)/etc
# $(INSTALL_DATA) ./files/scst.conf $(1)/etc/
# $(INSTALL_DIR) $(1)/etc/init.d
# $(INSTALL_BIN) ./files/scst.init $(1)/etc/init.d/scst
endef
$(eval $(call KernelPackage,scsi-scst))
$(eval $(call BuildPackage,scst))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment