aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2017-08-07 15:14:04 -0400
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>2017-08-07 15:14:04 -0400
commit4c022256838b3166e95d8d594f39f5b5cbe34928 (patch)
tree9931679d13a4c71c8a8c0c0b4b00353ccb6fd632 /defaults
parentinitialize overlayfs and aufs variables properly, enable unconditionally and ... (diff)
downloadgenkernel-4c022256838b3166e95d8d594f39f5b5cbe34928.tar.gz
genkernel-4c022256838b3166e95d8d594f39f5b5cbe34928.tar.bz2
genkernel-4c022256838b3166e95d8d594f39f5b5cbe34928.zip
add generic config checker to avoid code reuse, add check in a few more places
Diffstat (limited to 'defaults')
-rwxr-xr-xdefaults/initrd.defaults2
-rw-r--r--defaults/initrd.scripts14
-rw-r--r--defaults/linuxrc26
3 files changed, 20 insertions, 22 deletions
diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index e83f6fe8..32bffc0d 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -72,13 +72,11 @@ VERIFY=0
# AUFS variables
aufs=0
-aufs_detected=0
aufs_union_file=/livecd.aufs
aufs_modules_dir=mnt/cdrom
# Overlayfs variables
overlayfs=0
-overlayfs_detected=0
overlayfs_modules_dir=mnt/cdrom
LOOPS='/livecd.loop /zisofs /livecd.squashfs /image.squashfs /livecd.gcloop'
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 9424f5d5..73e9bac9 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1782,3 +1782,17 @@ strip_mount_options()
-e 's/(,|^)(no)?auto(,|$)/,/g' \
-e 's/(,|^)iversion(,|$)/,/g'
}
+
+checkzconfig() {
+ if [ -r "/proc/config.gz ]; then
+ if zcat /proc/config.gz | grep -E 'CONFIG_${1}=(m|y)' 1>/dev/null;
+ then
+ return 0
+ fi
+ fi
+
+ warn_msg "No CONFIG_${1} support"
+ warn_msg "${1} is not guarantee to work on this medium"
+
+ return 1
+}
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 7edf8d52..64642807 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -261,18 +261,11 @@ do
;;
aufs)
aufs=1
- if [ -f /proc/config.gz ]; then
- if zcat /proc/config.gz | grep -E 'CONFIG_AUFS_FS=(m|y)' 1>/dev/null;
- then
- aufs_detected=1
- fi
- fi
- if [ "1" != "$aufs_detected" ]; then
- warn_msg "No CONFIG_IKCONFIG support"
- warn_msg "AUFS is not guarantee to work on this medium"
- fi
+ checkzconfig AUFS_FS
;;
aufs\=*)
+ aufs=1
+ checkzconfig AUFS_FS
if echo "${x#*=}" | grep , &>/dev/null; then
aufs_dev_uid=${x#*,}
aufs_dev=${x%,*}
@@ -287,18 +280,11 @@ do
;;
overlayfs)
overlayfs=1
- if [ -f /proc/config.gz ]; then
- if zcat /proc/config.gz | grep -E 'CONFIG_OVERLAY_FS=(m|y)' 1>/dev/null;
- then
- overlayfs_detected=1
- fi
- fi
- if [ "1" != "$overlayfs_detected" ]; then
- warn_msg "No CONFIG_IKCONFIG support"
- warn_msg "OVERLAYFS is not guarantee to work on this medium"
- fi
+ checkzconfig OVERLAY_FS
;;
overlayfs\=*)
+ overlayfs=1
+ checkzconfig OVERLAY_FS
if echo "${x#*=}" | grep , &>/dev/null; then
overlayfs_dev_uid=${x#*,}
overlayfs_dev=${x%,*}