[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

recommended way to find out whether one is "within" the initramfs?



Hey.

I've just wondered whether there is recommended way to find out whether
one is currently "within" the initramfs (i.e. early boot) as generated
by Debians initramfs-tools, or not?

I'd have probably done something like checking for:
if [ -f /conf/initramfs.conf ] && [ -f /scripts/init-top/ORDER ] && [ ! -e /usr/bin/dpkg ]; then
	echo within initramfs
else
	echo not within initramfs
fi

Or are /conf/initramfs.conf and /scripts/init-top/ORDER not necessarily
included?

The check for dpkg (which shouldn't be present in the initramfs, unless
someone includes it for whichever reason) would have been to rule out
the cases where someone created the other files in his normal
userspace.


Any better ideas? :D


Thanks,
Chris.


Reply to: