Tiny Core Base > TCB Q&A Forum

init (error -26) with Core 15.0

<< < (5/6) > >>

Rich:
Hi CNK

--- Quote from: CNK on January 04, 2025, 08:09:47 PM --- ... I think RAMDISK was a red herring. ...
--- End quote ---
I think you might be right.

linic:

--- Quote from: Rich 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: ---#!/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 Xorg-7.7 flwm_topside aterm wbar
tce-load -i Xorg-7.7 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 "Xorg-7.7\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.

--- End quote ---
Thanks Rich!! What you have done is epic!
I hadn't attempted to boot in the graphical desktop because I thought that would use too much RAM. I will try that once I get a moment.

Sorry for the late reply. I got very busy lately and also got absorbed in building a custom kernel + core.gz after seeing that I could switch them easily.
The result is this: https://github.com/linic/tcl-core-560z. I was able to boot in core as I did with 14.0. Here's what the memory usage looked like with my TCZs loaded:

--- Code: ---              total        used        free      shared  buff/cache   available
Mem:          56752       11476       20764       13244       24512       28312
Swap:       3145724           0     3145724

--- End code ---
I added a link to your post in this section https://github.com/linic/tcl-core-560z?tab=readme-ov-file#summary. It will be useful for people who don't want to build their own kernel.

Kudos to you Rich and to all the team which supports tiny core linux!! This distribution is so fun to learn from! It's great how its moving parts (TCZs, core.gz kernel (vmlinuz)) are broken down so clearly and are so easily interchangeable!

Thanks again!

Rich:
Hi linic

--- Quote from: linic on January 15, 2025, 07:42:38 AM --- ... I hadn't attempted to boot in the graphical desktop because I thought that would use too much RAM. ...
--- End quote ---

--- Quote --- ... Here's what the memory usage looked like with my TCZs loaded: ...
--- End quote ---
Just for kicks, I exited from the GUI to a prompt and ran free -m:

--- Code: ---              total        used        free      shared  buff/cache   available
Mem:             52          20          25           5           8          25
Swap:           999          10         989
--- End code ---


--- Quote --- ... It will be useful for people who don't want to build their own kernel. ...
--- End quote ---
When it comes to ease of modification, time invested, and predicting
memory savings, I feel modifying core.gz wins hands down.
Core:
Removing drivers does not remove kernel capability. They can quickly be restored.

Removing unneeded drivers is easy as I demonstrated with the network driver.

By editing the script, what gets removed can easily be changed.

The script does all the work consistently and should take under a minute to run.

The file system provided by core.gz resides in RAM. The file sizes you see listed
in those directories is basically what you save in RAM if they are removed. The
same does not apply to extensions that provide drivers. Those get linked to the
RAM file system, not copied to it.

Kernel:
Removing driver support removes capability. Restoring it requires recompiling.

Making changes requires running  make menuconfig. Then navigating through
the menus disabling anything you think you don't want. You should not
edit .config directly. As you enable/disable options, make menuconfig will
enable/disable other options in the background due to changing dependencies.

Depending on hardware, compile time can become extensive. Especially if you
find yourself yourself doing it multiple times.

Predicting memory savings is difficult, more so for the kernel than the drivers.
Kernel size may or may not be affected depending on how an option was implemented.
RAM required may or may not be affected depending on how data structures are affected.

linic:
Hi Rich,


--- Quote ---When it comes to ease of modification, time invested, and predicting
memory savings, I feel modifying core.gz wins hands down.
--- End quote ---

I agree. It's way faster, easier and predictable to modify core.gz.

About custom kernels, I noticed that if I select the components I think I'll need and build directly in the kernel and not as modules the boot process seems faster. At one point, I disabled too many things using make menuconfig, I had no modules and everything was in the kernel and the system booted taking about 1/4 or 1/5 of the usual time, with network, but without being able mount partitions and fdisk -l would show nothing. I was missing some SCSI/ATA/PATA drivers if I remember correctly. What helped me guess a working set of kernel components were /var/log/messages and lsmod from Core 14.0 which doesn't need any customization to boot. Oh and make menuconfig helps also understand what each kernel option does by typing "?". That was also very useful.

About the desktop, I ran this:

--- Code: ---tce-load -wi Xorg-7.7 flwm_topside aterm wbar
tce-load -wi Xvesa
Xvesa -listmodes

--- End code ---

and then edited my .xsession


--- Code: ---Xvesa -mode 0x0115 -br -2button -mouse /dev/input/mice,5 -nolisten tcp -I >/dev/null 2>&1 &
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 ---

and got to the desktop too (see screenshot in attachments). I'm blown away by this! Thanks again!

curaga:
Yes, custom kernels help boot time quite a bit, in addition to saving space and RAM. Something to have fun with, or if you do want that fast boot.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version