-
Eric Vidal authoredEric Vidal authored
customizeChroot 1.89 KiB
#!@BINDIR@/bash
# Copyright (c) 2015-2018 Eric Vidal <eric@obarun.org>
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
sourcing(){
local list
for list in /tmp/obarun-install-tmp/install.conf /usr/lib/obarun/util.sh; do
if [[ -f "${list}" ]]; then
source "${list}"
else
out_error "Missing file : ${list}"
exit
fi
done
unset list
}
sourcing
custo_once() {
local _tmp cmd
cmd="${1}"
_tmp="/tmp/obarun-install-tmp"
if [[ ! -d $_tmp ]]; then
mkdir -p -m0755 $_tmp || die "Impossible to create $_tmp"
fi
if [[ ! -e $_tmp/customize.${cmd} ]]; then
"${cmd}" || die "Cannot execute $_"
touch $_tmp/customize.${cmd}
else
return
fi
unset _tmp
}
############################## only modifie this script after this line ############################
create_log_user(){
out_action "add ${NEWUSER} at log group"
gpasswd -a "$NEWUSER" log
}
custo_once create_log_user
config_66(){
# creation of the live/ to avoid crash
mkdir -p -m1777 /run/66
out_action "Enable dbus,networkmanager, consolekit and ntpd on tree root"
66-enable -v3 dbus ntpd consolekit networkmanager
# avoid permissions access issue
chown -R ${NEWUSER}:users /run/66
out_action "Create tree graphics for ${NEWUSER}, enables and makes it current"
su "${NEWUSER}" -c "66-tree -v3 -Ecn graphics"
out_action "Enable dbus-user and xdg-user-dirs on tree graphics"
su "${NEWUSER}" -c "66-enable -v3 -t graphics dbus-user xdg-user-dirs"
rm -rf /run/66
}
custo_once config_66
## Configure pulseaudio
config_pulse(){
echo "load-module module-device-manager" >> /etc/pulse/default.pa
}
custo_once config_pulse
out_valid "Customization terminate"