Jump to content

Recommended Posts

Posted (edited)

I am trying to leverage the first run script but am not having any luck.

 

Here are the steps that I am following:

 

1. flashed the image onto the SD card

2. mounted SDcard on my mac (also tried steps from linux)

3. renamed the file from armbian_first_run.txt.template to armbian_first_run.txt

4. Edited the contents of the file to include the following:

FR_general_delete_this_file_after_completion=1
FR_net_change_defaults=1
FR_net_ethernet_enabled=1

FR_net_wifi_enabled=0
FR_net_wifi_ssid='MySSID'
FR_net_wifi_key='MyWiFiKEY'
FR_net_wifi_countrycode='US'

FR_net_use_static=1
FR_net_static_ip='192.168.1.201'
FR_net_static_mask='255.255.255.0'
FR_net_static_gateway='192.168.1.1'
FR_net_static_dns='192.168.1.9'

 

5. saved file and unmounted the disk

6. booted into armbian by placing the microsd card into the orangepi5 and powering on

 

From what I can tell these steps should configure the "first run" file to run on first boot and apply 192.168.1.201 as a static IP address to my ethernet interface but this doesn't happen.

 

What am I doing wrong here? I believe the file is being read on first boot because it does actually delete itself (the very first line set to True) but the device still prefers DHCP and just grabs an IP from my DHCP server.

 

 

Edited by geruta
changed doesn't to does
Posted

Here is a copy of the var/log/syslog file fresh after the first boot.

 

Also, here is the contents of /boot showing that the ambian_first_run.txt file is gone (which makes me assume it ran in part).

 

root@orangepi5:~# ls -la /boot
total 71912
drwxr-xr-x  3 root root    16384 Jan  1  1970 .
drwxr-xr-x 19 root root     4096 Jul 12 00:09 ..
-rwxr-xr-x  1 root root      213 Jul 12 00:10 armbianEnv.txt
-rwxr-xr-x  1 root root    38518 Jul  6 16:37 boot.bmp
-rwxr-xr-x  1 root root     3820 Jul  6 15:19 boot.cmd
-rwxr-xr-x  1 root root     3892 Jul  6 16:37 boot.scr
-rwxr-xr-x  1 root root   218247 Jul  6 14:08 config-5.10.160-rk35xx
drwxr-xr-x  3 root root     4096 Jul  6 16:36 dtb
-rwxr-xr-x  1 root root 34720256 Jul  6 14:08 Image
-rwxr-xr-x  1 root root 15321275 Jul  6 16:38 initrd.img-5.10.160-rk35xx
-rwxr-xr-x  1 root root        0 Jul  6 16:36 .next
-rwxr-xr-x  1 root root  7970598 Jul  6 14:08 System.map-5.10.160-rk35xx
-rwxr-xr-x  1 root root 15321339 Jul  6 16:38 uInitrd

 

syslog.txt

Posted
Quote

Jul 12 00:10:24 orangepi5 armbian-firstrun[1456]: sed: can't read /etc/skel/.config/htop/htoprc: No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun[1462]: sed: can't read /etc/skel/.config/htop/htoprc: No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun[1464]: sed: can't read /etc/skel/.config/htop/htoprc: No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun[1465]: sed: can't read /etc/skel/.config/htop/htoprc: No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun[1466]: sed: can't read /etc/skel/.config/htop/htoprc: No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun[1469]: cp: cannot stat '/etc/skel/.config': No such file or directory
Jul 12 00:10:24 orangepi5 armbian-firstrun-config[1583]: 1+0 records in
Jul 12 00:10:24 orangepi5 armbian-firstrun-config[1583]: 1+0 records out
Jul 12 00:10:24 orangepi5 armbian-firstrun-config[1583]: 16384 bytes (16 kB, 16 KiB) copied, 0.000546 s, 30.0 MB/s
Jul 12 00:10:24 orangepi5 armbian-firstrun-config[1595]: /usr/lib/armbian/armbian-firstrun-config: line 74: ifconfig: command not found
Jul 12 00:10:24 orangepi5 armbian-firstrun-config[1595]: /usr/lib/armbian/armbian-firstrun-config: line 74: ifconfig: command not found
Jul 12 00:10:34 orangepi5 armbian-firstrun[2443]: Removed /etc/systemd/system/multi-user.target.wants/armbian-firstrun.service.
Jul 12 00:10:34 orangepi5 armbian-firstrun[2443]: Removed /etc/systemd/system/multi-user.target.wants/armbian-firstrun.service.

 

Looks like ifconfig is not found and armbian-firstrun-config errors out because of it. Which image are you using ?

Posted
Quote

Which image are you using ?

 

I am using Armbian 23.5 Jammy for the orange pi 5, CLI version.


Filename: Armbian_23.5.5_Orangepi5_jammy_legacy_5.10.160.img.xz

Posted

Based on your findings @mitu I decided to try an older release. Turns out that running an image a few versions behind works exactly as expected so somewhere along the lines the ifconfig cli tool was removed from the orangepi image, breaking compatibility with the first_run script.

 

The version that I tested with successfully is Armbian_23.02.2_Orangepi5_jammy_legacy_5.10.110.img

 

The version that is confirmed to not have ifconfig (and therefore break the first_run script) is Armbian_23.02.2_Orangepi5_jammy_legacy_5.10.110.img.

 

So something after 23.02.2_Orangepi5_jammy_legacy_5.10.110 and at or before 23.02.2_Orangepi5_jammy_legacy_5.10.110 dropped ifconfig.

Posted

I ran through all of the latest images and found when the "bug" was introduced.

 

All of the "5.10.160" images of Armbian for the Orange Pi 5 have the ifconfig cli tool removed.

 

If we go to the next image before that, 23.02.2 - Jammy 5.10.110, ifconfig is present and the first_run config script works as expected.

 

Here are the results summarized

 

Failed - ifconfig cli tool missing

23.5.4 - Jammy 5.10.160

23.5.4 bookworm 5.10.160

23.5.1 - Jammy 5.10.160

23.5.1 - Bookworm 5.10.160

 

Success - ifconfig cli tool is present
23.02.2 - Jammy 5.10.110

 

 

Given the "desire" in the linux/debian community to deprecate ifconfig, i'm not sure how you all wish to proceed.

 

Should the armbian images for orange pi 5 be "fixed" to include ifconfig, or should the first_run script be modified to work with the newer ip command?

 

Posted

I think there's more than one place where ifconfig is used. Debian 12 bookworm seems to not include it by default, so perhaps it's time to be replaced with the "newer" alternative. I have a hunch that the Armbian is aware of this issue.

Posted (edited)

I just installed Armbian yesterday and even got winbox working. Anyway I usually tear out all of debian network defaults including NetworkManager and switch to ifup ifdown and Armbian also seems to use NetworkManager as default. I suggest mounting the partition and editing the files in /etc/NetworkManager/system-connections. I used armbian-config to setup several network connections so here is what my files look like 10.200.10.1 is my wired gateway. The wired connection is disabled and the Cosine wifi connection is enabled, I would guess that is why the wired autoconnect priority is -999? and wifi method=auto. So I edited the Wifi aka Cosine file to use a fixed IP 192.168.0.88 with the gateway for that happens to be 192.168.0.2 (usually on home networks this would end in .1 like 192.168.0.1 but i was messing with my Microtik doing transparent bridge to see if I could detect the addresses).

 

In short the wifi address1 line should address1=IP_ADDRESS/CIDR, GATEWAY_IP like

address1=192.168.0.88/24, 192.168.0.1

 

# '/etc/NetworkManager/system-connections/Wired connection 1.nmconnection'

[connection]
id=Wired connection 1
uuid=f592e6b4-8d0e-3a9d-9a7a-5b5d71c29645
type=ethernet
autoconnect-priority=-999
interface-name=end1
timestamp=1689367495

[ethernet]

[ipv4]
address1=10.200.10.211/24,10.200.10.1
dns=8.8.8.8;10.200.10.1;
method=manual

[ipv6]
addr-gen-mode=default
method=auto

[proxy]
 

# Then one of the wifi connections before setting it to fixed address

# /etc/NetworkManager/system-connections/Cosine.nmconnection

[connection]
id=Cosine <- change this
uuid=24b5751b-4790-4f6a-89b2-728d1a6b271f
type=wifi
interface-name=wlan0

 

[wifi]
mode=infrastructure
ssid=Cosine <- change this

 

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=mysupersecretpassword <- change this

 

[ipv4]
method=auto                       <- change this

 

[ipv6]
addr-gen-mode=default
method=auto

 

[proxy]
 

# The new file

[connection]
id=Cosine
uuid=24b5751b-4790-4f6a-89b2-728d1a6b271f
type=wifi
interface-name=wlan0

 

[wifi]
mode=infrastructure
ssid=Cosine

[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=myothersupersecretpassword

 

[ipv4]
address1=192.168.0.88/24,192.168.0.2
dns=8.8.8.8;8.8.4.4;
method=manual

 

#method=auto

 

[ipv6]
addr-gen-mode=default
method=auto

 

[proxy]
 

# BTW I could not find a way to set a fixed IP for Wifi with armbian-config .. interesting

# I rebooted and got a fixed IP 192.168.0.88 which worked though for some reason did not seem stable, could be a bad microtik wifi router?

 

Hope that works for you!

sjohn

Edited by sjohn
Posted

I tried using this in my orangepi zero, because my UART-USB connection is not working :(

 

In the *.nmconnection file, do you need to have something specific in the uuid line? May I delete the line?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines