armlinux開發板使用者自動登入

2021-08-03 19:33:08 字數 3245 閱讀 6248

開發板:am335

虛擬機器:ubuntu

14.04

編譯器:gcc-linaro-

5.3-2016.02-x86_64_arm-linux-gnueabihf

開發板核心:linux

4.4.12

設定開發板自動登入目前而言就兩種方法

1.修改/etc/inittab檔案

2.systemd方法

1.要是檔案系統有/etc/inittab檔案的話就可以修改/etc/inittab檔案

找到如下兩行**,並在其前面新增#,將這兩行**注釋掉,**如下:

o0:12345:respawn:/sbin/getty 115200 ttyo0

1:2345:respawn:/sbin/getty 38400 tty1

在檔案最後新增如下**:

0:12345:respawn:/sbin/mingetty –autologin=root –noclear ttyo0

2.我開發板am335使用的是systemd,systemd 不使用 /etc/inittab 檔案。

root@am335x-evm:~# /sbin/agetty    

usage:

agetty [options] [,...]

agetty [options] ,...

open a terminal and set its mode.

options:

-8, --8bits assume 8-bit tty

-a, --autologin login the specified user automatically

-c, --noreset do

not reset control mode

-e, --remote use -r for login(1)

-f, --issue-file display issue file

-h, --flow-control enable hardware flow control

-h, --host specify login host

-i, --noissue do

not display issue file

-i, --init-string set init string

-j --noclear do

not clear the screen before prompt

-l, --login-program specify login program

-l, --local-line[=] control the local line flag

-m, --extract-baud extract baud rate during connect

-n, --skip-login do

not prompt for login

-n --nonewline do

not print a newline before issue

-o, --login-options options that are passed to login

-p, --login-pause wait for any key before the login

-r, --chroot change root to the directory

-r, --hangup do virtually hangup on the tty

-s, --keep-baud try to keep baud rate after break

-t, --timeout login process timeout

-u, --detect-case detect uppercase terminal

-w, --wait-cr wait carriage-return

--nohints do

not print hints

--nohostname no hostname at all will be shown

--long-hostname show full qualified hostname

--erase-chars additional backspace chars

--kill-chars additional kill chars

--chdir chdir before the login

--delay sleep seconds before prompt

--nice run login with this priority

--reload reload prompts on running agetty instances

--help display this help and exit

--version output version information and exit

for more details see agetty(8).

可以看到有個引數是可以設定自動登入的 所以只要在對應的檔案裡加入這個引數就能自動登入了

修改/etc/systemd/system/getty.target.wants/[email protected]檔案

在裡面把execstart修改為如下所示

execstart=-/sbin/agetty -8 -l %i 115200 $term –autologin root

然後重啟開發板就重啟就可以發現自動登入了

arago project  am335x-evm ttys3

arago 2016.05 am335x-evm ttys3

am335x-evm login: root (automatic login)

last login: wed jul 12

02:20:59 utc 2017

ontty1

root@am335x-evm:~#

arm linux 開發板修改時區

開發板環境編譯好之後,發現時間設定好之後,重啟立刻就變了,正好是8個小時,應該是時區的問題。使用date檢視時間是utc時間而不是cst,解決辦法 將ubuntu系統下面的 usr share zoneinfo asia shanghai檔案複製到開發板的 etc 目錄下,並改名為localtime...

開發板 2440開發板

開發板 2440 開發板coall2440 開發板 高效能 samsung s3c2440a 處理器開發板 小區智慧型開發板 樓宇對講開發板 三星 2440 開發板 珠三角電子開發 小型終端開發板 手持裝置開發方案 編譯碼 2440 開發板 深圳 2440 開發板 單片板 硬體主機板 硬體底板 jt...

如何選擇開發板和保護開發板

1.開發板分為入門學習用的和評估用的。學習用的,對於新手入門用的。首先資料得多,比如三星s3c2440,這款晶元雖然已經停產了,但是作為入門來說,非常好。也有中文資料手冊,相關資料很多。當初我買開發板以看晶元效能來買的,結果到手後,資料很少,學不進去,最後只好又買了個2440的開發板。一般而言,ti...