ayarlar.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh -x
  2. # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
  3. # ex: ts=8 sw=4 sts=4 et filetype=sh
  4. type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
  5. masa="lxqt"
  6. echo "pisilinux" > ${NEWROOT}/etc/hostname
  7. USERNAME=$(getarg live.user)
  8. USERSHELL=$(getarg live.shell)
  9. [ -z "$USERNAME" ] && USERNAME=pisix
  10. [ -x $NEWROOT/bin/bash -a -z "$USERSHELL" ] && USERSHELL=/bin/bash
  11. [ -z "$USERSHELL" ] && USERSHELL=/bin/sh
  12. # Create /etc/default/live.conf to store USER.
  13. echo "USERNAME=$USERNAME" >> ${NEWROOT}/etc/default/live.conf
  14. chmod 644 ${NEWROOT}/etc/default/live.conf
  15. if ! grep -q ${USERSHELL} ${NEWROOT}/etc/shells ; then
  16. echo ${USERSHELL} >> ${NEWROOT}/etc/shells
  17. fi
  18. # Create new user and remove password. We'll use autologin by default.
  19. #chroot ${NEWROOT} sh -c "groupadd -g 18 'messagebus' "
  20. #chroot ${NEWROOT} sh -c "useradd -m -d /var/run/dbus -r -s /bin/false -u 18 -g 18 'messagebus' -c 'D-Bus Message Daemon' "
  21. chroot ${NEWROOT} sh -c 'useradd -m -c $USERNAME -G audio,video,wheel,utmp -s $USERSHELL $USERNAME'
  22. chroot ${NEWROOT} sh -c "groupadd -fg 84 avahi && useradd -c 'Avahi Daemon Owner' -d /var/run/avahi-daemon -u 84 -g avahi -s /bin/false avahi"
  23. chroot ${NEWROOT} sh -c "passwd -d $USERNAME >/dev/null 2>&1"
  24. # Setup default root/user password (pisilinux).
  25. chroot ${NEWROOT} sh -c 'echo "root:toor" | chpasswd -c SHA512'
  26. chroot ${NEWROOT} sh -c 'echo $USERNAME:pisix | chpasswd -c SHA512'
  27. #gerekli ayarlar
  28. #chroot ${NEWROOT} sh -c "chmod +x /usr/local/bin/tamir"
  29. #chroot ${NEWROOT} sh -c "mkdir -p /run/lock/files.ldb && touch /run/lock/files.ldb/LOCK"
  30. echo "tamir" >> ${NEWROOT}/root/.xinitrc
  31. echo "exec start"$masa >> ${NEWROOT}/root/.xinitrc
  32. echo "tamir" >> ${NEWROOT}/home/$USERNAME/.xinitrc
  33. echo "exec start"$masa >> ${NEWROOT}/home/$USERNAME/.xinitrc
  34. # Enable sudo permission by default.
  35. if [ -f ${NEWROOT}/etc/sudoers ]; then
  36. echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
  37. fi
  38. cp /run/initramfs/live/boot/kernel $NEWROOT/boot/kernel