Re: [util-linux] [PATCH 4/5] sulogin: mount temporary /dev and /proc if not found

Dr. Werner Fink
2012-12-07T17:25:10Z

On Fri, Dec 07, 2012 at 12:01:18PM -0500, Dave Reisner wrote:
>
> Ok, I didn't realize udev still was responsible for these links these
> days, but perusing the code shows otherwise. Could you explain why
> sulogin is wanted in the initramfs? Seems like an odd use case to me.
>
> > If in initrd the sulogin will be called after mounting /proc and /dev and running
> > udev rules or enabling the links in initrd then the code does only check for existence
> > of /proc and /dev.
>
> If you're in the initramfs, rootfs is tmpfs. Won't your statfs check
> return a buffer which has f_type == TMPFS_MAGIC even if /dev is not
> mounted?

Hmmm ... maybe a check for RAMFS_MAGIC should be done before to
distinguish between TMPFS_MAGIC or RAMFS_MAGIC for the initrd.
Or the mounted /proc could be used to check for /dev

Werner

--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr