All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Hui Li <lihui@loongson.cn>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH v5] kexec-tools: mips: Pass initrd parameter via cmdline
Date: Fri, 24 Jun 2022 16:47:53 +0200	[thread overview]
Message-ID: <YrXOmTVRcBwoulpX@vergenet.net> (raw)
In-Reply-To: <20220624093219.3192-1-lihui@loongson.cn>

On Fri, Jun 24, 2022 at 05:32:19PM +0800, Hui Li wrote:
> Under loongson platform, use command:
> kexec -l vmlinux... --append="root=UUID=28e1..." --initrd=...
> kexec -e
> quick restart failed like this:
> 
> ********************************************************************
> [    3.420791] VFS: Cannot open root device "UUID=6462a8a4-02fb-49..."
> [    3.431262] Please append a correct "root=" boot option; ...
> ...
> ...
> ...
> [    3.543175]   0801         4194304 sda1 554e69cc-01
> [    3.543175]
> [    3.549494]   0802        62914560 sda2 554e69cc-02
> [    3.549495]
> [    3.555818]   0803         8388608 sda3 554e69cc-03
> [    3.555819]
> [    3.562139]   0804       174553229 sda4 554e69cc-04
> [    3.562139]
> [    3.568463] 0b00         1048575 sr0
> [    3.568464]  driver: sr
> [    3.574524] Kernel panic - not syncing: VFS: Unable to mount root fs...
> [    3.582750] ---[ end Kernel panic - not syncing: VFS:...
> *******************************************************************
> 
> The kernel cannot parse the UUID, the UUID is parsed in the initrd.
> For compatibility with previous platforms, loongson platform obtain
> initrd parameter through cmdline in kernel, the kernel supports use
> cmdline to parse initrd. But under the mips architecture, kexec-tools
> pass the initrd through DTB.
> 
> Made the following modifications:
> 
> (1) in kexec/arch/mips/kexec-elf-mips.c
>     Add patch_initrd_info(), at runtime to distinguish different cpu,
>     only for loongson cpu, add initrd parameter to cmdline.
> 
> (2) in kexec/arch/mips/crashdump-mips.c
>     Because loongson uses a different page_offset, it should be modified
>     to ensure that crashdump functionality is correct and reliable.
> 
> (3) in kexec/arch/mips/crashdump-mips.h
>     Added platform-specific page_offset macro definition.
> 
> Signed-off-by: Hui Li <lihui@loongson.cn>

Sorry, I seem to see a compile failure with this version:

$ make
...
 mipsel-linux-gnu-gcc -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes -I../../include -I../../util_lib/include -Iinclude/ -I../../kexec/libfdt -I../../kexec/arch/mips/include  -c -MD -o kexec/arch/mips/kexec-elf-mips.o ../../kexec/arch/mips/kexec-elf-mips.c
../../kexec/arch/mips/kexec-elf-mips.c: In function ‘patch_initrd_info’:
../../kexec/arch/mips/kexec-elf-mips.c:102:20: error: ‘LOONGSON_PAGE_OFFSET’ undeclared (first use in this function)
  102 |      page_offset = LOONGSON_PAGE_OFFSET;
      |                    ^~~~~~~~~~~~~~~~~~~~
../../kexec/arch/mips/kexec-elf-mips.c:102:20: note: each undeclared identifier is reported only once for each function it appears in

Ref: https://github.com/horms/kexec-tools/runs/7043602833?check_suite_focus=true


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

      reply	other threads:[~2022-06-24 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24  9:32 [PATCH v5] kexec-tools: mips: Pass initrd parameter via cmdline Hui Li
2022-06-24 14:47 ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YrXOmTVRcBwoulpX@vergenet.net \
    --to=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=lihui@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.