linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Rob Landley <rob@landley.net>,
	linux-m68k@vger.kernel.org, Laurent Vivier <Laurent@Vivier.EU>
Subject: Re: Running m68k on qemu with external initramfs?
Date: Sun, 12 Apr 2020 15:02:29 +0200	[thread overview]
Message-ID: <32e46b0f-9071-b48e-92f1-f3aa34a17dd8@physik.fu-berlin.de> (raw)
In-Reply-To: <238ea76c-fa8e-0134-667b-3864938d9a78@landley.net>

On 4/12/20 2:48 PM, Rob Landley wrote:
> Install debian to a block device to see why initramfs isn't working?

d-i uses a ramdisk so I assume that should be similar to what you are
using.

> I already downloaded and ran
> http://landley.net/aboriginal/downloads/binaries/system-image-m68k.tar.gz to
> make sure laurent's tip of tree qemu-m68k is working, and that booted to a shell
> prompt fine, but that's using a static initramfs instead of an external once,
> which is why I thought that was the issue. (It used to be back when I first made
> that work, which was something like 2014.)

Not sure I understand what your particular configuration is but I have never
run into issues with an initramfs and the root filesystem in RAM on m68k,
native or with qemu.

> I also ran my toybox binary under qemu-m68k to smoketest that the compiler was
> making binaries that ran, but it turns out that I had two problems:
> 
> 1) I'd run "make defconfig in the wrong directory and toybox switched the shell
> back off (because it's still in "pending" until I finish it), hence the not
> finding init. I stuck enough printk(KERN_ERR) into init/initramfs.c to list all
> the filenames it was extracting and figured that one out.
> 
> 2) THEN the problem was that gcc is doing something in cd_main so that the
> "chdir ." at the start of the shell setup (to set $PWD and friends) is
> segfaulting, but it's a segfault that went away when I got near it with printf()
> calls, and even write(1, "", 0); right before it made it go away. Given that
> this code has run on 32 and 64 bit, big and little endian, glibc musl and
> bionic, and on a target that's both nommu and cares about alignment?
> 
> Someday I might build gdb for m68k, but until then I should check it next time I
> upgrade compiler versions. (Or go through disabling every optimization one by
> one until I find the one that's making the registers go nuts the way sh4 had
> that https://landley.net/notes-2020.html#29-01-2020 thing.)
> 
> Rob
> 
> P.S: For context, I built a musl-cross-make toolchain and symlinked it into
> toybox, and then used "make root CROSS=m68k LINUX=~/linux" to build a system:
> 
> git clone https://github.com/landley/musl-cross-make
> git clone https://github.com/landley/toybox
> cd musl-cross-make
> sed -Ei 's/(BINUTILS_VER =).*/\1 2.32/;s/(LINUX_VER =).*/\1 4.19.90/' Makefile
> ../toybox/scripts/mcm-buildall.sh i686:: m68k::
> cd ../toybox
> ln -s ccc ../musl-cross-make/ccc
> make root CROSS=i686 LINUX=~/linux
> make root CROSS=m68k LINUX=~/linux
> 
> If you (cd root/i686; ./qemu-*.sh) it boots to a shell prompt.... well, if you
> KARGS=rdinit=/bin/sh it does, running the init script still says:
> 
> ln: cannot create symbolic link from '/proc/self/fdi/,*/}' to 'dev/i/*,/}': No y
> ln: cannot create symbolic link from '/proc/self/fdi/,*/}' to 'dev/i/*,/}': No y
> ln: cannot create symbolic link from '/proc/self/fdi/,*/}' to 'dev/i/*,/}': No y
> ln: cannot create symbolic link from '/proc/self/fdi/,*/}' to 'dev/i/*,/}': No y
> sh: exec /etc/rc/*: No such file or directory
> Type exit when done.
> oneit: /dev/CONSOLE:-console}: No such file or directory
> 
> Because I'm still halfway through teaching toysh about all the ${} constructs.
> (Also, remind me to stick echo -e '\e[?7h' at the start of my init script to
> undo the STUPID wordwrap disable escape that qemu's bios outputs, which screws
> up bash's command line history too!)
> 
> Anyway, at least it's known behavior. But in root/m68k I'm getting:
> 
> Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> CPU: 0 PID: 1 Comm: init Not tainted 5.6.0 #1
> Stack from 0f81bdfc:

So, do I understand correctly that this is buildroot with musl?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2020-04-12 13:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  0:50 Running m68k on qemu with external initramfs? Rob Landley
2020-04-11  6:12 ` Finn Thain
2020-04-12  3:36   ` Rob Landley
2020-04-12  5:29     ` Finn Thain
2020-04-12 12:34       ` Rob Landley
2020-04-12  8:27     ` John Paul Adrian Glaubitz
2020-04-12  8:31       ` Laurent Vivier
2020-04-12 21:48         ` Rob Landley
2020-04-12 23:17           ` Finn Thain
2020-04-11 12:12 ` John Paul Adrian Glaubitz
2020-04-12 12:48   ` Rob Landley
2020-04-12 13:02     ` John Paul Adrian Glaubitz [this message]
2020-04-12 21:56       ` Rob Landley
2020-04-12 23:30     ` GCC?, was " Finn Thain
2020-04-13  0:28       ` Rob Landley
2020-04-13  5:17         ` Finn Thain
2020-04-13  7:07           ` Rob Landley
2020-04-13  7:41             ` John Paul Adrian Glaubitz
2020-04-13  8:27             ` Rob Landley
2020-04-13  9:42               ` Geert Uytterhoeven
2020-04-13 23:02                 ` Finn Thain

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=32e46b0f-9071-b48e-92f1-f3aa34a17dd8@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=Laurent@Vivier.EU \
    --cc=linux-m68k@vger.kernel.org \
    --cc=rob@landley.net \
    /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 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).