Tiny Core Base > TCB Q&A Forum

init (error -26) with Core 15.0

<< < (4/6) > >>

Rich:
Hi linic
I think I found something.
Instead of using core.gz for the initrd, I used rootfs.gz found here:
http://tinycorelinux.net/15.x/x86/release/distribution_files/

I was able to boot with mem= set to 64M, 48M, and 40M.
It failed with mem= set to 32M.

Add the boot code:

--- Code: ---udev.children-max=1
--- End code ---
Download rootfs to /tce/boot/c15/.
Change the INITRD line to this:

--- Code: ---INITRD /tce/boot/c15/rootfs.gz
--- End code ---

That should get you to a command line, but you'll only have
drivers that are built into the kernel.

Stripping out some unneeded drivers from core.gz should make
it bootable.

These are some of the more heavily populated directories:

--- Code: ---tc@E310:~$ du -cs TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/net
6.1M    TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/net
6.1M    total
tc@E310:~$ du -cs TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/platform
820K    TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/platform
820K    total
tc@E310:~$ du -cs TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/hid
712K    TinycoreISOs/Core15/lib/modules/6.6.8-tinycore/kernel/drivers/hid
712K    total
--- End code ---

gadget42:
@CNK, you referenced DSL(damnsmalllinux) but which version are you using for this experiment(ing)? thanks in advance!

CNK:

--- Quote from: gadget42 on January 02, 2025, 02:20:50 AM ---@CNK, you referenced DSL(damnsmalllinux) but which version are you using for this experiment(ing)?
--- End quote ---

v. 4.4.10.

Rich:
Hi linic
I was able to boot to a desktop with 64 Mbytes.
First I trimmed down the initrd (core.gz):

--- Code: ---#!/bin/sh

# Fetch a fresh copy of the initrd.
wget http://repo.tinycorelinux.net/15.x/x86/release/distribution_files/core.gz

# Create a temporary workspace.
mkdir tmp
cd tmp

# Unpack the initrd
zcat ../core.gz | sudo cpio -i


# ---------------- Modify this section to match your system ---------------- #
# Find the driver for our NIC.
find lib/modules/6.6.8-tinycore/kernel/ -name sky2.ko*
# The find command returned this:
# lib/modules/6.6.8-tinycore/kernel/drivers/net/ethernet/marvell/sky2.ko.gz

# Save a copy of the directory containing our driver.
sudo mv lib/modules/6.6.8-tinycore/kernel/drivers/net/ethernet/marvell ../

# Remove the  net  directory (about 6 Mbytes).
sudo rm -rf lib/modules/6.6.8-tinycore/kernel/drivers/net

# Recreate the path for our saved directory.
sudo mkdir -p lib/modules/6.6.8-tinycore/kernel/drivers/net/ethernet

# Move our saved directory back to its original location.
sudo mv ../marvell lib/modules/6.6.8-tinycore/kernel/drivers/net/ethernet/
# ---------------------- End of modification section ----------------------- #


# Recreate modules.alias and modules.dep in lib/modules/6.6.8-tinycore/.
sudo depmod -a -b . 6.6.8-tinycore

# We don't need the symbols file.
sudo rm -f lib/modules/6.6.8-tinycore/*symbols

# Re-pack the initrd.
sudo find . | sudo cpio -o -H newc | gzip > ../core15Stripped.gz

# Back to our starting directory.
cd ..

# Clean up.
sudo rm -rf tmp
rm -f core.gz

echo "Your new initrd is called core15Stripped.gz"
--- End code ---
I found my NIC driver, saved its directory, removed the net directory, and
then restored the directory I saved and re-packed the initrd.
The new size is about 7.3 Mbytes.

I booted with the modified initrd and these parameters and a new partition:

--- Code: ---menuentry "*** Core-15-x86" {
search --no-floppy --fs-uuid --set=root 2bd65bbc-d71a-48be-8e35-f72f81453a15
linux /tce/Core15/vmlinuz udev.children-max=1 nodhcp nozswap norestore waitusb=5:UUID="2bd65bbc-d71a-48be-8e35-f72f81453a15" tce=UUID="2bd65bbc-d71a-48be-8e35-f72f81453a15"  home=UUID="2bd65bbc-d71a-48be-8e35-f72f81453a15" opt=UUID="2bd65bbc-d71a-48be-8e35-f72f81453a15"
initrd /tce/Core15/core15Stripped.gz
}
--- End code ---
This will create a persistent /home and /opt. You need to use a UUID that matches your system

Now run this to create a tce directory:

--- Code: ---tce-setdrive
--- End code ---

You'll want to clear out the  /opt/.filetool.lst  file so /home and /opt
can't get caught up in a backup:

--- Code: ---> /opt/.filetool.lst
--- End code ---

Create /opt/eth0.sh:

--- Code: ---#!/bin/sh
pkill udhcpc
ifconfig eth0 192.168.1.49 netmask 255.255.255.0 broadcast 192.168.1.255 up
route add default gw 192.168.1.1
echo nameserver 68.237.161.12 > /etc/resolv.conf
echo nameserver 71.243.0.12 >> /etc/resolv.conf
--- End code ---

Edit /opt/bootlocal.sh:

--- Code: ---#!/bin/sh
# put other system startup commands here

/opt/eth0.sh
--- End code ---

Reboot and run ifconfig to make sure the network is up.

Then:

--- Code: ---tce-load -w Xvesa flwm_topside aterm wbar
tce-load -i Xvesa flwm_topside aterm wbar
Xvesa -listmodes
--- End code ---
Pick a mode suitable for your screen.

Then edit .xsession:

--- Code: ---/usr/local/bin/Xvesa -mode 0x0165 -br -nolisten tcp &
export XPID=$!
waitforX || ! echo failed in waitforX || exit
"$DESKTOP" 2>/tmp/wm_errors &
export WM_PID=$!
[ -x $HOME/.setbackground ] && $HOME/.setbackground
[ -x $HOME/.mouse_config ] && $HOME/.mouse_config &
[ $(which "$ICONS".sh) ] && ${ICONS}.sh &
[ -d "/usr/local/etc/X.d" ] && find "/usr/local/etc/X.d" -type f -o -type l | sort | while read F; do . "$F"; done
[ -d "$HOME/.X.d" ] && find "$HOME/.X.d" -type f -o -type l | sort | while read F; do . "$F"; done
--- End code ---

Then:

--- Code: ---startx
--- End code ---
and I was presented with a desktop.

I opened a terminal and:

--- Code: ---tc@box:~$ sudo cache-clear
tc@box:~$ sync
tc@box:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:             52          29          12           5          11          15
Swap:           999          12         987
tc@box:~$
--- End code ---
I also have a swap partition that's supplying some space.

Populate onboot.lst:

--- Code: ---printf "Xvesa\nflwm_topside\naterm\nwbar\n" > /etc/sysconfig/tcedir/onboot.lst
--- End code ---

It now boots right into the desktop.

A copy of the script that modified the initrd is attached.

    [Edit]: Xorg-7.7 should not have been listed. Changed them to Xvesa.  Rich

CNK:

--- Quote from: Rich on January 01, 2025, 01:48:15 AM ---Even though I allocated 72 Mbytes of RAM, free reports only 60 Mbytes present:

--- Code: ---free -m
              total        used        free      shared  buff/cache   available
Mem:             60          10          22          20          27          26
Swap:             7           0           7
--- End code ---

Looking through dmesg shows the missing 12 Mbytes used as a RAM disk:

--- Code: ---    47.59M    59.76M    12.17M  RAMDISK: [mem 0x02f98000-0x03bc3fff]
--- End code ---

--- End quote ---

I think RAMDISK was a red herring. I've done some testing in TC8 (Linux kernel 4.8.17) on my laptop (with 768MB physical RAM but some memory used for graphics) and RAMDISK settings "ramdisk.rd_nr=1" or "ramdisk_size=10" don't seem to have an effect on "total" memory reported by free (763652 (745MB)).

This line in dmesg is more relevent:

--- Code: ---Memory: 755572K/777656K available (4670K kernel code, 422K rwdata, 1288K rodata, 588K init, 532K bss, 22084K reserved, 0K cma-reserved, 0K highmem)

--- End code ---

Also on my router with 32MB RAM, OpenWRT 23's Linux kernel (5.15.137) doesn't appear to be built with RAMDISK enabled, yet 10MB is missing from the total RAM reported by free on that:


--- Code: ---root@OpenWrt:~# ls /dev/ram*
ls: /dev/ram*: No such file or directory
root@OpenWrt:~# dmesg | grep Memory:
Memory: 22176K/32768K available (7124K kernel code, 641K rwdata, 884K rodata, 1328K init, 221K bss, 10592K reserved, 0K cma-reserved)
root@OpenWrt:~# free
              total        used        free      shared  buff/cache   available
Mem:          23504       16424        3616          80        3464        3772
Swap:             0           0           0
root@OpenWrt:~# dmesg | grep RAM
32MB of RAM installed
root@OpenWrt:~# uname -a
Linux OpenWrt 5.15.137 #0 SMP Tue Nov 14 13:38:11 2023 mips GNU/Linux

--- End code ---

The 1328K shown for "init" on the "Memory:" line seems to have been freed after boot.

So it's just a coincidence that RAMDISK happened to assign the same amount of memory as was reserved by the Linux kernel in your testing. It's the kernel itself taking up most of the space (besides and hardware-specific memory regions reserved by the GPU or the BIOS) and unfortunately this will keep increasing as the Linux kernel keeps getting fatter.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version