Skip to content

Commit 3658f36

Browse files
committed
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull arch/tile fix from Chris Metcalf: "This change allows newer Tilera boot tools to work correctly with current (and stable) kernels by using the right filename to get the initramfs from the Tilera hypervisor filesystem." * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: tile: expect new initramfs name from hypervisor file system
2 parents ff3421d + ff7f3ef commit 3658f36

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

arch/tile/kernel/setup.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,15 +1004,8 @@ void __cpuinit setup_cpu(int boot)
10041004

10051005
#ifdef CONFIG_BLK_DEV_INITRD
10061006

1007-
/*
1008-
* Note that the kernel can potentially support other compression
1009-
* techniques than gz, though we don't do so by default. If we ever
1010-
* decide to do so we can either look for other filename extensions,
1011-
* or just allow a file with this name to be compressed with an
1012-
* arbitrary compressor (somewhat counterintuitively).
1013-
*/
10141007
static int __initdata set_initramfs_file;
1015-
static char __initdata initramfs_file[128] = "initramfs.cpio.gz";
1008+
static char __initdata initramfs_file[128] = "initramfs";
10161009

10171010
static int __init setup_initramfs_file(char *str)
10181011
{
@@ -1026,9 +1019,9 @@ static int __init setup_initramfs_file(char *str)
10261019
early_param("initramfs_file", setup_initramfs_file);
10271020

10281021
/*
1029-
* We look for an "initramfs.cpio.gz" file in the hvfs.
1030-
* If there is one, we allocate some memory for it and it will be
1031-
* unpacked to the initramfs.
1022+
* We look for a file called "initramfs" in the hvfs. If there is one, we
1023+
* allocate some memory for it and it will be unpacked to the initramfs.
1024+
* If it's compressed, the initd code will uncompress it first.
10321025
*/
10331026
static void __init load_hv_initrd(void)
10341027
{
@@ -1038,10 +1031,16 @@ static void __init load_hv_initrd(void)
10381031

10391032
fd = hv_fs_findfile((HV_VirtAddr) initramfs_file);
10401033
if (fd == HV_ENOENT) {
1041-
if (set_initramfs_file)
1034+
if (set_initramfs_file) {
10421035
pr_warning("No such hvfs initramfs file '%s'\n",
10431036
initramfs_file);
1044-
return;
1037+
return;
1038+
} else {
1039+
/* Try old backwards-compatible name. */
1040+
fd = hv_fs_findfile((HV_VirtAddr)"initramfs.cpio.gz");
1041+
if (fd == HV_ENOENT)
1042+
return;
1043+
}
10451044
}
10461045
BUG_ON(fd < 0);
10471046
stat = hv_fs_fstat(fd);

0 commit comments

Comments
 (0)