Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #73213

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

From Christoph Anton Mitterer <calestyo@scientia.net>
Newsgroups linux.debian.kernel
Subject recommended way to find out whether one is "within" the initramfs?
Date 2021-10-06 18:00 +0200
Message-ID <D5huP-1sM-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.debian.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

recommended way to find out whether one is "within" the initramfs? Christoph Anton Mitterer <calestyo@scientia.net> - 2021-10-06 18:00 +0200
  Re: recommended way to find out whether one is "within" the initramfs? Romain Perier <romain.perier@gmail.com> - 2021-10-06 19:00 +0200
    Re: recommended way to find out whether one is "within" the  initramfs? Christoph Anton Mitterer <calestyo@scientia.net> - 2021-10-07 02:00 +0200
      Re: recommended way to find out whether one is "within" the initramfs? Romain Perier <romain.perier@gmail.com> - 2021-10-07 12:40 +0200

csiph-web