* [BUG] Device node major comes out wrong on HFS+ under linux
@ 2011-10-15 18:04 DagB
2011-10-18 6:25 ` Thomas Meyer
0 siblings, 1 reply; 2+ messages in thread
From: DagB @ 2011-10-15 18:04 UTC (permalink / raw)
To: linux-fsdevel, linux-kernel
Hi.
Executive summary:
/dev/null:
osx: crw-rw-rw- 1 root wheel 1, 3 Oct 13 04:12 null
linux: crw-rw-rw- 1 root root 16, 3 Oct 13 02:12 /dev/null
/dev/console:
osx: crw------- 1 root wheel 5, 1 Oct 13 04:12 console
linux: crw------- 1 root root 80, 1 Oct 13 02:12 /dev/console
/dev/sda4:
osx: brw-r----- 1 root wheel 8, 4 Oct 13 04:12 sda4
linux: brw-r----- 1 root root 128, 4 Oct 13 02:12 /dev/sda4
Details:
I am slowly figuring out how to boot linux on my shiny new macbook air.
The actual *booting* bit turns out to be incredibly easy with rEFIt,
keithp's macbook air tree, and mfleming's efi stub tree. (3.1.0-ish)
Just pop a suitable kernel somewhere rEFIt can see it, and off you go.
No mucking with bootloaders or repartitioning with esoteric tools and
options. Slick. Got to use a built-in kernel command line, though.
Shrinking the existing OSX HFS+ partition and adding another for a linux
root fs from within OSX also turned out to be a breeze.
I decided to give HFS+ a go for the root fs, just for a POC.
(I'll make an initramfs for making a sane fs. Would be cooler to do
everything from within OSX, and just reboot straight into Linux.)
Untarring a root fs on a my new HFS+ filesystem was straightforward. I
*do* get a warning from OSX' tar when creating the devicenodes, but the
nodes are created with the correct perms and major/minor.
tar: qtn_file_apply_to_path(./dev/console): Operation not permitted
results in (when viewed from OSX):
crw------- 1 root wheel 5, 1 Oct 13 04:12 dev/console
which nicely reflects what the source filesystem has.
Booting a linux kernel (with init=/bin/sh) results in:
crw------- 1 root wheel 80, 1 Oct 13 02:12 /dev/console
Clearly a Major bug. ("ka-pisch".....)
Looks like an endianness issue at hand here:
1 p
1
16 p
10000
5 p
101
80 p
1010000
8 p
1000
128 p
10000000
Good thing I didn't end up trying to dial out through my HDD....
Anyone care to squash this bug, please?
Dag B
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUG] Device node major comes out wrong on HFS+ under linux
2011-10-15 18:04 [BUG] Device node major comes out wrong on HFS+ under linux DagB
@ 2011-10-18 6:25 ` Thomas Meyer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Meyer @ 2011-10-18 6:25 UTC (permalink / raw)
To: DagB; +Cc: linux-fsdevel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 794 bytes --]
Am Samstag, den 15.10.2011, 20:04 +0200 schrieb DagB:
> Hi.
>
> Executive summary:
>
> /dev/null:
> osx: crw-rw-rw- 1 root wheel 1, 3 Oct 13 04:12 null
> linux: crw-rw-rw- 1 root root 16, 3 Oct 13 02:12 /dev/null
>
> /dev/console:
> osx: crw------- 1 root wheel 5, 1 Oct 13 04:12 console
> linux: crw------- 1 root root 80, 1 Oct 13 02:12 /dev/console
>
> /dev/sda4:
> osx: brw-r----- 1 root wheel 8, 4 Oct 13 04:12 sda4
> linux: brw-r----- 1 root root 128, 4 Oct 13 02:12 /dev/sda4
>
> Anyone care to squash this bug, please?
>
This is not a bug. Linux uses a 12/20 split for major and minor device
ids and the xnu kernel uses a 8/24 split:
8, 4
00001000 000000000000000000000100
= 128, 4
000010000000 00000000000000000100
with kind regards
thomas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-18 6:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-15 18:04 [BUG] Device node major comes out wrong on HFS+ under linux DagB
2011-10-18 6:25 ` Thomas Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).