WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: init (error -26) with Core 15.0  (Read 710 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11724
Re: init (error -26) with Core 15.0
« Reply #15 on: January 02, 2025, 01:42:39 AM »
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: [Select]
udev.children-max=1Download rootfs to /tce/boot/c15/.
Change the INITRD line to this:
Code: [Select]
INITRD /tce/boot/c15/rootfs.gz
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: [Select]
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

Offline gadget42

  • Hero Member
  • *****
  • Posts: 838
Re: init (error -26) with Core 15.0
« Reply #16 on: January 02, 2025, 02:20:50 AM »
@CNK, you referenced DSL(damnsmalllinux) but which version are you using for this experiment(ing)? thanks in advance!
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 304
Re: init (error -26) with Core 15.0
« Reply #17 on: January 02, 2025, 05:25:50 PM »
@CNK, you referenced DSL(damnsmalllinux) but which version are you using for this experiment(ing)?

v. 4.4.10.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11724
Re: init (error -26) with Core 15.0
« Reply #18 on: January 03, 2025, 12:13:44 AM »
Hi linic
I was able to boot to a desktop with 64 Mbytes.
First I trimmed down the initrd (core.gz):
Code: [Select]
#!/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"
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: [Select]
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
}
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: [Select]
tce-setdrive
You'll want to clear out the  /opt/.filetool.lst  file so /home and /opt
can't get caught up in a backup:
Code: [Select]
> /opt/.filetool.lst
Create /opt/eth0.sh:
Code: [Select]
#!/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

Edit /opt/bootlocal.sh:
Code: [Select]
#!/bin/sh
# put other system startup commands here

/opt/eth0.sh

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

Then:
Code: [Select]
tce-load -w Xorg-7.7 flwm_topside aterm wbar
tce-load -i Xorg-7.7 flwm_topside aterm wbar
Xvesa -listmodes
Pick a mode suitable for your screen.

Then edit .xsession:
Code: [Select]
/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

Then:
Code: [Select]
startxand I was presented with a desktop.

I opened a terminal and:
Code: [Select]
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:~$
I also have a swap partition that's supplying some space.

Populate onboot.lst:
Code: [Select]
printf "Xorg-7.7\nflwm_topside\naterm\nwbar\n" > /etc/sysconfig/tcedir/onboot.lst
It now boots right into the desktop.

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