Missing ifconfig because bootfs is not flashed - How can I install bootfs on my custom board?

Hi!

I have built a custom board that runs Linux. The board is using the STM32MP151 processor of 650 MHz and DDR3L memory of 512 MB. It’s a open source computer.

I want to run DietPi on that board. I have flashed the rootfs binary to my eMMC and it’s booting. So no problem on the boot sequence.

I’m using my own bootfs image for my custom board. It’s my own kernel and .dtb file and bootloader.

Therefore I’m getting some issues with the ethernet. The commands ifconfig, auto, dhcp etc. cannot be found. Here is an output from the UART. I have enabled the UART as debugging purposes.

So what I think, is that the start-up scripts are not executed at the start-up because I have a different bootfs image from STMicroelectronics. Therefore ifconfig etc. cannot be found. So my question is that: How can I make sure that when I login to the root user, the start-up scripts are executed and the ethernet + openssh is started?

Login incorrect

Give root password for maintenance
(or press Control-D to continue): 

bash: /boot/dietpi/func/dietpi-globals: No such file or directory
[e[31mFAILEDe[0m] DietPi-Login | Failed to load DietPi-Globals. Skipping DietPi login scripts...
e[?2004hroot@DietPi:~# ifconfig
e[?2004l
bash: ifconfig: command not found
e[?2004hroot@DietPi:~# ip link
e[?2004l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: end0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 5e:da:b0:c5:de:00 brd ff:ff:ff:ff:ff:ff
e[?2004hroot@DietPi:~# auto
e[?2004l
bash: auto: command not found
e[?2004hroot@DietPi:~# ineterface
e[?2004l
bash: ineterface: command not found
e[?2004hroot@DietPi:~# interface end0
e[?2004l
bash: interface: command not found
e[?2004hroot@DietPi:~# sudo apt install net-tools
e[?2004l
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudoers.d is owned by uid 1000, should be 0

Reading package lists... 0%

Reading package lists... 0%

Reading package lists... 65%

Reading package lists... Done


Building dependency tree... 0%

Building dependency tree... 0%

Building dependency tree... 50%

Building dependency tree... 50%

Building dependency tree... Done


Reading state information... 0% 

Reading state information... 0%

Reading state information... Done

e[1;31mE: e[0mUnable to locate package net-toolse[0m
e[?2004hroot@DietPi:~# sudo systemctl restart dhcpcd
e[?2004l
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudoers.d is owned by uid 1000, should be 0
e[0;1;31mFailed to restart dhcpcd.service: Unit dhcpcd.service not found.e[0m

e[?2004hroot@DietPi:~# ip addr show end0
e[?2004l
2: end0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 5e:da:b0:c5:de:00 brd ff:ff:ff:ff:ff:ff
e[?2004hroot@DietPi:~# journalctl -u networking
e[?2004l
Aug 28 14:48:02 DietPi systemd[1]: Starting networking.service - Raise network interfaces...
Aug 28 14:48:03 DietPi systemd[1]: Finished networking.service - Raise network interfaces.
e[?2004hroot@DietPi:~# ifconfig
e[?2004l
bash: ifconfig: command not found
e[?2004hroot@DietPi:~# 

ifconfig is deprecated in favor of iproute2 (ip command suite) on Linux. linux - Should I quit using Ifconfig? - Server Fault

Great!

I solved the issue by writing

ip link set end0 up
dhclient -i end0
1 Like

Keep in mind, DietPi scripts exception eth0 instead of end0.

@Joulinar

I don’t know why my ethernet handle is named end0. In the device tree, it’s “eth0”.

It’s not hard to rename the interface name.

1 Like