Skip to content

Commit c6af984

Browse files
committed
Merge branch 'master' of github.com:Shells-com/linux-scripts
2 parents 97b68be + f54b23f commit c6af984

File tree

9 files changed

+107
-7
lines changed

9 files changed

+107
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For list of currently available builds, take a look at [official_images.txt](htt
1414

1515
# Submit/maintain your distribution
1616

17-
Shells wants to help Linux community as much as it can, so if you would like to see your own distribution on the list, submit PR with it and we will gladly merge it. Be sure to read about some simple rules around how to build images for Shells at [os_requirements.txt](https://github.com/Shells-com/linux-scripts/blob/master/os_requirements.txt).
17+
Shells wants to help Linux community as much as it can, so if you would like to see your own distribution on the list, submit PR with it and we will gladly merge it. Be sure to read about some simple rules around how to build images for Shells at [os_requirements.md](https://github.com/Shells-com/linux-scripts/blob/master/os_requirements.md).
1818

1919
# Testing
2020

build_image.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -e
1010
. oscfg/manjaro.sh
1111
. oscfg/gentoo.sh
1212
. oscfg/fedora.sh
13+
. oscfg/opensuse.sh
1314

1415
dodistro() {
1516
if [ -f "$1-$DATE.qcow2" ]; then
@@ -32,6 +33,9 @@ dodistro() {
3233
fedora-*)
3334
fedora_distro "$1"
3435
;;
36+
opensuse-*)
37+
opensuse_distro "$1"
38+
;;
3539
*)
3640
echo "unsupported distro $1"
3741
;;

os_requirements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ If you want to submit and/or maintain distribution of your choice for official S
55
* Set user to autologin (we try to achieve this in firstrun script but if you see difference not applying for your OS, be sure to do it).
66
* Disable power saving (screensavers, sleep, automatic logout etc).
77
* Disable logout option.
8+
* Be sure to have in your image spice-vdagent and qemu-guest-agent.
89

910
## Naming
1011

oscfg/debian.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ debian_cfg() {
7575
case "$1" in
7676
debian-*-desktop)
7777
DEBIAN_FRONTEND=noninteractive run apt-get install -y gnome-software guake dconf-cli
78+
DEBIAN_FRONTEND=noninteractive run apt-get install -y flatpak gnome-software-plugin-flatpak
79+
run flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
80+
run killall gnome-software && run apt update && run appstreamcli refresh --force
7881
run systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
7982
;;
8083
esac

oscfg/manjaro.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ manjaro_cfg() {
1818
run pacman -Syu --noconfirm
1919
run pacman-mirrors -f 15
2020

21-
run pacman -S --noconfirm base systemd-sysvcompat iputils inetutils iproute2 sudo qemu-guest-agent
21+
run pacman -Syy --noconfirm base systemd-sysvcompat iputils inetutils iproute2 sudo qemu-guest-agent
2222

2323
# make sudo available without password (default for key auth)
2424
echo "%shellsuser ALL=(ALL) NOPASSWD: ALL" > "$WORK/etc/sudoers.d/01-shells" & chmod 440 "$WORK/etc/sudoers.d/01-shells"
@@ -27,7 +27,7 @@ manjaro_cfg() {
2727
case "$1" in
2828
manjaro-desktop)
2929
run pacman -S --noconfirm xfce4 ttf-dejavu lightdm-gtk-greeter-settings accountsservice xfce4-goodies xfce4-pulseaudio-plugin mugshot engrampa catfish screenfetch network-manager-applet noto-fonts noto-fonts-cjk
30-
run pacman -S --noconfirm manjaro-xfce-settings manjaro-release manjaro-firmware manjaro-system manjaro-hello manjaro-application-utility manjaro-documentation-en manjaro-browser-settings nano inxi wallpaper-manjaro-shells
30+
run pacman -S --noconfirm manjaro-xfce-settings-shells manjaro-release manjaro-firmware manjaro-system manjaro-hello manjaro-application-utility manjaro-documentation-en manjaro-browser-settings nano inxi wallpaper-manjaro-shells
3131
run pacman -S --noconfirm firefox thunderbird
3232
run pacman -S --noconfirm onlyoffice-desktopeditors
3333
run pacman -S --noconfirm pulseaudio pavucontrol
@@ -77,7 +77,7 @@ EOF
7777
;;
7878
manjaro-kde-desktop)
7979
run pacman -S --noconfirm plasma-meta ark dolphin dolphin-plugins kate kcalc kfind okular kget libktorrent kdenetwork-filesharing kio-extras konsole konversation ksystemlog kwalletmanager gwenview spectacle kdegraphics-thumbnailers ffmpegthumbs ruby kimageformats qt5-imageformats systemd-kcm yakuake vlc oxygen-icons kaccounts-providers
80-
run pacman -S --noconfirm manjaro-kde-settings manjaro-release manjaro-firmware manjaro-system manjaro-hello manjaro-application-utility manjaro-documentation-en manjaro-browser-settings sddm-breath2-theme nano inxi illyria-wallpaper wallpapers-juhraya wallpapers-2018 manjaro-wallpapers-18.0 wallpaper-manjaro-shells
80+
run pacman -S --noconfirm manjaro-kde-settings-shells manjaro-release manjaro-firmware manjaro-system manjaro-hello manjaro-application-utility manjaro-documentation-en manjaro-browser-settings sddm-breath2-theme nano inxi illyria-wallpaper wallpapers-juhraya wallpapers-2018 manjaro-wallpapers-18.0
8181
run pacman -S --noconfirm firefox thunderbird
8282
run pacman -S --noconfirm onlyoffice-desktopeditors
8383
run pacman -S --noconfirm pulseaudio pavucontrol

oscfg/opensuse.sh

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/bin/sh
2+
3+
DLURL=https://download.opensuse.org
4+
TWREPO=/tumbleweed/repo/oss
5+
TWUPDATEREPO=/update/tumbleweed
6+
LEAPREPO=/distribution/openSUSE-stable/repo/oss
7+
LEAPUPDATEREPO=/update/openSUSE-stable
8+
9+
opensuse_distro() {
10+
# install distro using zypper into "$WORK"
11+
# $1 can be something like opensuse-tumbleweed-gnome or opensuse-leap-xfce
12+
# DISTRO is split out from $1, the 2nd 'parameter', i.e. tumbleweed or leap
13+
DISTRO=$(echo "$1" | cut -f2 -d-)
14+
# PATTERN is split out from $1, the 3rd 'parameter', i.e. gnome, kde, xfce
15+
local PATTERN=$(echo "$1" | cut -f3 -d-)
16+
17+
case "$1" in
18+
*-base)
19+
create_empty
20+
ZYPPCMD="zypper -n --root $WORK"
21+
if [ "$DISTRO" == "tumbleweed" ]; then
22+
REPO=$TWREPO
23+
UPDATEREPO=$TWUPDATEREPO
24+
elif [ "$DISTRO" == "leap" ]; then
25+
REPO=$LEAPREPO
26+
UPDATEREPO=$LEAPUPDATEREPO
27+
else
28+
echo "Unsupported openSUSE distro ($DISTRO). Supported are tumbleweed and leap!"
29+
exit 1
30+
fi
31+
$ZYPPCMD ar -f $DLURL$REPO repo-oss
32+
$ZYPPCMD ar -f $DLURL$UPDATEREPO repo-oss-update
33+
$ZYPPCMD --gpg-auto-import-keys ref
34+
$ZYPPCMD install --download in-advance -t pattern enhanced_base x11
35+
$ZYPPCMD install --download in-advance NetworkManager spice-vdagent
36+
# we get a cloud-firstboot
37+
run systemctl mask systemd-firstboot
38+
# ensure networkmanager is enabled and not systemd-networkd
39+
run systemctl disable wicked
40+
run systemctl enable NetworkManager NetworkManager-wait-online
41+
run systemctl enable sshd
42+
# make sudo available without password (default for key auth)
43+
echo "%shellsuser ALL=(ALL) NOPASSWD: ALL" > "$WORK/etc/sudoers.d/01-shells" && chmod 440 "$WORK/etc/sudoers.d/01-shells"
44+
;;
45+
*)
46+
# start from base
47+
if [ ! -f "opensuse-$DISTRO-base.qcow2" ]; then
48+
dodistro "opensuse-$DISTRO-base"
49+
fi
50+
prepare opensuse-$DISTRO-base
51+
ZYPPCMD="zypper -n --root $WORK"
52+
$ZYPPCMD --gpg-auto-import-keys ref
53+
$ZYPPCMD dup
54+
$ZYPPCMD install --download in-advance -t pattern $PATTERN
55+
56+
opensuse_cfg "$DISTRO" "$PATTERN"
57+
;;
58+
esac
59+
}
60+
61+
opensuse_cfg() {
62+
local DISTRO=$1
63+
local DESKTOP=$2
64+
if [ "$DESKTOP" == "gnome" ]; then
65+
cat >>"$WORK/usr/share/glib-2.0/schemas/30-Shells.gschema.override" <<EOF
66+
# disable gnome screen blanking, logout & power management
67+
[org/gnome/desktop/screensaver]
68+
lock-enabled=false
69+
idle-activation-enabled=false
70+
71+
[org/gnome/desktop/lockdown]
72+
disable-lock-screen=true
73+
disable-log-out=true
74+
75+
[org/gnome/desktop/session]
76+
idle-delay=uint32 0
77+
EOF
78+
run /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
79+
elif [ "$DESKTOP" == "kde" ]; then
80+
true # nothing to be done yet
81+
fi
82+
83+
# add firstrun
84+
add_firstrun NetworkManager-wait-online.service
85+
do_linux_config
86+
}

scripts/base.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ add_firstrun() {
155155
AFTER="systemd-networkd-wait-online.service"
156156
fi
157157

158-
if [ -d "$WORK/lib/systemd/system" ]; then
158+
if [ -d "$WORK/usr/lib/systemd/system" ]; then
159159
# systemd method
160-
cat >"$WORK/lib/systemd/system/cloud-firstrun.service" <<EOF
160+
cat >"$WORK/usr/lib/systemd/system/cloud-firstrun.service" <<EOF
161161
[Unit]
162162
Description=Cloud firstrun handler
163163
ConditionFileIsExecutable=/.firstrun.sh

scripts/firstrun.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ if [ x"$SHELLS_USERNAME" != x ]; then
133133
echo "User=$SHELLS_USERNAME" >>/etc/sddm.conf.d/autologin.conf
134134
echo "Session=plasma.desktop" >>/etc/sddm.conf.d/autologin.conf
135135
fi
136+
137+
# openSUSE configures gdm/sddm/lightdm centrally via /etc/sysconfig/displaymanager
138+
if [ -f /etc/sysconfig/displaymanager ]; then
139+
sed -i "s/^DISPLAYMANAGER_AUTOLOGIN=\".*\"/DISPLAYMANAGER_AUTOLOGIN=\"$SHELLS_USERNAME\"/" /etc/sysconfig/displaymanager
140+
test -f /etc/sddm.conf.d/autologin.conf && rm /etc/sddm.conf.d/autologin.conf
141+
fi
136142
else
137143
# no user creation, let's at least setup root
138144
if [ x"$SHELLS_SHADOW" != x ]; then

scripts/linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ResultActive=yes
2222
EOF
2323
elif [ -d "$WORK/etc/polkit-1/rules.d/" ]; then
2424
cat >"$WORK/etc/polkit-1/rules.d/49-nopasswd_shells.rules" <<EOF
25-
#rules for all distros
25+
// rules for all distros
2626
polkit.addRule(function(action, subject) {
2727
if (subject.isInGroup("shellsuser")) {
2828
return polkit.Result.YES;

0 commit comments

Comments
 (0)