diff options
author | Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> | 2009-11-29 18:12:39 -0300 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2009-12-01 13:21:29 -0800 |
commit | 9849db6af760b2153f773c321aefc8ed86e0184f (patch) | |
tree | ac6f1ec45f47cc4025d0d5ac1668f4957ee7309d /configs/install-iso/overlay/etc/rc.d | |
parent | 2b9993073cd4d378555ac40302ece96ade0178db (diff) | |
download | archiso32-9849db6af760b2153f773c321aefc8ed86e0184f.tar.xz |
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 <vmlinuz386@yahoo.com.ar>
[Aaron: Merged changes into syslinux-iso as well]
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'configs/install-iso/overlay/etc/rc.d')
-rwxr-xr-x[-rw-r--r--] | configs/install-iso/overlay/etc/rc.d/archiso | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/configs/install-iso/overlay/etc/rc.d/archiso b/configs/install-iso/overlay/etc/rc.d/archiso index 735c297..20c964f 100644..100755 --- a/configs/install-iso/overlay/etc/rc.d/archiso +++ b/configs/install-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 |