Skip to content

Commit f2b80b1

Browse files
committed
added rescue image, tests needed
1 parent 0c43d9c commit f2b80b1

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
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

oscfg/ubuntu.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ EOF
9999
DEBIAN_FRONTEND=noninteractive run apt-get install -y mintupdate libreoffice flatpak rhythmbox redshift p7zip-full openvpn
100100
DEBIAN_FRONTEND=noninteractive run apt purge -y gdm3 ubuntu-release-upgrader-core gparted && run dpkg --configure -a
101101
;;
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
106+
;;
102107
esac
103108

104109
case "$1" in
@@ -186,7 +191,6 @@ EOF
186191

187192
case "$1" in
188193
*-desktop)
189-
190194
# create script to disable gnome screensaver stuff
191195
if [ -d "$WORK/usr/share/backgrounds" ]; then
192196
# install wallpaper
@@ -255,4 +259,18 @@ EOF
255259

256260
# cleanup apt
257261
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+
273+
# build squashfs image
274+
mksquashfs "$WORK" "$1-$DATE.squashfs" -comp xz -noappend -progress
275+
fi
258276
}

0 commit comments

Comments
 (0)