• Geert Uytterhoeven's avatar
    initramfs: Fix initramfs size for 32-bit arches · 96f93593
    Geert Uytterhoeven authored
    Commit ffe8018c ("initramfs: fix initramfs size calculation") broke
    32-bit big-endian arches like (on ARAnyM):
    
        VFS: Cannot open root device "hda1" or unknown-block(3,1)
        Please append a correct "root=" boot option; here are the available partitions:
        fe80         1059408 nfhd8  (driver?)
          fe81          921600 nfhd8p1 00000000-0000-0000-0000-000000000nfhd8p1
          fe82          137807 nfhd8p2 00000000-0000-0000-0000-000000000nfhd8p2
        0200            3280 fd0  (driver?)
        0201            3280 fd1  (driver?)
        0300         1059408 hda  driver: ide-gd
          0301          921600 hda1 00000000-0000-0000-0000-000000000hda1
          0302          137807 hda2 00000000-0000-0000-0000-000000000hda2
        Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
    
    As pointed out by Kerstin Jonsson <kerstin.jonsson@ericsson.com>, this
    is due to CONFIG_32BIT not being defined, so the initramfs size field is
    done as a 64-bit quad.  On little-endian (like x86) this doesn matter,
    but on a big-endian machine the 32-bit reads will see the (zero) high
    bits.
    
    Only mips, s390, and score set CONFIG_32BIT for 32-bit builds, so fix it for
    all other 32-bit arches by inverting the logic and testing for CONFIG_64BIT,
    which should be defined on all 64-bit arches.
    Signed-off-by: 's avatarGeert Uytterhoeven <geert@linux-m68k.org>
    [ I think we should just make it "u64" on all architectures and get
      rid of the whole #ifdef CONFIG_xxBIT   - Linus ]
    Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
    96f93593
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
block Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt/kvm Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
REPORTING-BUGS Loading commit data...