extrausers.bbclass這個class允許我們在image中加入新的userand group,透過EXTRA_USERS_PARAMS 來設定,如:
新增兩個user,"tester-jim"與"tester-sue" ,其密碼都是tester01
inherit extrausers EXTRA_USERS_PARAMS = "\ useradd -P tester01 tester-jim; \ useradd -P tester01 tester-sue; \ "
也可以用於變更(設定)密碼
inherit extrausers EXTRA_USERS_PARAMS = "\ usermod -P 1876*18 root; \ "
更複雜的例子如下
inherit extrausers EXTRA_USERS_PARAMS = "\ useradd -p '' tester; \ groupadd developers; \ userdel nobody; \ groupdel -g video; \ groupmod -g 1020 developers; \ usermod -s /bin/sh tester; \ "
-
參考資料:
- https://www.yoctoproject.org/docs/1.8/ref-manual/ref-manual.html#ref-classes-extrausers, extrausers.bbclass
沒有留言:
張貼留言