* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-07 18:48 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-07 18:48 UTC (permalink / raw
To: gentoo-commits
commit: 1b73a2ea3f152c6b0df04dc83b32a3cd4972de2e
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 7 18:48:15 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Aug 7 18:48:15 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=1b73a2ea
/proc/sys/kernel/hotplug is pretty deprecated, only try to write to it if it exists
defaults/linuxrc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 9ab44c8..6bb1b98 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -385,7 +385,10 @@ good_msg 'Activating mdev'
touch /dev/mdev.seq
# Setup hotplugging for firmware loading
-echo /sbin/mdev > /proc/sys/kernel/hotplug
+if [ -f "/proc/sys/kernel/hotplug" ];
+then
+ echo /sbin/mdev > /proc/sys/kernel/hotplug
+fi
# Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel
if [ -z "${DO_modules}" ]
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-07 19:14 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-07 19:14 UTC (permalink / raw
To: gentoo-commits
commit: 4c022256838b3166e95d8d594f39f5b5cbe34928
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 7 19:14:04 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Aug 7 19:14:04 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=4c022256
add generic config checker to avoid code reuse, add check in a few more places
defaults/initrd.defaults | 2 --
defaults/initrd.scripts | 14 ++++++++++++++
defaults/linuxrc | 26 ++++++--------------------
3 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index e83f6fe..32bffc0 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 9424f5d..73e9bac 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 7edf8d5..6464280 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%,*}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-07 19:14 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-07 19:14 UTC (permalink / raw
To: gentoo-commits
commit: c81f01fd8561844a9fc9f9b7a2d8cd2b98910fae
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 7 19:03:29 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Aug 7 19:03:29 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c81f01fd
initialize overlayfs and aufs variables properly, enable unconditionally and warn if checks fail
defaults/initrd.defaults | 6 ++
defaults/linuxrc | 239 ++++++++++++++++++++++++-----------------------
2 files changed, 129 insertions(+), 116 deletions(-)
diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index b028f72..e83f6fe 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -72,9 +72,15 @@ 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'
DEFAULT_NFSOPTIONS="ro,nolock,rsize=1024,wsize=1024"
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 6bb1b98..7edf8d5 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -256,18 +256,22 @@ do
keymap=*)
keymap=${x#*=}
;;
- locale=*)
- locale=${x#*=}
- ;;
- aufs)
- if [ -f /proc/config.gz ]; then
- zcat /proc/config.gz | grep -E 'CONFIG_AUFS_FS=(m|y)' 1>/dev/null && aufs=1
- else
- warn_msg "No CONFIG_IKCONFIG support"
- warn_msg "AUFS is not guarantee to work on this medium"
- aufs=1
- fi
- ;;
+ locale=*)
+ locale=${x#*=}
+ ;;
+ 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
+ ;;
aufs\=*)
if echo "${x#*=}" | grep , &>/dev/null; then
aufs_dev_uid=${x#*,}
@@ -281,24 +285,27 @@ do
aufs_modules_dir=${x#*=}
aufs_modules=1
;;
-
- overlayfs)
- if [ -f /proc/config.gz ]; then
- zcat /proc/config.gz | grep -E 'CONFIG_OVERLAY_FS=(m|y)' 1>/dev/null && overlayfs=1
- else
- warn_msg "No CONFIG_IKCONFIG support"
- warn_msg "OVERLAYFS is not guarantee to work on this medium"
- overlayfs=1
- fi
- ;;
- overlayfs\=*)
- if echo "${x#*=}" | grep , &>/dev/null; then
- overlayfs_dev_uid=${x#*,}
- overlayfs_dev=${x%,*}
- else
- overlayfs_dev=${x#*=}
- fi
- ;;
+ 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
+ ;;
+ overlayfs\=*)
+ if echo "${x#*=}" | grep , &>/dev/null; then
+ overlayfs_dev_uid=${x#*,}
+ overlayfs_dev=${x%,*}
+ else
+ overlayfs_dev=${x#*=}
+ fi
+ ;;
# Allow user to specify the modules location
overlayfs.modules\=*)
overlayfs_modules_dir=${x#*=}
@@ -877,94 +884,94 @@ FSTAB
fi
- if [ "${USE_UNIONFS_NORMAL}" = '1' ]; then
- setup_unionfs ${NEW_ROOT} /${FS_LOCATION}
- CHROOT=/union
- elif [ 1 != "$aufs" ] && [ 1 != "$overlayfs" ]; then
- good_msg "Copying read-write image contents to tmpfs"
-
- # Copy over stuff that should be writable
- (
- cd "${NEW_ROOT}/${FS_LOCATION}"
- cp -a ${ROOT_TREES} "${NEW_ROOT}"
- ) ||
- {
- bad_msg "Copying failed, dropping into a shell."
- do_rundebugshell
- }
-
- # Now we do the links.
- for x in ${ROOT_LINKS}; do
- if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ]; then
- ln -s "$(readlink ${NEW_ROOT}/${FS_LOCATION}/${x})" "${x}" 2>/dev/null
- else
- # List all subdirectories of x
- find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null |
- while read directory; do
- # Strip the prefix of the FS_LOCATION
- directory="${directory#${NEW_ROOT}/${FS_LOCATION}/}"
-
- # Skip this directory if we already linked a parent directory
- if [ "${current_parent}" != '' ]; then
- var=$(echo "${directory}" | grep "^${current_parent}")
- if [ "${var}" != '' ]; then
- continue
- fi
- fi
- # Test if the directory exists already
- if [ -e "/${NEW_ROOT}/${directory}" ]; then
- # It does exist, link all the individual files
- for file in $(ls /${NEW_ROOT}/${FS_LOCATION}/${directory}); do
- if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ] && [ ! -e "${NEW_ROOT}/${directory}/${file}" ]; then
- ln -s "/${FS_LOCATION}/${directory}/${file}" "${directory}/${file}" 2> /dev/null
- fi
- done
- else
- # It does not exist, make a link to the livecd
- ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2>/dev/null
- current_parent="${directory}"
- fi
- done
- fi
- done
-
- mkdir -p initramfs proc tmp run sys 2>/dev/null
- chmod 1777 tmp
-
- fi
-
- # Have handy /mnt/cdrom (CDROOT_PATH) as well
- if [ 1 = "$aufs" ]; then
- [ ! -d "$CHROOT$CDROOT_PATH" ] && mkdir "$CHROOT$CDROOT_PATH"
- mount --move "$CDROOT_PATH" "$CHROOT$CDROOT_PATH"
+ if [ "${USE_UNIONFS_NORMAL}" = '1' ]; then
+ setup_unionfs ${NEW_ROOT} /${FS_LOCATION}
+ CHROOT=/union
+ elif [ 1 != "$aufs" ] && [ 1 != "$overlayfs" ]; then
+ good_msg "Copying read-write image contents to tmpfs"
+
+ # Copy over stuff that should be writable
+ (
+ cd "${NEW_ROOT}/${FS_LOCATION}"
+ cp -a ${ROOT_TREES} "${NEW_ROOT}"
+ ) ||
+ {
+ bad_msg "Copying failed, dropping into a shell."
+ do_rundebugshell
+ }
+
+ # Now we do the links.
+ for x in ${ROOT_LINKS}; do
+ if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ]; then
+ ln -s "$(readlink ${NEW_ROOT}/${FS_LOCATION}/${x})" "${x}" 2>/dev/null
else
- [ ! -d "$NEW_ROOT$CDROOT_PATH" ] && mkdir -p "$NEW_ROOT$CDROOT_PATH"
- mount --move "$CDROOT_PATH" "$NEW_ROOT$CDROOT_PATH"
+ # List all subdirectories of x
+ find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null |
+ while read directory; do
+ # Strip the prefix of the FS_LOCATION
+ directory="${directory#${NEW_ROOT}/${FS_LOCATION}/}"
+
+ # Skip this directory if we already linked a parent directory
+ if [ "${current_parent}" != '' ]; then
+ var=$(echo "${directory}" | grep "^${current_parent}")
+ if [ "${var}" != '' ]; then
+ continue
+ fi
+ fi
+ # Test if the directory exists already
+ if [ -e "/${NEW_ROOT}/${directory}" ]; then
+ # It does exist, link all the individual files
+ for file in $(ls /${NEW_ROOT}/${FS_LOCATION}/${directory}); do
+ if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ] && [ ! -e "${NEW_ROOT}/${directory}/${file}" ]; then
+ ln -s "/${FS_LOCATION}/${directory}/${file}" "${directory}/${file}" 2> /dev/null
+ fi
+ done
+ else
+ # It does not exist, make a link to the livecd
+ ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2>/dev/null
+ current_parent="${directory}"
+ fi
+ done
fi
-
- #UML=$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||')
- #if [ "${UML}" = 'UML' ]
- #then
- # # UML Fixes
- # good_msg 'Updating for uml system'
- #fi
-
- # Let Init scripts know that we booted from CD
- export CDBOOT
- CDBOOT=1
-else
- if [ "${USE_UNIONFS_NORMAL}" = '1' ]
- then
- mkdir /union_changes
- mount -t tmpfs tmpfs /union_changes
- setup_unionfs /union_changes ${NEW_ROOT}
- mkdir -p ${UNION}/tmp/.initrd
- elif [ 1 = "$aufs" ]; then
- aufs_insert_dir "$aufs_union" "$NEW_ROOT"
- mkdir -p "$aufs_union/tmp/.initrd"
- fi
-
-fi # if [ "${CDROOT}" = '1' ]
+ done
+
+ mkdir -p initramfs proc tmp run sys 2>/dev/null
+ chmod 1777 tmp
+
+ fi
+
+ # Have handy /mnt/cdrom (CDROOT_PATH) as well
+ if [ 1 = "$aufs" ]; then
+ [ ! -d "$CHROOT$CDROOT_PATH" ] && mkdir "$CHROOT$CDROOT_PATH"
+ mount --move "$CDROOT_PATH" "$CHROOT$CDROOT_PATH"
+ else
+ [ ! -d "$NEW_ROOT$CDROOT_PATH" ] && mkdir -p "$NEW_ROOT$CDROOT_PATH"
+ mount --move "$CDROOT_PATH" "$NEW_ROOT$CDROOT_PATH"
+ fi
+
+ #UML=$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||')
+ #if [ "${UML}" = 'UML' ]
+ #then
+ # # UML Fixes
+ # good_msg 'Updating for uml system'
+ #fi
+
+ # Let Init scripts know that we booted from CD
+ export CDBOOT
+ CDBOOT=1
+ else
+ if [ "${USE_UNIONFS_NORMAL}" = '1' ]
+ then
+ mkdir /union_changes
+ mount -t tmpfs tmpfs /union_changes
+ setup_unionfs /union_changes ${NEW_ROOT}
+ mkdir -p ${UNION}/tmp/.initrd
+ elif [ 1 = "$aufs" ]; then
+ aufs_insert_dir "$aufs_union" "$NEW_ROOT"
+ mkdir -p "$aufs_union/tmp/.initrd"
+ fi
+
+ fi # if [ "${CDROOT}" = '1' ]
# Mount the additional things as required by udev & systemd
if [ -f ${NEW_ROOT}/etc/initramfs.mounts ]; then
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-08 1:50 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-08 1:50 UTC (permalink / raw
To: gentoo-commits
commit: 86e2bffaaffe96728ab16d6533e7844042416a0f
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 8 01:50:28 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Tue Aug 8 01:50:28 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=86e2bffa
and in the worlds longest test cycle, one missing double quote
defaults/initrd.scripts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 73e9bac..eb75d93 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1784,7 +1784,7 @@ strip_mount_options()
}
checkzconfig() {
- if [ -r "/proc/config.gz ]; then
+ if [ -r "/proc/config.gz" ]; then
if zcat /proc/config.gz | grep -E 'CONFIG_${1}=(m|y)' 1>/dev/null;
then
return 0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-08 14:40 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-08 14:40 UTC (permalink / raw
To: gentoo-commits
commit: 5dbcdbb8a6c5ae3c8e919faff405dad843e34144
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 8 14:40:20 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Tue Aug 8 14:40:20 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5dbcdbb8
double quotes are required if you expect to interpolate, putz
defaults/initrd.scripts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index eb75d93..d8be990 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1785,7 +1785,7 @@ strip_mount_options()
checkzconfig() {
if [ -r "/proc/config.gz" ]; then
- if zcat /proc/config.gz | grep -E 'CONFIG_${1}=(m|y)' 1>/dev/null;
+ if zcat /proc/config.gz | grep -E "CONFIG_${1}=(m|y)" 1>/dev/null;
then
return 0
fi
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-08 16:49 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-08 16:49 UTC (permalink / raw
To: gentoo-commits
commit: 9bc6e25ae1236c300092cfbe24a32981e11686fe
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 8 16:49:49 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Tue Aug 8 16:49:49 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9bc6e25a
add in a debug shell to make troubleshooting easier
defaults/initrd.scripts | 1 +
1 file changed, 1 insertion(+)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index d8be990..bd3d85e 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -594,6 +594,7 @@ setup_overlayfs() {
local workdir="${overlay}/.work"
local static=/mnt/livecd
+ rundebugshell overlayfs
for i in "${overlay}" "${static}"; do
[ ! -d "${i}" ] && mkdir -p "${i}"
done
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2017-08-09 12:08 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2017-08-09 12:08 UTC (permalink / raw
To: gentoo-commits
commit: 814524dc65a06d34f9f9f4ca36487365ca0eece3
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 9 12:07:59 2017 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Aug 9 12:07:59 2017 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=814524dc
add module success message in the right place for overlayfs
defaults/initrd.scripts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index bd3d85e..5c73bfc 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -359,7 +359,11 @@ union_insert_modules() {
for module in "$1/"*.lzm; do
if [ 1 = "$overlayfs" ];then
- union_mod overlayfs "$module" || bad_msg "Unable to insert module: '$module'"
+ if union_mod overlayfs "$module";then
+ good_msg "Addition of '$module' to overlay successful"
+ else
+ bad_msg "Unable to insert module: '$module'"
+ fi
# Used in setup_overlayfs()
mod_path="$mod_path:$mod_dir/.$mod"
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/
@ 2018-04-04 16:19 Richard Farina
0 siblings, 0 replies; 8+ messages in thread
From: Richard Farina @ 2018-04-04 16:19 UTC (permalink / raw
To: gentoo-commits
commit: ef867ef851f01dac7713c09c7504b6904a99ca51
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 4 16:18:54 2018 +0000
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Wed Apr 4 16:18:54 2018 +0000
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=ef867ef8
refactor away from using /proc/config.gz and refactor /proc/filesystems usage to be uniform
defaults/initrd.scripts | 27 ++++++++++++++-------------
defaults/linuxrc | 4 ----
2 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 5c73bfc..173092f 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -605,6 +605,7 @@ setup_overlayfs() {
good_msg "Loading overlayfs"
modprobe overlay > /dev/null 2>&1
+ checkfs overlay
mount -t squashfs -o loop,ro "$CDROOT_PATH/$LOOPEXT$LOOP" "${static}"
mount -t tmpfs none "${overlay}"
@@ -762,11 +763,11 @@ fs_type_in_use() {
cut -d ' ' -f 3 < /proc/mounts | fgrep -q "${fs_type}"
}
-mount_devfs () {
+mount_devfs() {
# Use devtmpfs if enabled in kernel,
# else tmpfs. Always run mdev just in case
devfs=tmpfs
- if grep -qs devtmpfs /proc/filesystems ; then
+ if checkfs devtmpfs > /dev/null ; then
devfs=devtmpfs
fi
@@ -1434,7 +1435,7 @@ startLUKS() {
# if key is set but neither ssh enabled or key device is given, find
# the key device
-
+
if [ -e "/usr/sbin/dropbear" ]; then
startdropbear
fi
@@ -1671,6 +1672,7 @@ setup_squashfs_aufs() {
good_msg "Loading aufs module ..."
modprobe aufs &>/dev/null
+ checkfs aufs
mount -t squashfs -o loop,ro "$CDROOT_PATH/$LOOPEXT$LOOP" "$aufs_ro_branch"
mount -t tmpfs none "$aufs_rw_branch"
@@ -1788,16 +1790,15 @@ strip_mount_options()
-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
+checkfs()
+ if [ -r "/proc/filesystems" ]; then
+ if grep -qs "$1" /proc/filesystems ; then
+ return 0
+ fi
+ fi
- warn_msg "No CONFIG_${1} support"
- warn_msg "${1} is not guarantee to work on this medium"
+ warn_msg "No ${1} support listed in /proc/filesystems"
+ warn_msg "${1} is not likely to work on this medium"
- return 1
+ return 1
}
diff --git a/defaults/linuxrc b/defaults/linuxrc
index 6464280..80e1938 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -261,11 +261,9 @@ do
;;
aufs)
aufs=1
- checkzconfig AUFS_FS
;;
aufs\=*)
aufs=1
- checkzconfig AUFS_FS
if echo "${x#*=}" | grep , &>/dev/null; then
aufs_dev_uid=${x#*,}
aufs_dev=${x%,*}
@@ -280,11 +278,9 @@ do
;;
overlayfs)
overlayfs=1
- checkzconfig OVERLAY_FS
;;
overlayfs\=*)
overlayfs=1
- checkzconfig OVERLAY_FS
if echo "${x#*=}" | grep , &>/dev/null; then
overlayfs_dev_uid=${x#*,}
overlayfs_dev=${x%,*}
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-04-04 16:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-08 1:50 [gentoo-commits] proj/genkernel:overlayfs commit in: defaults/ Richard Farina
-- strict thread matches above, loose matches on Subject: below --
2018-04-04 16:19 Richard Farina
2017-08-09 12:08 Richard Farina
2017-08-08 16:49 Richard Farina
2017-08-08 14:40 Richard Farina
2017-08-07 19:14 Richard Farina
2017-08-07 19:14 Richard Farina
2017-08-07 18:48 Richard Farina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox