aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDTux <contact@librepc.com>2020-01-03 15:19:15 +0000
committerGogs <gogs@fake.local>2020-01-03 15:19:15 +0000
commit415110895ec1ca7e32dc55ed3b3305359f9321c4 (patch)
tree7e451c6be9c4deeef1b7b2bc3dfdfd303b57c745
parent2c8c706aca0b732540cb61611198c1f07ef42fcb (diff)
parentc9dbaadba7b7bf38a72ae5fbcbfe59c4ec69afec (diff)
downloadmageia4arm-415110895ec1ca7e32dc55ed3b3305359f9321c4.tar
mageia4arm-415110895ec1ca7e32dc55ed3b3305359f9321c4.tar.gz
mageia4arm-415110895ec1ca7e32dc55ed3b3305359f9321c4.tar.bz2
mageia4arm-415110895ec1ca7e32dc55ed3b3305359f9321c4.tar.xz
mageia4arm-415110895ec1ca7e32dc55ed3b3305359f9321c4.zip
Merge branch 'master' of Jybz/mageia4arm into master
-rwxr-xr-xcreate_arm_img_urpmi.sh21
-rw-r--r--platforms/bananaPro/mageia4arm.cfg11
2 files changed, 25 insertions, 7 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh
index 880ddd1..09bf4a7 100755
--- a/create_arm_img_urpmi.sh
+++ b/create_arm_img_urpmi.sh
@@ -231,8 +231,25 @@ function preparechroot()
exit ${ERR_1}
fi
- info "creation of user account"
- echo -e "/bin/passwd << EOF\n${ROOT_PWD}\n${ROOT_PWD}\nEOF\n /sbin/useradd ${ID_USER}\n /bin/passwd ${ID_USER} << EOF\n${PASSWORD}\n${PASSWORD}\nEOF" >>"${BUILD_PATH}/second_stage_install.sh"
+ info "Preparation for setting root and user account"
+ if [ -n "${ROOT_PWD}" ]; then #If root password defined, it will be setted at the end of the chroot of the second_stage_install.sh script
+ echo -e " /bin/passwd << EOF\n${ROOT_PWD}\n${ROOT_PWD}\nEOF\n" >>"${BUILD_PATH}/second_stage_install.sh"
+ else
+ info "No root password... One password will be set at the first login."
+ echo -e " /bin/passwd -d root\n /bin/passwd -e root\n" >>"${BUILD_PATH}/second_stage_install.sh"
+ fi
+
+ if [ -n "${ID_USER}" ]; then #If user ID defined, it will be setted at the end of the chroot of the second_stage_install.sh script
+ echo -e " /sbin/useradd ${ID_USER}\n" >>"${BUILD_PATH}/second_stage_install.sh"
+ if [ -n "${PASSWORD}" ]; then
+ echo -e " /bin/passwd ${ID_USER} << EOF\n${PASSWORD}\n${PASSWORD}\nEOF" >>"${BUILD_PATH}/second_stage_install.sh"
+ else
+ echo -e " /bin/passwd -d ${ID_USER}\n" >>"${BUILD_PATH}/second_stage_install.sh"
+ fi
+ else
+ info "No user defined, no user account created."
+ fi
+
# info "Copying skel in root directory"
# /bin/rsync -rlptH "${BUILD_PATH}/etc/skel/" "${BUILD_PATH}/root/"
diff --git a/platforms/bananaPro/mageia4arm.cfg b/platforms/bananaPro/mageia4arm.cfg
index 0161efa..b3c2e98 100644
--- a/platforms/bananaPro/mageia4arm.cfg
+++ b/platforms/bananaPro/mageia4arm.cfg
@@ -54,15 +54,16 @@ BOOT="/mnt/boot"
ROOT="/mnt/root"
# Default user
-# TO MODIFY
-ID_USER="banana"
-PASSWORD="bananaPro"
+# If not set, no user will be defined.
+# ID_USER="banana"
+# PASSWORD="bananaPro"
#root password
-ROOT_PWD="ProR00t"
+#If not set, no root password, at the first login, the system will ask for a password.
+# ROOT_PWD="ProR00t"
#Hostname
-HOSTNAME="${TARGET}.${ID_USER}"
+HOSTNAME="${TARGET}"
#Filesystem of boot partitions (default ext4 raspberry pi need vfat)
SEPARATE_BOOT_PARTITION=0