Skip to content

Commit

Permalink
Adding the profile for Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Apr 26, 2024
1 parent 142c4f8 commit 66cde36
Show file tree
Hide file tree
Showing 46 changed files with 962 additions and 0 deletions.
2 changes: 2 additions & 0 deletions altlinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

FROM alt:p10
8 changes: 8 additions & 0 deletions ubuntu/22.04.3/scripts/scripts.d/99-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


cat <<EOF > $LWRISO_ROOT/etc/lsb-release
DISTRIB_ID=LUWRAIN
DISTRIB_RELEASE=$LWRISO_VERSION
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="LUWRAIN $LWRISO_VERSION"
EOF
1 change: 1 addition & 0 deletions ubuntu/22.04.3/todo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cups-daemon cups-client
3 changes: 3 additions & 0 deletions ubuntu/24.04/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tmp
*.iso
go-*
1 change: 1 addition & 0 deletions ubuntu/24.04/dist/bin/lwr-default-user
1 change: 1 addition & 0 deletions ubuntu/24.04/dist/bin/lwr-emacspeak
5 changes: 5 additions & 0 deletions ubuntu/24.04/dist/bin/show-dvd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>

/usr/bin/mplayer -fs -dvd-device "$1" dvd:https://1 &> /dev/null
exit $?
5 changes: 5 additions & 0 deletions ubuntu/24.04/dist/bin/show-photo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>

/usr/bin/geeqie -f "$1" &> /dev/null
exit $?
5 changes: 5 additions & 0 deletions ubuntu/24.04/dist/bin/show-video
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>

/usr/bin/mplayer -fs "$1" &> /dev/null
exit $?
1 change: 1 addition & 0 deletions ubuntu/24.04/dist/opt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
luwrain
12 changes: 12 additions & 0 deletions ubuntu/24.04/dist/opt/luwrain-utils/emacspeak-cyril.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -ur a/emacspeak-speak.el b/emacspeak-speak.el
--- a/emacspeak-speak.el 2022-11-19 12:32:17.342953057 +0700
+++ b/emacspeak-speak.el 2022-11-19 12:32:49.463563953 +0700
@@ -1206,7 +1206,7 @@
(when char
(cond
((stringp display) (dtk-speak display))
- ((> char 128) (emacspeak-speak-char-name char))
+ ;((> char 128) (emacspeak-speak-char-name char))
((and (not prefix)
(emacspeak-is-alpha-p char))
(dtk-speak (emacspeak-get-phonetic-string char)))
33 changes: 33 additions & 0 deletions ubuntu/24.04/dist/opt/luwrain-utils/lwr-default-user
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>
# Changes the default user in the installed system

THIS="${0##*/}"

[ -z "$1" ] && echo "ERROR: THIS: No partition" >&2 && exit 1
[ -z "$2" ] && echo "ERROR: THIS: No new user name" >&2 && exit 1

PART="$1"
NEW_USER="$2"

exit_handler()
{
local rc=$?
trap - EXIT
cd /
umount $PART &> /dev/null ||:
exit $rc
}
trap exit_handler EXIT HUP INT QUIT PIPE TERM

mount $PART /mnt
chroot /mnt usermod -l "$NEW_USER" luwrain
chroot /mnt groupmod -n "$NEW_USER" luwrain
chroot /mnt usermod -d "/home/$NEW_USER" "$NEW_USER"
mv /mnt/home/luwrain "/mnt/home/$NEW_USER"
echo "$NEW_USER" > /mnt/etc/luwrain/default-user
cd /mnt/etc/sudoers.d
sed -i -e s/luwrain/"$NEW_USER"/ luwrain
mv luwrain "$NEW_USER"
cd /
echo "Default system user has been successfully changed to $NEW_USER"
29 changes: 29 additions & 0 deletions ubuntu/24.04/dist/opt/luwrain-utils/lwr-emacspeak
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>

cat <<EOF | debconf-set-selections
emacspeak shared/emacspeak/database select
emacspeak shared/emacspeak/program string dtk-mv
emacspeak shared/emacspeak/fake select
emacspeak shared/emacspeak/rootgroup error
emacspeak shared/emacspeak/device select DECtalk 3
emacspeak shared/emacspeak/invaliduser error
emacspeak shared/emacspeak/port string none
emacspeak shared/emacspeak/tcl string tcl
emacspeak shared/emacspeak/groupies string
emacspeak shared/emacspeak/invalidport error
EOF

TERM=dumb apt-get -y install emacs-gtk emacspeak w3m-el
cd /usr/share/emacs/site-lisp/emacspeak/lisp
rm -f *.elc ../debian_compiled_version
patch -p1 < /opt/luwrain-utils/emacspeak-cyril.diff
/usr/lib/emacsen-common/packages/install/emacspeak emacs

cat <<EOF > /etc/emacspeak.conf
# emacspeak configuration
export DTK_PROGRAM=/usr/bin/voiceman-emacspeak
export DTK_TCL=tcl
export DTK_PORT=none
export DTK_DEVICE="espeak"
EOF
7 changes: 7 additions & 0 deletions ubuntu/24.04/dist/profile/.bash_aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

alias s='sudo systemctl'
alias d='udisksctl'
alias n='sudo nmcli'
alias bt=bluetoothctl
alias ac='sudo apt-cache'
alias ag='sudo apt-get'
108 changes: 108 additions & 0 deletions ubuntu/24.04/dist/profile/.emacs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@

(setq user-mail-address "[email protected]")
(setq user-full-name "The LUWRAIN user")

(global-set-key [f2] 'save-buffer)
(global-set-key [f3] 'find-file)
(global-set-key [f4] 'kill-buffer)
(global-set-key [f5] 'other-window)
(global-set-key [f6] 'calendar)
(global-set-key [f7] 'gnus)
(global-set-key [f8] 'w3m-browse-url)
(global-set-key [f9] 'compile)
(global-set-key [f10] 'switch-to-buffer)
(global-set-key [f11] 'delete-other-windows)
(global-set-key [S-f3] 'shell-command)
(global-set-key [S-f4] 'shell)

(global-set-key (kbd "M-а") 'forward-word)
(global-set-key (kbd "M-и") 'backward-word)
(global-set-key (kbd "C-ц") 'kill-region)
(global-set-key (kbd "M-ц") 'kill-ring-save)
(global-set-key (kbd "C-н") 'yank)

;;Open shell in the current window
(push (cons "\\*shell\\*" display-buffer--same-window-action) display-buffer-alist)

(setq make-backup-files nil)
(setq inhibit-startup-screen t)
(setq line-move-visual nil)
(setq emacspeak-gnus-punctuation-mode 'all)
(setq emacspeak-message-punctuation-mode 'all)
(setq dtk-unicode-untouched-charsets '(ascii cyrillic-iso8859-5 latin-iso8859-1))
(setq kill-buffer-query-functions nil)
(setq emacspeak-play-emacspeak-startup-icon nil)

(require 'message)
(setq mm-coding-system-priorities '(koi8-r))
(add-to-list 'mm-body-charset-encoding-alist '(koi8-r . 8bit))
(setq message-cite-function 'message-cite-original-without-signature)
(setq smtpmail-default-smtp-server "localhost")
(setq send-mail-function 'smtpmail-send-it)
(require 'smtpmail)

(require 'w3m)
(setq mm-text-html-renderer 'w3m-standalone)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-print-this-url)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-show-form-hint)

(remove-hook 'w3m-after-cursor-move-hook 'w3m-highlight-current-anchor)
(remove-hook 'w3m-after-cursor-move-hook 'w3m-auto-show)

(setq browse-url-browser-function 'w3m-browse-url)
(setq w3m-search-engine-alist
'(
("google" "http:https://www.google.ru/search?q=%s&hl=ru&ie=koi8-r" koi8-r)
))
(setq w3m-search-default-engine "google")
(setq w3m-use-cookies t)

(require 'dired-x)
(add-hook 'dired-mode-hook
(lambda ()
(setq dired-omit-files-p t)
(setq dired-omit-extensions '("~" ".o" ".a" ".la" ".toc" ".aux" ".log"))
(setq dired-omit-files "^\\.")
))

;;java
(require 'cc-mode)
(add-hook 'java-mode-hook (lambda ()
(setq c-basic-offset 4)
(c-set-offset 'substatement-open 0)
(c-set-offset 'statement-cont 0)
))

(defun emacspeak-speak-shell-command-output (&optional output)
(emacspeak-auditory-icon 'task-done)
(cond
((or (stringp output) (bufferp output)) nil)
((not output)
(let ((buffer (get-buffer "*Shell Command Output*")))
(when buffer
(with-current-buffer buffer
(if (= (point-min) (point-max))
(dtk-speak (current-message))
(emacspeak-speak-region (point-min) (min (point-max) 8192))
(when (> (point-max) 8192)
(emacspeak-queue-auditory-icon 'ellipses)))))))
(:else
(if (= (point) (mark 'force))
(dtk-speak "Empty output")
(emacspeak-speak-region (point) (min (mark 'force) (+ (point) 8192)))
(when (> (mark 'force) (+ (point) 8192))
(emacspeak-queue-auditory-icon 'ellipses))))))

(defadvice shell-command (around emacspeak activate)
(let ((emacspeak-speak-messages nil))
ad-do-it)
(when (called-interactively-p 'interactive)
(emacspeak-speak-shell-command-output (ad-get-arg 1))))

(defadvice dired-do-shell-command (around emacspeak activate)
(let ((emacspeak-speak-messages nil))
ad-do-it)
(when (called-interactively-p 'interactive)
(emacspeak-speak-shell-command-output)))


6 changes: 6 additions & 0 deletions ubuntu/24.04/dist/profile/.fetchmailrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# An example entry for gmail.com:
#poll pop.gmail.com port 995 proto POP3 user '[email protected]' pass 'example' ssl

# An example entry for yandex.ru:
#poll pop3.yandex.ru proto POP3 user '[email protected]' pass 'example' ssl sslcertck
5 changes: 5 additions & 0 deletions ubuntu/24.04/dist/profile/.xbindkeysrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

"pactl set-sink-volume @DEFAULT_SINK@ -10%"
XF86AudioLowerVolume
"pactl set-sink-volume @DEFAULT_SINK@ +10%"
XF86AudioRaiseVolume
118 changes: 118 additions & 0 deletions ubuntu/24.04/dist/sbin/lwr-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/bin/bash -e
# Copyright 2022 Michael Pozhidaev <[email protected]>
# Copyright 2015 Roman Volovodov <[email protected]>

THIS="${0##*/}"

# The log location
LOG=/tmp/luwrain-install.log

# Where we expecting the live CD squashfs image to be
SQUASH_SRC=/cdrom/casper/filesystem.squashfs

# Where we want the newly installed system to be, the values will be taken from the command line
TARGET_GRUB_DEVICE=''
TARGET_ROOT_DEV=''
ESP_DEVICE=''

print_help()
{
cat <<EOF
$THIS: The LUWRAIN installer
Usage:
$THIS [--help] [--root DEVICE] [--boot DEVICE]
Options:
--boot DEVICE - where you want the GRUB loader to be installed
--root DEVICE - what partition must be used for the root filesystem (be careful, will be formatted)
EOF
}

while [ -n "$1" ]; do
if [ "$1" == --help ]; then
print_help
exit 0
elif [ "$1" == --boot ]; then
TARGET_GRUB_DEVICE="$2"
shift
shift
elif [ "$1" == --root ]; then
TARGET_ROOT_DEV="$2"
shift
shift
elif [ "$1" == --esp ]; then
ESP_DEVICE="$2"
shift
shift
else
echo "$THIS: unknown command line option: $1:" >&2
exit 1
fi
done

[ -z "$TARGET_ROOT_DEV" ] && echo "$THIS: No root partition" >&2 && exit 1
[ -z "$TARGET_GRUB_DEVICE" ] && echo "$THIS: No grub destination device" >&2 && exit 1

if ! [ -e "$TARGET_ROOT_DEV" ]; then
echo "$THIS: The root device $TARGET_ROOT_DEV does not exist" >&2
exit 1
fi

if ! [ -e "$TARGET_GRUB_DEVICE" ]; then
echo "$THIS: The grub destination device $TARGET_GRUB_DEVICE does not exist" >&2
exit 1
fi

if [ -n "$ESP_DEVICE" ] && ! [ -e "$ESP_DEVICE" ]; then
echo "$THIS: The ESP device $ESP_DEVICE does not exist" >&2
exit 1
fi

# Where we want the root filesystem to be mounted
TARGET_MOUNT=$(mktemp -d)

# Where we want to get squashfs image mounted
SQUASH_MOUNT=$(mktemp -d)

umount $TARGET_ROOT_DEV &> /dev/null ||:
rm -f $LOG

echo Formatting the root filesystem "($TARGET_ROOT_DEV)"
mkfs.ext4 "$TARGET_ROOT_DEV" &>> $LOG
tune2fs -c 0 "$TARGET_ROOT_DEV" &>> $LOG
tune2fs -i 0 "$TARGET_ROOT_DEV" &>> $LOG
mount $TARGET_ROOT_DEV $TARGET_MOUNT &>> $LOG
mount $SQUASH_SRC $SQUASH_MOUNT &>> $LOG
echo Copying files
cp -afd $SQUASH_MOUNT/. $TARGET_MOUNT/ &>> $LOG
TARGET_ROOT_UUID="UUID=$(blkid "$TARGET_ROOT_DEV" | sed s/'^.*UUID="\([^"]*\)".*$'/'\1'/)"
echo "$(blkid "$TARGET_ROOT_DEV" | sed -e s/'^.*\(UUID=[^ ]*\) .*$'/'\1'/ | sed -e s/'"'//g)" / ext4 noatime,errors=remount-ro 0 1 >> $TARGET_MOUNT/etc/fstab
if [ -n "$ESP_DEVICE" ]; then
echo "$(blkid "$ESP_DEVICE" | sed -e s/'^.*\(UUID=[^ ]*\) .*$'/'\1'/ | sed -e s/'"'//g)" /boot/efi vfat defaults,noatime,discard 0 1 >> $TARGET_MOUNT/etc/fstab
fi

echo Installing grub
for a in dev dev/pts sys proc; do mount --bind /$a $TARGET_MOUNT/$a &>> $LOG; done
if [ -n "$ESP_DEVICE" ]; then
mkdir $TARGET_MOUNT/boot/efi
mount $ESP_DEVICE $TARGET_MOUNT/boot/efi
fi
grub-install --root-directory=$TARGET_MOUNT $TARGET_GRUB_DEVICE >> $LOG
chroot $TARGET_MOUNT grub-mkconfig -o /boot/grub/grub.cfg &>> $LOG
if [ -n "$ESP_DEVICE" ]; then
umount $TARGET_MOUNT/boot/efi
fi
for a in dev/pts dev sys proc; do umount $TARGET_MOUNT/$a >> $LOG; done

echo '127.0.0.1 localhost.localdomain localhost' >> $TARGET_MOUNT/etc/hosts
rm -rf $TARGET_MOUNT/sbin/lwr-install

#if [[ ! -z $TARGET_SWAP_DEV ]]; then
# echo $TARGET_SWAP_DEV none swap defaults 0 0 >> $TARGET_MOUNT/etc/fstab
#fi

umount $TARGET_MOUNT $SQUASH_MOUNT &>> $LOG
sync

echo LUWRAIN has been successfully installed on your computer
Loading

0 comments on commit 66cde36

Please sign in to comment.