From 9849db6af760b2153f773c321aefc8ed86e0184f Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Sun, 29 Nov 2009 18:12:39 -0300 Subject: Create user and locales at boot-time. * Avoids having to maintain a private copy of the files: passwd/shadow/group/gshadow * Similar but for locales, as well as the advantage of having ready the locale database that the user wants. (all NN_MM* will be enabled) Signed-off-by: Gerardo Exequiel Pozzi [Aaron: Merged changes into syslinux-iso as well] Signed-off-by: Aaron Griffin --- configs/syslinux-iso/overlay/etc/rc.d/archiso | 36 ++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'configs/syslinux-iso/overlay/etc/rc.d') diff --git a/configs/syslinux-iso/overlay/etc/rc.d/archiso b/configs/syslinux-iso/overlay/etc/rc.d/archiso index 735c297..20c964f 100644 --- a/configs/syslinux-iso/overlay/etc/rc.d/archiso +++ b/configs/syslinux-iso/overlay/etc/rc.d/archiso @@ -22,12 +22,12 @@ scan_mount_pts () devname="/dev/$(echo ${dev} | cut -d'/' -f3,4 | cut -d'/' -f1)" mountpt="/mnt/$(basename '${devname}')" - mkdir -p "${mountpt}" 2>/dev/null - mount ${options} "${devname}" "${mountpt}" >/dev/null 2>&1 + mkdir -p "${mountpt}" 2>/dev/null + mount ${options} "${devname}" "${mountpt}" >/dev/null 2>&1 - fstype=$(awk '{ if ($1=="${devname}") { print $3" "$4;q }}' /proc/mounts) - fstype="${fstype%%,*}" - case "${fstype%% *}" in + fstype=$(awk '{ if ($1=="${devname}") { print $3" "$4;q }}' /proc/mounts) + fstype="${fstype%%,*}" + case "${fstype%% *}" in *fat*|ntfs|*dos) options="user,exec,uid=0,gid=100,umask=00070" ;; *) options="users,defaults,exec" ;; #TODO handle 'sync' on usb devices... @@ -42,7 +42,7 @@ scan_swap () { #Archie finds a pagefile.sys for windows/dos machines... may add later stat_busy "Finding existing swap partitions" - swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" + swapdev="$(fdisk -l 2>/dev/null | grep swap | cut -d' ' -f1)" if [ -e "${swapdev}" ]; then swapon ${swapdev} echo "${swapdev} swap swap defaults 0 0 #configured by archiso" >>/etc/fstab @@ -61,3 +61,27 @@ do_homedir () done stat_done } + +do_makeuser () +{ + stat_busy "Making the default user arch" + addgroups="audio,disk,optical,wheel" + useradd -p "" -g users -G $addgroups arch + stat_done +} + +do_locale_gen () +{ + stat_busy "Generating locales..." + sed -i "s/#\(${LOCALE/[@.]*}\)/\1/" /etc/locale.gen + /usr/sbin/locale-gen + stat_done +} + +case "$1" in + start) + do_locale_gen + do_makeuser + ;; +esac +exit 0 -- cgit v1.2.3-70-g09d2