[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Floppy issues



Hi Gregor,

On Fri, 2025-10-31 at 11:35 +0100, Gregor Riepl wrote:
> > Sorry, I misread what you said. I initially thought you tested the patch but instead
> > just created the device node. I can build a kernel package unless the patch gets
> > posted earlier.
> 
> Ah, my bad, I wasn't clear that I only _intended_ to do it.
> 
> I'd still be interested in building custom kernels for future testing.
> 
> Can I follow the procedure in [1], or do I need some special magic to obtain a kernel like the ones that you're publishing for sparc64?

You can, but I just recommend building an upstream kernel from source using the standard Debian
configuration and cross-building it from a fast x86_64 machine instead of waiting several days
until the kernel was built on your slow SPARC machine.

Just copy the kernel configuration from your SPARC machine from /boot/config-$(uname -r) into
the kernel source tree and make sure to disable the following kernel options:

- CONFIG_EXPERT
- CONFIG_DEBUG_KERNEL
- CONFIG_MODULE_SIG
- CONFIG_SECURITY_LOCKDOWN_LSM

Disabling the first two options reduces the kernel image size and speeds up the build while the
second two options disable module verification using Debian's own certificates.

To build the kernel on an x86_64 machine, just fetch the latest kernel toolchain for sparc64 here:

https://mirrors.edge.kernel.org/pub/tools/crosstool/

Unpack it to some destination and add the bin directory to your PATH variable:

$ export PATH=/data/home/glaubitz/gcc-15.2.0-nolibc/sparc64-linux/bin:$PATH

Then build the kernel with:

$ export CROSS_COMPILE=sparc64-linux-
$ export ARCH=sparc
$ make -j<jobs> && make modules_install INSTALL_MOD_PATH=$(pwd)/mods/

where you set <jobs> according to the number of parallel jobs you want.

The modules will end up in the mods/lib/modules directory. Copy those onto the SPARC machine
into /lib/modules as well as the vmlinux image, .config and the System.map as:

/boot/vmlinux-$VERSION
/boot/config-$VERSION
/boot/System.map-$VERSION

The exact string for $VERSION will be visible in mods/lib/modules/$VERSION.

Note that it can contain a prefix such as rc2 or a "+" sign when your kernel has local patches.

On the target machine, after installing all files, run:

# update-initramfs -c -k $VERSION -v
# update-grub
# reboot

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913


Reply to: