-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blkid & fstype implementations #359
Comments
I added blkid -o (commit 8ed78cf) but my devuan doesn't have fstype installed by default so I dunno what the default value is, and am curious how initramfs-tools is depending on it? |
Hi, I'll try last toybox-blkid release, thanks!
Regards, |
Ah, "dpkg-query -L klibc-utils" says it lives in /usr/lib/klibc/bin/fstype (not in the PATH), no wonder I couldn't find it. Let's see, what's using this... https://salsa.debian.org/kernel-team/initramfs-tools/-/blob/master/scripts/functions#L196 Ok, how is klibc code "more robust"? More robust in what way? I ran "fstype --help" which says "--help: No such file or directory", when run with no arguments it says "stdin: Illegal seek", there is no fstype man page (which is why I thought it wasn't installed when I couldn't find it in the $PATH), the output when run on an ext2.img I have lying around is two random keyword=value pairs with no obvious reason why, I ran it on the first image in tests/files/blkid (cramfs.img) which it identified the type of and said was size zero (so it's not just showing me the file size, it's pulling info out of the superblock, and getting it wrong there)... While I can gratuitously glue "FSTYPE=" to the start of all output, that makes the tool less generally useful? (It is a terrible, non-unix design.) The debian tool linked above looks like it's already falling back to use blkid when fstype produces a type name that doesn't "eval"? |
I was just testing About Runing the If we can't found a better solution for fstype I'll try to wrapp the toybox version in a initramfs-only script containing: Thanks a lot for looking into that. I appreciate so much your time and work. |
Doing an eval of random output is scary, yes, but you're kind of already doing that with the klibc output? Removing quotes from the blkid -o export creeped me out, here's hoping nobody has a fat filesystem with LABEL=;rm -rf /home In bash I could at least do: FSTYPE="$(thingy)"; [ "${FSTYPE/=//}" != "$FSTYPE" ] && eval "$FSTYPE" But I dunno what dash supports... |
Is there any way to tell microsoft github NOT to randomly eat puncutation and turn it into wiki formatting I didn't ask for? Some sort of "pre" tag around the entire reply, perhaps? Oh well, my fault for trying to post a code snippet to microsoft github: it's clearly not designed for that. (No, I don't remember their wiki syntax months after the last time this happened...) |
personally, i get frustrated by things that don't accept markdown syntax! |
That put your text in a box showing about the first 1/5 of it, with a scrollbar underneath. (I ctrl-+ my font size a bit.) |
indeed... scroll to see the bit where i say "this is why you don't want to do this, and should backquote |
Hi,
blkid
andfstype
implementations differ fromutil-linux
andklibc-utils
implementations.As
initramfs-tools
use both programs I think it make worth to mention it.blkid
Some details already noted at: #239
The
initramfs-tools
scripts runblkid
like this:(${FS} is /dev/sda1, etc)
The generated output, in my case, are
ext4
orswap
.By now,
toybox
implementation can't handle-o value
option.fstype
The
initramfs-tools
scripts runfstype
like this:(${FS} is /dev/sda1, etc)
The generated output, in my case, is:
(FSSIZE is ignored, by
initramfs-tools
)Toybox implementation write
ext4
andswap
to stdout.An eval() of that
fstype
output generate errors like the one reported here:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013074
Hope there is a way to fix that mess with different implementations 😸
Best regards,
Thanks for your time!
The text was updated successfully, but these errors were encountered: