Building a minimal system

devsda

New Member
Joined
Oct 20, 2024
Messages
2
Reaction score
2
Credits
28
Hi everyone

I'm trying to create a very basic system for a raspberry pi zero 2 w.
I've compiled the kernel, removed a lot of unnecessary drivers
and features and now it's about 20MB.

For now, i want to obtain a serial port only system, with no root device (just the / of the initramfs)

I'm dealing with the init system.
I've compiled a customized version of busybox, and put it in an initramfs compressed image.

The kernel boots and reaches the "Run /init as init process", but after that i cannot see anything more.
The /init script is:
Code:
#!/bin/sh

mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs devtmpfs /dev

exec /bin/sh
exit 0

..That should just pop out a shell, but i can't see any shell on the serial port, just the kernel output.

I'm suspecting the kernel uses the serial i passed in the kernel command line, but the init system, for some reason, opens another console.

The command line:

Code:
console=ttyAMA0,115200 console=tty1 root=/dev/ram0 vga=0
How can i disable all the other consoles and use just the serial one?
I'm using this guide

And the file tree of initramfs is:
/
├── bin
│ ├── busybox
│ └── <all the links to busybox>
├── dev
│ ├── console (char device)
│ ├── null
│ ├── root
│ └── tty
├── etc
├── lib
├── lib64
├── mnt
│ └── root
├── proc
├── root
├── sbin
│ └── <all the sbin links to /bin/busybox>
├── sys
└── usr
├── bin
│ └── <all the bin links to /bin/busybox>
└── sbin
└── <all the sbin links to /bin/busybox>
 


Hi devsda

What you are doing is waaaay over my head but maybe check out TinyCore Linux. They have a dedicated Pi subsection just for you.

Have fun

Vektor
 
Hi devsda

What you are doing is waaaay over my head but maybe check out TinyCore Linux. They have a dedicated Pi subsection just for you.

Have fun

Vektor
Hi Vektor, and thank you.

The problem was the boot line.
Now is:

Code:
console=ttyAMA0,115200 root=/dev/ram0

I removed the

Code:
console=tty1

so the init system stay attached to the same console of the kernel, and i can see its output now.
 

Members online


Latest posts

Top