[OpenWrt-Devel] [PATCH 1/4] kernel: fix ubi automount patches

Ralph Sennhauser ralph.sennhauser at gmail.com
Fri Sep 16 06:18:17 EDT 2016


When building ubi as a module modpost failes due to ROOT_DEV being
undefined. Daniel Golle suggested to add a guard to the code for
CONFIG_MTD_ROOTFS_ROOT_DEV which only is usable in case ubi is builtin
anyway.

While at it replace the deprecated config_enabled macros.

Suggested-by: Daniel Golle <daniel at makrotopia.org>
Signed-off-by: Ralph Sennhauser <ralph.sennhauser at gmail.com>
---
 .../patches-3.18/491-ubi-auto-create-ubiblock-device-for-rootfs.patch   | 2 +-
 .../patches-3.18/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch | 2 +-
 .../patches-4.1/491-ubi-auto-create-ubiblock-device-for-rootfs.patch    | 2 +-
 .../patches-4.1/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch  | 2 +-
 .../patches-4.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch    | 2 +-
 .../patches-4.4/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/linux/generic/patches-3.18/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/patches-3.18/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
index b152fba..f380ece 100644
--- a/target/linux/generic/patches-3.18/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
+++ b/target/linux/generic/patches-3.18/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
@@ -61,7 +61,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		goto err_remove;
  
 +	/* auto-attach "rootfs" volume if existing and non-ubifs */
-+	if (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV))
++	if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI))
 +		ubiblock_create_auto_rootfs();
 +
  	/*
diff --git a/target/linux/generic/patches-3.18/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch b/target/linux/generic/patches-3.18/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
index 46917d1..74be482 100644
--- a/target/linux/generic/patches-3.18/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
+++ b/target/linux/generic/patches-3.18/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
@@ -25,7 +25,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		dev->gd->disk_name, dev->ubi_num, dev->vol_id, vi->name);
 +
 +	if (!strcmp(vi->name, "rootfs") &&
-+	    config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
++	    IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI) &&
 +	    ROOT_DEV == 0) {
 +		pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n",
 +			  dev->ubi_num, dev->vol_id, vi->name);
diff --git a/target/linux/generic/patches-4.1/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/patches-4.1/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
index 433d77b..541da1f 100644
--- a/target/linux/generic/patches-4.1/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
+++ b/target/linux/generic/patches-4.1/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
@@ -61,7 +61,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	ubiblock_create_from_param();
  
 +	/* auto-attach "rootfs" volume if existing and non-ubifs */
-+	if (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV))
++	if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI))
 +		ubiblock_create_auto_rootfs();
 +
  	/*
diff --git a/target/linux/generic/patches-4.1/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch b/target/linux/generic/patches-4.1/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
index 1873752..6a8a2ce 100644
--- a/target/linux/generic/patches-4.1/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
+++ b/target/linux/generic/patches-4.1/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
@@ -25,7 +25,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		 dev->ubi_num, dev->vol_id, vi->name);
 +
 +	if (!strcmp(vi->name, "rootfs") &&
-+	    config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
++	    IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI) &&
 +	    ROOT_DEV == 0) {
 +		pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n",
 +			  dev->ubi_num, dev->vol_id, vi->name);
diff --git a/target/linux/generic/patches-4.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/patches-4.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
index da31112..b073797 100644
--- a/target/linux/generic/patches-4.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
+++ b/target/linux/generic/patches-4.4/491-ubi-auto-create-ubiblock-device-for-rootfs.patch
@@ -61,7 +61,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	ubiblock_create_from_param();
  
 +	/* auto-attach "rootfs" volume if existing and non-ubifs */
-+	if (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV))
++	if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI))
 +		ubiblock_create_auto_rootfs();
 +
  	/*
diff --git a/target/linux/generic/patches-4.4/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch b/target/linux/generic/patches-4.4/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
index f55e8e3..3944bac 100644
--- a/target/linux/generic/patches-4.4/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
+++ b/target/linux/generic/patches-4.4/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch
@@ -25,7 +25,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		 dev->ubi_num, dev->vol_id, vi->name);
 +
 +	if (!strcmp(vi->name, "rootfs") &&
-+	    config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
++	    IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && IS_BUILTIN(CONFIG_MTD_UBI) &&
 +	    ROOT_DEV == 0) {
 +		pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n",
 +			  dev->ubi_num, dev->vol_id, vi->name);
-- 
2.7.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list