On 4/12/20 8:02 AM, John Paul Adrian Glaubitz wrote:
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.
Ah, I'd missed that part. (I did the debian cross-setup for arm and powerpc a
couple years back, but hadn't tried it for m68k.)
So, do I understand correctly that this is buildroot with musl?
It's mkroot, not buildroot. My current system builder is a single bash script,
currently 231 lines long:
https://github.com/landley/toybox/blob/master/scripts/mkroot.sh
Adding m68k support to it was 3 lines, which thunderbird does NOT want to indent
properly:
+elif [ "$TARGET" == m68k ]; then
+QEMU="m68k -M q800" KARCH=m68k KARGS=ttyS0 VMLINUX=vmlinux
+KCONF=MMU,M68040,M68KFPU_EMU,MAC,SCSI_MAC_ESP,MACINTOSH_DRIVERS,ADB,ADB_MACII,NET_CORE,MACSONIC,SERIAL_PMACZILOG,SERIAL_PMACZILOG_TTYS,SERIAL_PMACZILOG_CONSOLE
It uses an externally supplied cross compiler, and I'm currently trying to
support every target musl supports using musl-cross-make. (It also works with
the devuan host toolchain (glibc). I made a separate script to build all the
musl-cross-make targets although in theory you could just use the prebuilt
binary ones on https://musl.cc/ and at one point I had it working with the
Android NDK (bionic) although that was several releases back and I haven't
regression tested recently. Toybox gets regression tested against llvm by the
android guys, but building the kernel with llvm was fiddly.)
To build all supported targets, you do something like:
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
cd ../toybox
ln -s ccc ../musl-cross-make/ccc
make defconfig
make menuconfig # switch on sh and route in pending/
make root CROSS=all LINUX=~/linux ALL=1
(That last ALL=1 tells it to continue to the next architecture instead of
stopping for build breaks. I haven't got kernel configs and QEMU invocations for
the armv7r and such.)
Then booting one under qemu is just:
(cd root/sh4; ./qemu-*.sh)
Except I'm still implementing the shell so it doesn't QUITE make it through the
init script, so to get a prompt you need to:
(cd root/sh4; KARGS=rdinit=/bin/sh ./qemu-*.sh)
*shrug* Working on it...
Rob