Skip to content

Commit 73233df

Browse files
author
Bernhard Landauer
authored
Merge pull request #2 from Shells-com/master
merge master
2 parents eed199b + c37eee4 commit 73233df

File tree

7 files changed

+62
-11
lines changed

7 files changed

+62
-11
lines changed

official_images.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ ubuntu-focal-lubuntu-desktop
1111
ubuntu-focal-openssh-server
1212
ubuntu-focal-ubuntu-desktop
1313
ubuntu-focal-xubuntu-desktop
14+
ubuntu-focal-rescue

os_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ 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+
* Shells images are running on our Shells kernel, if you want your images to be ran by your distro kernel, you will need to supply that kernel, a way to resize the disk, a bootloader, the kernel parameters etc.

oscfg/manjaro.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ manjaro_cfg() {
2121
run pacman -S --noconfirm base systemd-sysvcompat iputils inetutils iproute2 sudo qemu-guest-agent
2222

2323
# make sudo available without password (default for key auth)
24-
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > "$WORK/etc/sudoers.d/01-wheel" & chmod 440 "$WORK/etc/sudoers.d/01-wheel"
24+
echo "%shellsuser ALL=(ALL) NOPASSWD: ALL" > "$WORK/etc/sudoers.d/01-shells" & chmod 440 "$WORK/etc/sudoers.d/01-shells"
2525

2626
# ensure desktop installation & guest tools
2727
case "$1" in
@@ -35,6 +35,7 @@ manjaro_cfg() {
3535
run pacman -S --noconfirm pamac-gtk pamac-snap-plugin pamac-flatpak-plugin
3636
run systemctl enable lightdm
3737
run systemctl enable apparmor snapd snapd.apparmor
38+
sed -i -e 's|#%PAM-1.0|#%PAM-1.0\nauth sufficient pam_succeed_if.so user ingroup shellsuser|' $WORK/etc/pam.d/lightdm
3839
sed -i -e 's|show-command-switchuser=true|show-command-switchuser=false|g' $WORK/etc/skel/.config/xfce4/panel/whiskermenu*.rc
3940
sed -i -e 's|show-command-logout=true|show-command-logout=false|g' $WORK/etc/skel/.config/xfce4/panel/whiskermenu*.rc
4041
sed -i -e 's|show-command-shutdown=false|show-command-shutdown=true|g' $WORK/etc/skel/.config/xfce4/panel/whiskermenu*.rc
@@ -84,6 +85,7 @@ EOF
8485
run pacman -S --noconfirm pamac-gtk pamac-snap-plugin pamac-flatpak-plugin pamac-tray-icon-plasma xdg-desktop-portal xdg-desktop-portal-kde
8586
run systemctl enable sddm
8687
run systemctl enable apparmor snapd snapd.apparmor
88+
sed -i -e 's|#%PAM-1.0|#%PAM-1.0\nauth sufficient pam_succeed_if.so user ingroup shellsuser|' $WORK/etc/pam.d/sddm
8789
cat > "$WORK/etc/sddm.conf.d/manjaro-theme.conf" <<EOF
8890
[Theme]
8991
# Current theme name
@@ -114,6 +116,7 @@ EOF
114116
run pacman -S --noconfirm networkmanager xf86-input-libinput xf86-video-qxl-debian xorg-server xorg-mkfontscale xorg-xkill phodav spice-vdagent xdg-user-dirs
115117
run pacman -S --noconfirm pamac-gtk pamac-flatpak-plugin pamac-gnome-integration polkit-gnome xdg-desktop-portal xdg-desktop-portal-gtk
116118
run systemctl enable gdm
119+
sed -i -e 's|#%PAM-1.0|#%PAM-1.0\nauth sufficient pam_succeed_if.so user ingroup shellsuser|' $WORK/etc/pam.d/gdm-password
117120
# run systemctl enable apparmor snapd snapd.apparmor
118121
# update locale (only needed for GIS)
119122
cp "$WORK/etc/locale.gen" "$WORK/etc/locale.gen.bak"

oscfg/ubuntu.sh

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,26 @@ EOF
8383
DEBIAN_FRONTEND=noninteractive run apt-get install -y gnupg
8484
run apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 302F0738F465C1535761F965A6616109451BBBF2
8585
echo "deb http://packages.linuxmint.com ulyssa main upstream import backport" >"$WORK/etc/apt/sources.list.d/linux-mint.list"
86+
cat >> "$WORK/etc/apt/preferences.d/official-package-repositories.pref" <<EOF
87+
Package: *
88+
Pin: origin live.linuxmint.com
89+
Pin-Priority: 750
90+
91+
Package: *
92+
Pin: release o=linuxmint,c=upstream
93+
Pin-Priority: 700
94+
EOF
8695
run apt-get update
8796
DEBIAN_FRONTEND=noninteractive run apt-get install -y cinnamon-session cinnamon nemo mint-info-cinnamon mintmenu mint-x-icons mintsystem mintwelcome
88-
DEBIAN_FRONTEND=noninteractive run apt-get install -y firefox lightdm
89-
DEBIAN_FRONTEND=noninteractive run apt purge -y gdm3
97+
DEBIAN_FRONTEND=noninteractive run apt-get install -y firefox lightdm gdisk gdebi fwupd friendly-recovery gnome-terminal cinnamon-control-center
98+
DEBIAN_FRONTEND=noninteractive run apt-get install -y mint-mirrors mint-artwork mint-backgrounds-ulyana mint-themes mintbackup mintdrivers mintinstall
99+
DEBIAN_FRONTEND=noninteractive run apt-get install -y mintupdate libreoffice flatpak rhythmbox redshift p7zip-full openvpn
100+
DEBIAN_FRONTEND=noninteractive run apt purge -y gdm3 ubuntu-release-upgrader-core gparted && run dpkg --configure -a
101+
;;
102+
rescue)
103+
# special case of ubuntu install, non gfx
104+
run apt-get update
105+
DEBIAN_FRONTEND=noninteractive run apt-get install -y e2fsprogs fdisk build-essential vim mtr openssh-server parted ntpdate lvm2 gddrescue testdisk debootstrap xfsprogs mingetty
90106
;;
91107
esac
92108

@@ -175,7 +191,6 @@ EOF
175191

176192
case "$1" in
177193
*-desktop)
178-
179194
# create script to disable gnome screensaver stuff
180195
if [ -d "$WORK/usr/share/backgrounds" ]; then
181196
# install wallpaper
@@ -225,11 +240,34 @@ gsettings set org.gnome.desktop.background picture-uri file:////usr/share/backgr
225240
gsettings set org.gnome.desktop.interface gtk-theme "Material-Black-Blueberry-3.36"
226241
gsettings set org.gnome.desktop.interface icon-theme "Material-Black-Blueberry-3.36"
227242
243+
EOF
244+
;;
245+
esac
246+
247+
case "$TASKSEL" in
248+
mint-cinnamon-desktop)
249+
cat >> "$WORK/etc/skel/.xprofile" <<EOF
250+
gsettings set org.cinnamon.desktop.screensaver lock-enabled false
251+
gsettings set org.cinnamon.settings-daemon.plugins.power sleep-display-ac 0
252+
gsettings set org.cinnamon.desktop.lockdown disable-log-out true
253+
gsettings set org.cinnamon.desktop.lockdown disable-lock-screen true
254+
gsettings set org.cinnamon.desktop.lockdown disable-user-switching true
228255
EOF
229256
;;
230257
esac
231258

232259

233260
# cleanup apt
234261
run apt-get clean
262+
263+
if [ x"$TASKSEL" = x"rescue" ]; then
264+
# make root autologin
265+
mkdir -p "$WORK/etc/systemd/system/[email protected]"
266+
cat >"$WORK/etc/systemd/system/[email protected]/override.conf" <<EOF
267+
[Service]
268+
ExecStart=
269+
ExecStart=-/sbin/agetty --noissue --autologin root --noclear %I
270+
Type=idle
271+
EOF
272+
fi
235273
}

scripts/base.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ EOF
117117

118118
umount "$WORK/proc" "$WORK/sys" "$WORK/dev" || umount -l "$WORK/proc" "$WORK/sys" "$WORK/dev" || true
119119

120+
# build squashfs image if requested NOW
121+
if [ x"$MKSQUASHFS" != x ]; then
122+
mksquashfs "$WORK" "$1-$DATE.squashfs" -comp xz -noappend -progress
123+
fi
124+
120125
echo "Syncing..."
121126
umount "$WORK"
122127
"$QEMUNBD" -d "$NBD"
@@ -131,7 +136,7 @@ EOF
131136
# grab rbdconv
132137
git clone https://github.com/Shells-com/rbdconv.git
133138
fi
134-
php rbdconv/raw-to-rbd.php "$1-$DATE.raw" | xz -z -9 -T $(nproc --ignore=2) -v >"$1-$DATE.shells"
139+
php rbdconv/raw-to-rbd.php "$1-$DATE.raw" | xz -z -9 -T $(nproc --ignore=4) -v >"$1-$DATE.shells"
135140
rm -f "$1-$DATE.raw"
136141

137142
# complete, list the file

scripts/firstrun.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ if [ x"$SYSTEM_UUID" = x"bdef7bde-f7bd-ef7b-def7-bdef7bdef7bd" ]; then
2929
SHELLS_USERNAME="test"
3030
SHELLS_SSH=""
3131
SHELLS_TZ="UTC"
32-
# shellcheck disable=SC2016
33-
SHELLS_SHADOW='$6$m6x66dqWClittWFo$oY7sYQAZAwPELORe6HOKuxxlrZ1QBP7RvCaMG3tAIoGXC5Bbp.IeIssMEXLIupvBIpXa1NyeWmgXJeggiuWO91' # "test"
32+
SHELLS_SHADOW=''
3433
SHELLS_CMD=""
3534
else
3635
# get internal API token
@@ -97,7 +96,7 @@ if [ x"$SHELLS_USERNAME" != x ]; then
9796
gpasswd -a "${SHELLS_USERNAME}" autologin
9897
sed -i -e "s/^.*autologin-user=.*/autologin-user=${SHELLS_USERNAME}/" /etc/lightdm/lightdm.conf
9998
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
100-
sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
99+
# sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
101100
echo "auth sufficient pam_succeed_if.so user ingroup nopasswdlogin" >> /etc/pam.d/lightdm
102101
groupadd -r nopasswdlogin
103102
gpasswd -a "${SHELLS_USERNAME}" nopasswdlogin

scripts/qemu.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ qemukernel() {
100100
# arguments: qemukernel <qcow2 file> <kernel commandline opts>
101101

102102
# ensure we have a kernel
103-
if [ ! -f shells-kernel/guest-linux-x86_64/release.txt ]; then
104-
getfile shells-kernel-5.10.23-4128a20.tar.bz2 4128a20d14e8522894c78c8372eed113e620cf95678b2f993baaee37dd5587a5
105-
tar xjf shells-kernel-5.10.23-4128a20.tar.bz2
103+
KVER=""
104+
if [ -f shells-kernel/guest-linux-x86_64/release.txt ]; then
105+
KVER="$(cat shells-kernel/guest-linux-x86_64/release.txt)"
106+
fi
107+
if [ x"$KVER" != x"5.10.25-shells" ]; then
108+
getfile shells-kernel-5.10.25-b75417c.tar.bz2 b75417c74293081149eb3b7c145a18b6201c6f14b35024062484570701abe86c
109+
tar xjf shells-kernel-5.10.25-b75417c.tar.bz2
106110
fi
107111

108112
if [ x"$ARCH" = x ]; then

0 commit comments

Comments
 (0)