Default username & password on fenix linux


#1

Does anybody know, how to set default username, password & hostname while building linux rom using fenix script?


#2

#3

username, hostname is getting changed, but password is not getting changed.


#4

Please paste the scripts content so we can help to figure out the issue.

Good day!


#5

Password is encrypted , please follow the instructions:

# To generate encrypted password:
# 1) password="khadas"
# 2) perl -e 'printf("%s\n", crypt($ARGV[0], "password"))' "$password"

#6

Following is the script:
#!/bin/sh

Commands for ROM release

#set -e -o pipefail

DISTRIBUTION=$1
DISTRIB_RELEASE=$2
DISTRIB_TYPE=$3
DISTRIB_ARCH=$4
KHADAS_BOARD=$5
LINUX=$6
UBOOT=$7
INSTALL_TYPE=$8
VENDOR=$9

export LC_ALL=C
export LANG=C

Setup password for root user

echo root:gnext123 | chpasswd

Admin user khadas

useradd -m -p “crAxkQgxxXPiI” -s /bin/bash gnext
usermod -aG sudo,adm gnext

Add group

DEFGROUPS=“audio,video,disk,input,tty,root,users,games,dialout,cdrom,dip,plugdev,systemd-journal,netdev,staff”
IFS=’,’
for group in $DEFGROUPS; do
/bin/egrep -i “^$group” /etc/group > /dev/null
if [ $? -eq 0 ]; then
echo “Group ‘$group’ exists in /etc/group”
else
echo “Group ‘$group’ does not exists in /etc/group, creating”
groupadd $group
fi
done
unset IFS

echo “Add gnext to ($DEFGROUPS) groups.”
usermod -a -G $DEFGROUPS gnext

Setup host

echo gnextgw > /etc/hostname

set hostname in hosts file

cat <<-EOF > /etc/hosts
127.0.0.1 localhost gnext
::1 localhost gnext ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF

if [ “$DISTRIB_TYPE” != “server” ]; then
# Enable network manager
if [ -f /etc/NetworkManager/NetworkManager.conf ]; then
sed “s/managed=(.*)/managed=true/g” -i /etc/NetworkManager/NetworkManager.conf
# Disable DNS management withing NM for !Stretch
[[ $DISTRIB_RELEASE != stretch ]] && sed “s/[main]/[main]\ndns=none/g” -i /etc/NetworkManager/NetworkManager.conf
printf ‘[keyfile]\nunmanaged-devices=interface-name:p2p0\n’ >> /etc/NetworkManager/NetworkManager.conf
fi
fi

cd /

MultiOS

if [ -f /.multi-os ]; then
mkdir -p /home/gnext/.local/share/applications
mkdir -p /home/gnext/.config/menus
mv /.menu /home/gnext/.config/menus
mv /
.desktop /home/gnext/.local/share/applications
mkdir -p /usr/share/multios/
mv /*.png /usr/share/multios/
chown gnext:gnext -R /home/gnext/.local
chown gnext:gnext -R /home/gnext/.config
rm -rf /.multi-os
fi

Clean up

apt-get -y clean
apt-get -y autoclean
#history -c

Self-deleting

rm $0

With this script password is changed.
While loading image on VIM2, I am getting following error.
The panel encountered a problem while loading “indicatorAppletCompleteFactory::IndicatorAppletComplete”
Don’t Delete Delete

The panel encountered a problem while loading “BriskMenuFactory::BriskMenu”

Don’t Delete Delete

After this menu does not appear