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


#7

Hi Gouwa,

I have posted script, can you help on this issue?

Rajendra


#8

Hello rajendrapatil,

Have you modified other scripts?


#9

No, I have modified only this script.


#10

Without any modification, do you have this issue?


#11

Yes. I built rom using posted script & tried it on VIM2, then I got these errors.


#12

Revert the modifications and try again.

Please post the configration of source env/setenv.sh.

Thanks.


#13

I have already tried reversing changes, with defaut values it works.

Below is configuration of source env/setenv.sh

Choose Khadas board:

  1. Edge
  2. VIM1
  3. VIM2

Which board would you like? [2] 3

Choose uboot version:

  1. uboot-2015.01
  2. uboot-mainline

Which uboot version would you like? [1] 1

Choose linux version:

  1. linux-3.14
  2. linux-4.9
  3. linux-mainline

Which linux version would you like? [1] 2

Choose distribution:

  1. Ubuntu
  2. Debian

Which distribution would you like? [1] 1

Choose Ubuntu release:

  1. xenial
  2. bionic

Which Ubuntu release would you like? [2] 2

Choose Ubuntu type:

  1. server
  2. mate
  3. xfce
  4. lxde

Which Ubuntu type would you like? [1] 2

Choose Ubuntu architecture:

  1. arm64
  2. armhf

Which Ubuntu architecture would you like? [1] 1

Choose install type:

  1. EMMC
  2. SD-USB

Which install type would you like? [1] 1

#VERSION: 0.4

#KHADAS_BOARD=VIM2
#VENDOR=Amlogic
#CHIP=S912
#LINUX=4.9
#UBOOT=2015.01
#DISTRIBUTION=Ubuntu
#DISTRIB_RELEASE=bionic
#DISTRIB_TYPE=mate
#DISTRIB_ARCH=arm64
#INSTALL_TYPE=EMMC

===========================================

Environment setup done.
Type ‘make’ to build.


#14

Hello rajendrapatil,

I will build an image and feedback here later…

Thanks.


#15

sure, waiting for your feedback.


#16

Hello rajendrapatil,

These are some issues for bionic mate desktop, have you tried other desktop, XFCE and LXDE?

Thanks.


#17

XFCE is working need to try LXDE

If I need to include my own code/packages in this build, how do I do that?