fix some chroot commands
This commit is contained in:
parent
ce74034b47
commit
ea2bf8ee3c
@ -1,4 +1,4 @@
|
|||||||
pikainstall (1.0.5-100pika3) pikauwu; urgency=medium
|
pikainstall (1.0.5-100pika4) pikauwu; urgency=medium
|
||||||
|
|
||||||
* Initial release.
|
* Initial release.
|
||||||
|
|
||||||
|
38
pikainstall/usr/lib/pika/pikainstall/autoadder
Executable file
38
pikainstall/usr/lib/pika/pikainstall/autoadder
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
ROOT_UID=0
|
||||||
|
SUCCESS=0
|
||||||
|
E_USEREXISTS=70
|
||||||
|
|
||||||
|
# Run as root, of course. (this might not be necessary, because we have to run the script somehow with root anyway)
|
||||||
|
if [ "$UID" -ne "$ROOT_UID" ]
|
||||||
|
then
|
||||||
|
echo "Must be root to run this script."
|
||||||
|
exit $E_NOTROOT
|
||||||
|
fi
|
||||||
|
|
||||||
|
#test, if both argument are there
|
||||||
|
if [ $# -eq 2 ]; then
|
||||||
|
username=$1
|
||||||
|
pass=$2
|
||||||
|
|
||||||
|
# Check if user already exists.
|
||||||
|
grep -q "$username" /etc/passwd
|
||||||
|
if [ $? -eq $SUCCESS ]
|
||||||
|
then
|
||||||
|
echo "User $username does already exist."
|
||||||
|
echo "please chose another username."
|
||||||
|
exit $E_USEREXISTS
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Preerequisite for mkpasswd : whois
|
||||||
|
|
||||||
|
useradd -p `mkpasswd "$pass"` -d /home/"$username" -m -g users -s /bin/bash "$username"
|
||||||
|
#Allow no one else to access the home directory of the user
|
||||||
|
chmod 750 /home/"$username"
|
||||||
|
echo "the account is setup"
|
||||||
|
|
||||||
|
else
|
||||||
|
echo " Expected usage: ./autoadder username password"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
@ -16,9 +16,14 @@ chmod +x /var/albius-refind_linux.sh
|
|||||||
refind-install
|
refind-install
|
||||||
apt install -y /var/cache/apt/archives/pika-refind-theme*.deb
|
apt install -y /var/cache/apt/archives/pika-refind-theme*.deb
|
||||||
apt install -y /var/cache/apt/archives/booster*.deb
|
apt install -y /var/cache/apt/archives/booster*.deb
|
||||||
locale-gen
|
locale-genlp
|
||||||
useradd -m -k -U pikaos
|
/usr/lib/pika/pikainstall/autoadder pikaos pikaos
|
||||||
echo "pikaos"| passwd --stdin pikaos
|
usermod -a -G sudo pikaos
|
||||||
|
usermod -a -G lpadmin pikaos
|
||||||
|
mkdir -p /etc/gdm3
|
||||||
|
echo '[daemon]\nAutomaticLogin=pikaos\nAutomaticLoginEnable=True' > /etc/gdm3/daemon.conf
|
||||||
|
mkdir -p /home/pikaos/.config/dconf
|
||||||
|
chmod 700 /home/pikaos/.config/dconf
|
||||||
mkdir -p /var/lib/AccountsService/users
|
mkdir -p /var/lib/AccountsService/users
|
||||||
echo '[User]\nSession=firstsetup' > /var/lib/AccountsService/users/pikaos
|
echo '[User]\nSession=firstsetup' > /var/lib/AccountsService/users/pikaos
|
||||||
mkdir -p /home/pikaos/.config/autostart
|
mkdir -p /home/pikaos/.config/autostart
|
||||||
|
@ -13,4 +13,5 @@ genfstab -U "$1" > "$1"/etc/fstab
|
|||||||
cat "$1"/etc/fstab | grep -v zram > "$1"/etc/fstab
|
cat "$1"/etc/fstab | grep -v zram > "$1"/etc/fstab
|
||||||
mkdir -pv "$1"/usr/lib/pika/pikainstall/
|
mkdir -pv "$1"/usr/lib/pika/pikainstall/
|
||||||
cp -rvf /usr/lib/pika/pikainstall/pika-install-chroot.sh "$1"/usr/lib/pika/pikainstall/
|
cp -rvf /usr/lib/pika/pikainstall/pika-install-chroot.sh "$1"/usr/lib/pika/pikainstall/
|
||||||
|
cp -rvf /usr/lib/pika/pikainstall/autoadder "$1"/usr/lib/pika/pikainstall/
|
||||||
chroot "$1" /bin/bash -c "su - -c /usr/lib/pika/pikainstall/pika-install-chroot.sh"
|
chroot "$1" /bin/bash -c "su - -c /usr/lib/pika/pikainstall/pika-install-chroot.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user