Does anybody know, how to set default username, password & hostname while building linux rom using fenix script?
username, hostname is getting changed, but password is not getting changed.
Please paste the scripts content so we can help to figure out the issue.
Good day!
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"
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
Hi Gouwa,
I have posted script, can you help on this issue?
Rajendra
Hello rajendrapatil,
Have you modified other scripts?
No, I have modified only this script.
Without any modification, do you have this issue?
Yes. I built rom using posted script & tried it on VIM2, then I got these errors.
Revert the modifications and try again.
Please post the configration of source env/setenv.sh
.
Thanks.
I have already tried reversing changes, with defaut values it works.
Below is configuration of source env/setenv.sh
Choose Khadas board:
- Edge
- VIM1
- VIM2
Which board would you like? [2] 3
Choose uboot version:
- uboot-2015.01
- uboot-mainline
Which uboot version would you like? [1] 1
Choose linux version:
- linux-3.14
- linux-4.9
- linux-mainline
Which linux version would you like? [1] 2
Choose distribution:
- Ubuntu
- Debian
Which distribution would you like? [1] 1
Choose Ubuntu release:
- xenial
- bionic
Which Ubuntu release would you like? [2] 2
Choose Ubuntu type:
- server
- mate
- xfce
- lxde
Which Ubuntu type would you like? [1] 2
Choose Ubuntu architecture:
- arm64
- armhf
Which Ubuntu architecture would you like? [1] 1
Choose install type:
- EMMC
- 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.
Hello rajendrapatil,
I will build an image and feedback here laterâŚ
Thanks.
sure, waiting for your feedback.
Hello rajendrapatil,
These are some issues for bionic mate desktop, have you tried other desktop, XFCE and LXDE?
Thanks.
XFCE is working need to try LXDE
If I need to include my own code/packages in this build, how do I do that?