diff --git a/.env b/.env index 4afbf15..142c8f6 100644 --- a/.env +++ b/.env @@ -1,8 +1,9 @@ -VERSION=1.2.0 +VERSION=2.0.0 +MISO_DISTRO_NAME=weeedebian +MISO_ARCH=amd64 +MISO_CHROOT_SCRIPT=/weeedebian/martello.sh MISO_HOSTNAME=weeedebian MISO_ROOTPASSWD=asd MISO_USERNAME=weee MISO_USERPASSWD=asd -MISO_CHROOT_SCRIPT=weeedebian/martello.sh -MISO_BUILD_DIR=build \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..143537f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "fossil.ignoreMissingFossilWarning": true +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 460a963..e26238c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM debian:stable-slim +FROM debian:stable # Do not install apt-utils, you just get even more errors RUN apt-get update -y \ - && apt-get install -y \ + && apt-get install -y \ sudo \ debootstrap \ squashfs-tools \ @@ -10,13 +10,23 @@ RUN apt-get update -y \ xorriso \ isolinux \ syslinux-efi \ - grub-pc-bin \ + syslinux \ grub-efi-amd64-bin \ + grub-pc-bin \ mtools \ debian-archive-keyring \ - isolinux \ - syslinux \ - && apt-get clean -y + fakeroot \ + && apt-get clean -y WORKDIR /miso +# RUN debootstrap \ +# --arch=amd64 \ +# --variant=minbase \ +# --include=linux-image-amd64,live-boot,systemd-sysv,apt-utils,zstd \ +# bookworm \ +# /miso/build/chroot \ +# http://ftp.it.debian.org/debian/ COPY miso.sh . -ENTRYPOINT ["/miso/miso.sh"] +COPY .env . +#ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libfakeroot/libfakeroot-sysv.so +#ENV MISO_SUDO=fakeroot +ENTRYPOINT ["/bin/bash", "-c", "/miso/miso.sh"] diff --git a/README.md b/README.md index f86d4df..e2efc62 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ docker run --name miso \ -e MISO_USERNAME=weee \ -e MISO_USERPASSWD=asd \ -e MISO_ARCH=amd64 \ - -e MISO_NO_SUDO=1 \ + -e MISO_CONTAINER=true \ weee-open/miso:latest ``` diff --git a/build/README.md b/build/README.md deleted file mode 100644 index 709a1d9..0000000 --- a/build/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Build directory - -Output files will be generated here. diff --git a/chroot_scripts/00-hostname_setup.sh b/chroot_scripts/00-hostname_setup.sh new file mode 100755 index 0000000..a914dcc --- /dev/null +++ b/chroot_scripts/00-hostname_setup.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# WEEEDebian creation script - a-porsia et al + +#set -x +set -e + +# this has to be done before sudo +echo "=== Set hostname ===" +echo "$MISO_HOSTNAME" >/etc/hostname +# HOSTNAME is the docker one, but it cannot be changed from +# the inside and is absolutely necessary to be set for sudo +# to determine that localhost is localhost +cat </etc/hosts +127.0.0.1 localhost $HOSTNAME $MISO_HOSTNAME +::1 localhost ip6-localhost ip6-loopback $HOSTNAME $MISO_HOSTNAME +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters +EOF +# Something is overwriting /etc/hosts on each boot. What? Who knows! +# Here's a bug from 2010, but disabling NetworkManager does absolutely nothing: +# https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/659872 +# Here's a solution with chattr, which does absolutely nothing (the attribute is not squashed probably): +# https://askubuntu.com/a/84526 +# It seems to happen with PXE only. Since there's no way around it... + +# cat </etc/hosts_fixed +# # This file was kindly placed here by /etc/cron.d/fix_etc_hosts +# # to work around whatever is overwriting it on boot. +# +# 127.0.0.1 localhost $MISO_HOSTNAME +# ::1 localhost ip6-localhost ip6-loopback $MISO_HOSTNAME +# ff02::1 ip6-allnodes +# ff02::2 ip6-allrouters +# EOF +# cp ./fix_etc_hosts /etc/cron.d/fix_etc_hosts diff --git a/chroot_scripts/10-software_installation.sh b/chroot_scripts/10-software_installation.sh new file mode 100755 index 0000000..1722879 --- /dev/null +++ b/chroot_scripts/10-software_installation.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# WEEEDebian creation script - a-porsia et al + +set -x +set -e + +echo "=== Software installation ===" +export DEBIAN_FRONTEND=noninteractive + +apt-get clean -y +apt-get update -y +apt-get install -y software-properties-common # add `apt-add-repository` command + +# Add non-free repo and update to pull in all the good firmware +# apt-add-repository non-free 2>&1 # since bookworm non free firmware is its own component. See https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split +# For now, we are not installing any non-free package that isn't a firmware so this is not needed +apt-add-repository non-free-firmware 2>&1 +apt-add-repository contrib 2>&1 + +apt-get update -y + +# Remove useless packages, courtesy of "wajig large". Cool command. +# Do not remove mousepad, it removes xfce-goodies too +# /bin/bash -c 'DEBIAN_FRONTEND=noninteractive apt-get purge --auto-remove -y libreoffice libreoffice-core libreoffice-common ispell* gimp gimp-* aspell* hunspell* mythes* *sunpinyin* wpolish wnorwegian tegaki* task-thai task-thai-desktop xfonts-thai xiterm* task-khmer task-khmer-desktop fonts-khmeros khmerconverter' +# This is commented because none of these packages is present at this time + +# Upgrade and install useful packages +apt-get upgrade -y +# libxkbcommon-x11-0 may be not needed (see Add library to installation if needed #28) +apt-get install -y \ + alsa-firmware-loaders \ + apt-transport-https \ + atmel-firmware \ + bluez-firmware \ + ca-certificates \ + cifs-utils \ + curl \ + dmidecode \ + dnsutils \ + firefox-esr \ + firmware-linux \ + firmware-atheros \ + firmware-bnx2 \ + firmware-bnx2x \ + firmware-brcm80211 \ + firmware-cavium \ + firmware-intel-sound \ + firmware-iwlwifi \ + firmware-libertas \ + firmware-myricom \ + firmware-netronome \ + firmware-netxen \ + firmware-qcom-media \ + firmware-qcom-soc \ + firmware-qlogic \ + firmware-realtek \ + firmware-samsung \ + firmware-siano \ + firmware-ti-connectivity \ + firmware-zd1211 \ + geany \ + git \ + gparted \ + gsmartcontrol \ + gvfs-backends \ + hdparm \ + i2c-tools \ + iproute2 \ + iputils-arping \ + iputils-ping \ + iputils-tracepath \ + libglu1-mesa-dev \ + libx11-xcb-dev \ + libxi-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-0 \ + libxkbcommon-x11-dev \ + libxrender-dev \ + lightdm \ + lm-sensors \ + locales \ + lshw \ + mesa-utils \ + nano \ + net-tools \ + network-manager \ + network-manager-gnome \ + openssh-client \ + openssh-server \ + openssl \ + pciutils \ + python3 \ + python3-venv \ + python3-venv \ + python-is-python3 \ + libxcb-cursor0 \ + libxcb-cursor0 \ + rsync \ + smartmontools \ + strace \ + sudo \ + systemd-timesyncd \ + systemd-timesyncd \ + traceroute \ + wget \ + wireless-tools \ + wpagui \ + xfce4 \ + xfce4-terminal \ + xfce4-whiskermenu-plugin \ + xinit \ + xorg \ + xserver-xorg \ + zsh diff --git a/docker-compose.yml b/docker-compose.yml index 4bb5e21..a7343de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,13 @@ -version: "3" - services: miso: hostname: weeedebian container_name: miso tty: true + privileged: true volumes: - - ./build:/build:rwz - - ./weeedebian:/weeedebian:roz - environment: - - MISO_ARCH=amd64 - - VERSION=1.2.0 - - MISO_CHROOT_SCRIPT=/weeedebian/martello.sh - - MISO_BUILD_DIR=/build - - MISO_HOSTNAME=weeedebian - - MISO_ROOTPASSWD=asd - - MISO_USERNAME=weee - - MISO_USERPASSWD=asd - build: . \ No newline at end of file + - ./build:/miso/build:rwz + - ./weeedebian:/miso/weeedebian:roz + - ./chroot_scripts:/miso/chroot_scripts:roz + - /proc:/proc:rwz + build: . + stdin_open: true diff --git a/miso.sh b/miso.sh index 8b4fc9b..0991376 100755 --- a/miso.sh +++ b/miso.sh @@ -1,37 +1,17 @@ #!/bin/bash + +set -x # Logs +set -e # exit at any error + . .env echo "MISO v$VERSION" -set -x -. .env -echo "MISO v$VERSION" -set -x -if [[ -z "$MISO_BUILD_DIR" ]]; then - if [[ -z "$1" ]]; then - echo "Set the build dir as the first parameter or via MISO_BUILD_DIR" - exit 1 - else - MISO_BUILD_DIR="$1" - fi -fi -if [[ -z "$MISO_CHROOT_SCRIPT" ]]; then - if [[ -z "$2" ]]; then - echo "Set the chroot script as the second parameter or via MISO_CHROOT_SCRIPT" - exit 1 - else - MISO_CHROOT_SCRIPT="$2" - fi -fi - -if [[ -z "$MISO_NO_SUDO" ]]; then - MISO_SUDO="sudo" -else - MISO_SUDO="" -fi +MISO_BUILD_DIR="build" +MISO_CHROOT_SCRIPTS_DIR="chroot_scripts" -if [[ -z "$MISO_ARCH" ]]; then +if [[ -z "$MISO_ARCH" ]]; then # '32' or 'i386' for 32bit, everything else is 64 if [[ -z "$3" ]]; then - echo "Set the architecture as the third parameter or via MISO_ARCH" + echo "Set the architecture as the first parameter or via MISO_ARCH" exit 1 else MISO_ARCH="$3" @@ -39,34 +19,39 @@ if [[ -z "$MISO_ARCH" ]]; then fi # These cannot be moved to the chroot, read doesn't work thru all those levels - while [[ -z "$MISO_HOSTNAME" ]]; do - # read -p does not work from docker for some reason - echo -n "Hostname: " - read MISO_HOSTNAME + # read -p does not work from docker for some reason + echo -n "Hostname: " + read MISO_HOSTNAME done while [[ -z "$MISO_ROOTPASSWD" ]]; do - echo -n "Root password: " - # read -s doesn't work from docker - stty -echo - read MISO_ROOTPASSWD - stty echo + echo -n "Root password: " + # read -s doesn't work from docker + stty -echo + read MISO_ROOTPASSWD + stty echo done while [[ -z "$MISO_USERNAME" ]]; do - echo -n "Username: " - read MISO_USERNAME - stty echo + echo -n "Username: " + read MISO_USERNAME done while [[ -z $MISO_USERPASSWD ]]; do - echo -n "$MISO_USERNAME password: " - stty -echo - read MISO_USERPASSWD - stty echo + echo -n "$MISO_USERNAME password: " + stty -echo + read MISO_USERPASSWD + stty echo done +mkdir -p $MISO_BUILD_DIR +mkdir -p $MISO_CHROOT_SCRIPTS_DIR + +MISO_BUILD_DIR=$(readlink -f "$MISO_BUILD_DIR") +MISO_BUILD_DIR="$MISO_BUILD_DIR/$MISO_DISTRO_NAME-$MISO_ARCH" +MISO_CHROOT_SCRIPTS_DIR=$(readlink -f "$MISO_CHROOT_SCRIPTS_DIR") + _ORANGE='\033[0;33m' _RED='\033[0;31m' _BLUE='\033[0;34m' @@ -82,56 +67,53 @@ else MISO_ARCH=amd64 fi -MISO_CHROOT_SCRIPT=$(readlink -f "$MISO_CHROOT_SCRIPT") -_MISO_SOURCE_DIR=$(dirname "$MISO_CHROOT_SCRIPT") -_MISO_SOURCE_SCRIPT=$(basename "$MISO_CHROOT_SCRIPT") -_MISO_BUILD_NAME=$(basename "$_MISO_SOURCE_DIR") -MISO_BUILD_DIR=$(readlink -f "$MISO_BUILD_DIR") -MISO_BUILD_DIR="$MISO_BUILD_DIR/$_MISO_BUILD_NAME-$MISO_ARCH" - -mkdir -p $MISO_BUILD_DIR +if [[ "$MISO_ARCH" == "i386" ]]; then + # There's also 686-pae + LINUX_IMAGE_ARCH="686" +else + LINUX_IMAGE_ARCH=$MISO_ARCH +fi if [[ -d "$MISO_BUILD_DIR/chroot" ]]; then - echo -e "${_ORANGE}Chroot directory exists, skipping bootstrap!${_RESET_COLOR}" - echo -e "${_ORANGE}To bootstrap again, delete $MISO_BUILD_DIR/chroot${_RESET_COLOR}" + echo -e "${_ORANGE}Chroot directory exists, skipping bootstrap!${_RESET_COLOR}" + echo -e "${_ORANGE}To bootstrap again, delete $MISO_BUILD_DIR/chroot${_RESET_COLOR}" else - echo -e "${_BLUE}Bootstrapping${_RESET_COLOR}" - $MISO_SUDO debootstrap \ - --arch=$MISO_ARCH \ - --variant=minbase \ - bookworm \ - $MISO_BUILD_DIR/chroot \ - http://ftp.it.debian.org/debian/ + echo -e "${_BLUE}Bootstrapping${_RESET_COLOR}" + sudo debootstrap \ + --arch=$MISO_ARCH \ + --variant=minbase \ + --include=linux-image-$LINUX_IMAGE_ARCH,live-boot,systemd-sysv,apt-utils,zstd \ + bookworm \ + $MISO_BUILD_DIR/chroot \ + http://ftp.it.debian.org/debian/ fi -$MISO_SUDO rm -rf "$MISO_BUILD_DIR/chroot/source" 2>/dev/null -$MISO_SUDO cp -r $_MISO_SOURCE_DIR "$MISO_BUILD_DIR/chroot/source" -# Get rid of some warnings: https://wiki.debian.org/chroot (does not work inside docker) - -$MISO_SUDO mount -t proc none $MISO_BUILD_DIR/chroot/proc -$MISO_SUDO mount -o bind /dev $MISO_BUILD_DIR/chroot/dev -$MISO_SUDO mount -o bind /sys $MISO_BUILD_DIR/chroot/sys - -cat << EOF | $MISO_SUDO chroot $MISO_BUILD_DIR/chroot -set +m - -# Subsitution is done outside the chroot -# export MISO_HOSTNAME -# export MISO_ROOTPASSWD -# export MISO_USERNAME -# export MISO_USERPASSWD -# export MISO_ARCH +if [[ "$1" == "--bootstrap" ]]; then + exit 0 +fi -# For some reason export doesn't work in GH CI? +echo -e "${_BLUE}Running setup...${_RESET_COLOR}" +#$MISO_SUDO rm -rf "$MISO_BUILD_DIR/chroot/source" 2>/dev/null +sudo cp -r "$MISO_CHROOT_SCRIPTS_DIR" "$MISO_BUILD_DIR/chroot/" +# Get rid of some warnings: https://wiki.debian.org/chroot (does not work inside docker) -cd /source -MISO_ARCH=$MISO_ARCH MISO_USERPASSWD=$MISO_USERPASSWD MISO_USERNAME=$MISO_USERNAME MISO_ROOTPASSWD=$MISO_ROOTPASSWD MISO_HOSTNAME=$MISO_HOSTNAME bash ./$_MISO_SOURCE_SCRIPT +#$MISO_SUDO mount -t proc none $MISO_BUILD_DIR/chroot/proc +#$MISO_SUDO mount -o bind /dev $MISO_BUILD_DIR/chroot/dev +#$MISO_SUDO mount -o bind /sys $MISO_BUILD_DIR/chroot/sys +set +e +cat </dev/null -$MISO_SUDO umount $MISO_BUILD_DIR/chroot/dev -$MISO_SUDO umount $MISO_BUILD_DIR/chroot/proc -$MISO_SUDO umount $MISO_BUILD_DIR/chroot/run +set -e + +# +#$MISO_SUDO rm -rf "$MISO_BUILD_DIR/chroot/source" 2>/dev/null +#$MISO_SUDO umount $MISO_BUILD_DIR/chroot/dev +#$MISO_SUDO umount $MISO_BUILD_DIR/chroot/proc +#$MISO_SUDO umount $MISO_BUILD_DIR/chroot/sys +#$MISO_SUDO umount $MISO_BUILD_DIR/chroot/run #echo "TEST POINT" #exit 0 @@ -141,14 +123,17 @@ $MISO_SUDO umount $MISO_BUILD_DIR/chroot/run #fi # Create directory tree -mkdir -p $MISO_BUILD_DIR/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp} +sudo mkdir -p $MISO_BUILD_DIR/{staging/{EFI/boot,boot/grub/x86_64-efi,isolinux,live},tmp} # Squash filesystem echo -e "${_BLUE}Squashing filesystem ...${_RESET_COLOR}" -$MISO_SUDO mksquashfs \ +sudo mksquashfs \ $MISO_BUILD_DIR/chroot \ $MISO_BUILD_DIR/staging/live/filesystem.squashfs \ - -e boot $MISO_MKSQUASHFS_MEM + -b 1048576 -comp xz -Xdict-size 100% \ + -noappend \ + -e boot proc tmp sys run dev $MISO_CHROOT_SCRIPTS_DIR + #if [[ $? -ne 0 ]]; then # $MISO_SUDO rm -f "$MISO_BUILD_DIR/staging/live/filesystem.squashfs" # $MISO_SUDO mksquashfs \ @@ -157,13 +142,13 @@ $MISO_SUDO mksquashfs \ # -e boot $MISO_MKSQUASHFS_MEM #fi -$MISO_SUDO cp $MISO_BUILD_DIR/chroot/boot/vmlinuz-* \ - $MISO_BUILD_DIR/staging/live/vmlinuz-live && \ -$MISO_SUDO cp $MISO_BUILD_DIR/chroot/boot/initrd.img-* \ - $MISO_BUILD_DIR/staging/live/initrd.img +sudo cp $MISO_BUILD_DIR/chroot/boot/vmlinuz-* \ + $MISO_BUILD_DIR/staging/live/vmlinuz-live && + sudo cp $MISO_BUILD_DIR/chroot/boot/initrd.img-* \ + $MISO_BUILD_DIR/staging/live/initrd.img echo -e "${_BLUE}Building bootloader ...${_RESET_COLOR}" -cat << EOF > $MISO_BUILD_DIR/staging/isolinux/isolinux.cfg +sudo tee $MISO_BUILD_DIR/staging/isolinux/isolinux.cfg < $MISO_BUILD_DIR/staging/boot/grub/grub.cfg +sudo tee $MISO_BUILD_DIR/staging/boot/grub/grub.cfg < $MISO_BUILD_DIR/tmp/grub-standalone.cfg +sudo tee $MISO_BUILD_DIR/tmp/grub-standalone.cfg </dev/null diff --git a/weeedebian/keyboard b/weeedebian/keyboard deleted file mode 100644 index a6fcb51..0000000 --- a/weeedebian/keyboard +++ /dev/null @@ -1,6 +0,0 @@ -XKBMODEL="pc105" -XKBLAYOUT="it,us" -XKBVARIANT="" -XKBOPTIONS="" - -BACKSPACE="guess" diff --git a/weeedebian/light-locker.desktop b/weeedebian/light-locker.desktop deleted file mode 100755 index e1e3e17..0000000 --- a/weeedebian/light-locker.desktop +++ /dev/null @@ -1,2 +0,0 @@ -[Desktop Entry] -Hidden=true diff --git a/weeedebian/limone.png b/weeedebian/limone.png deleted file mode 100644 index a954a65..0000000 Binary files a/weeedebian/limone.png and /dev/null differ diff --git a/weeedebian/locale.conf b/weeedebian/locale.conf deleted file mode 100644 index 014bf23..0000000 --- a/weeedebian/locale.conf +++ /dev/null @@ -1,14 +0,0 @@ -LANG=en_US.UTF-8 -LANGUAGE=en_US.UTF-8 -LC_CTYPE=it_IT.UTF-8 -LC_NUMERIC=it_IT.UTF-8 -LC_TIME=it_IT.UTF-8 -LC_COLLATE=en_US.UTF-8 -LC_MONETARY=it_IT.UTF-8 -LC_MESSAGES=en_US.UTF-8 -LC_PAPER=it_IT.UTF-8 -LC_NAME=it_IT.UTF-8 -LC_ADDRESS=it_IT.UTF-8 -LC_TELEPHONE=it_IT.UTF-8 -LC_MEASUREMENT=it_IT.UTF-8 -LC_IDENTIFICATION=it_IT.UTF-8 diff --git a/weeedebian/locale.gen b/weeedebian/locale.gen deleted file mode 100644 index 048a4d8..0000000 --- a/weeedebian/locale.gen +++ /dev/null @@ -1,2 +0,0 @@ -it_IT.UTF-8 UTF-8 -en_US.UTF-8 UTF-8 diff --git a/weeedebian/martello.sh b/weeedebian/martello.sh deleted file mode 100755 index 6a512f9..0000000 --- a/weeedebian/martello.sh +++ /dev/null @@ -1,368 +0,0 @@ -#!/bin/bash -# WEEEDebian creation script - a-porsia et al -# export PATH="$PATH:/usr/sbin:/usr/bin:/sbin:/bin" - -echo "Martello is starting!" -set -x -echo "=== Install kernel and systemd ===" -export DEBIAN_FRONTEND=noninteractive -apt-get clean -y -apt-get update -y -if [[ "$MISO_ARCH" == "i386" ]]; then - # There's also 686-pae - LINUX_IMAGE_ARCH="686" -else - LINUX_IMAGE_ARCH=$MISO_ARCH -fi - -apt-get install -y \ - --no-install-recommends \ - linux-image-$LINUX_IMAGE_ARCH \ - live-boot \ - systemd-sysv \ - apt-utils \ - software-properties-common - -# this has to be done before sudo -echo "=== Set hostname ===" -echo "$MISO_HOSTNAME" > /etc/hostname -# HOSTNAME is the docker one, but it cannot be changed from -# the inside and is absolutely necessary to be set for sudo -# to determine that localhost is localhost -cat << EOF > /etc/hosts -127.0.0.1 localhost $HOSTNAME $MISO_HOSTNAME -::1 localhost ip6-localhost ip6-loopback $HOSTNAME $MISO_HOSTNAME -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -EOF -# Something is overwriting /etc/hosts on each boot. What? Who knows! -# Here's a bug from 2010, but disabling NetworkManager does absolutely nothing: -# https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/659872 -# Here's a solution with chattr, which does absolutely nothing (the attribute is not squashed probably): -# https://askubuntu.com/a/84526 -# It seems to happen with PXE only. Since there's no way around it... -cat << EOF > /etc/hosts_fixed -# This file was kindly placed here by /etc/cron.d/fix_etc_hosts -# to work around whatever is overwriting it on boot. - -127.0.0.1 localhost $MISO_HOSTNAME -::1 localhost ip6-localhost ip6-loopback $MISO_HOSTNAME -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -EOF -cp ./fix_etc_hosts /etc/cron.d/fix_etc_hosts - -echo "=== Software installation ===" -# Add non-free repo and update to pull in all the good firmware -apt-add-repository non-free 2>&1 - - -apt-add-repository non-free-firmware 2>&1 - -apt-add-repository contrib 2>&1 - -apt-get update -y - -# Remove useless packages, courtesy of "wajig large". Cool command. -# Do not remove mousepad, it removes xfce-goodies too -# /bin/bash -c 'DEBIAN_FRONTEND=noninteractive apt-get purge --auto-remove -y libreoffice libreoffice-core libreoffice-common ispell* gimp gimp-* aspell* hunspell* mythes* *sunpinyin* wpolish wnorwegian tegaki* task-thai task-thai-desktop xfonts-thai xiterm* task-khmer task-khmer-desktop fonts-khmeros khmerconverter' -# Upgrade and install useful packages -apt-get upgrade -y -# libxkbcommon-x11-0 may be not needed (see Add library to installation if needed #28) -apt-get install -y \ - alsa-firmware-loaders \ - apt-transport-https \ - atmel-firmware \ - bluez-firmware \ - ca-certificates \ - cifs-utils \ - curl \ - dmidecode \ - dnsutils \ - firefox-esr \ - firmware-linux \ - firmware-atheros \ - firmware-b43-installer \ - firmware-bnx2 \ - firmware-bnx2x \ - firmware-brcm80211 \ - firmware-cavium \ - firmware-intel-sound \ - firmware-iwlwifi \ - firmware-libertas \ - firmware-myricom \ - firmware-netronome \ - firmware-netxen \ - firmware-qcom-media \ - firmware-qcom-soc \ - firmware-qlogic \ - firmware-realtek \ - firmware-samsung \ - firmware-siano \ - firmware-ti-connectivity \ - firmware-zd1211 \ - geany \ - git \ - gparted \ - gsmartcontrol \ - gvfs-backends \ - hdparm \ - i2c-tools \ - iproute2 \ - iputils-arping \ - iputils-ping \ - iputils-tracepath \ - libglu1-mesa-dev \ - libx11-xcb-dev \ - libxi-dev \ - libxkbcommon-dev \ - libxkbcommon-x11-0 \ - libxkbcommon-x11-dev \ - libxrender-dev \ - lightdm \ - lm-sensors \ - locales \ - lshw \ - mesa-utils \ - nano \ - net-tools \ - network-manager \ - network-manager-gnome \ - openssh-client \ - openssh-server \ - openssl \ - pciutils \ - python3 \ - python3-venv \ - python3-venv \ - python-is-python3 \ - libxcb-cursor0 \ - libxcb-cursor0 \ - rsync \ - smartmontools \ - strace \ - sudo \ - systemd-timesyncd \ - systemd-timesyncd \ - traceroute \ - wget \ - wireless-tools \ - wpagui \ - xfce4 \ - xfce4-terminal \ - xfce4-whiskermenu-plugin \ - xinit \ - xorg \ - xserver-xorg \ - zsh -update-ca-certificates - -systemctl disable smartd - -$MISO_SUDO cp ./NetworkManager.conf /etc/NetworkManager/NetworkManager.conf -systemctl enable NetworkManager - -echo "=== User configuration ===" -# openssl has been installed, so this can be done now -MISO_ROOTPASSWD=$(openssl passwd -6 "$MISO_ROOTPASSWD") -MISO_USERPASSWD=$(openssl passwd -6 "$MISO_USERPASSWD") -if [[ -z `grep weee /etc/passwd` ]]; then - useradd -m -G sudo -s /bin/zsh weee -fi -# The -p parameter is silently ignored for some reason: -# -p "$6$cFAyjyCf$HiQKwzGvDioyYINpJ0kKmHEy6kXUlBJViMkd1ceizIpBFOftLVnjCuT6wvfLVhG7qnCo10q3vGzsaeyFIYHMO." -# This ALSO does not work: -#echo "weee:asd" | chpasswd -# So... -sed -i "s#root:.*#root:$ROOTPASSWD:18214:0:99999:7:::#" /etc/shadow -sed -i "s#$MISO_USERNAME:.*#$MISO_USERNAME:$MISO_USERPASSWD:18214:0:99999:7:::#" /etc/shadow - -echo "=== Sudo configuration ===" -cp ./$MISO_USERNAME /etc/sudoers.d/$MISO_USERNAME - -echo "=== Shell and home configuration ===" -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/Desktop -# sudo -u $MISO_USERNAME ln -sf ./Desktop /home/$MISO_USERNAME/Scrivania -chsh -s /bin/zsh root -# chsh -s /bin/zsh weee -sudo -u $MISO_USERNAME curl -L -o /home/$MISO_USERNAME/.zshrc https://git.grml.org/f/grml-etc-core/etc/zsh/zshrc -cp /home/$MISO_USERNAME/.zshrc /root/.zshrc - -sudo -u $MISO_USERNAME rm /home/$MISO_USERNAME/.bash_history >/dev/null 2>/dev/null -rm /root/.bash_history >/dev/null 2>/dev/null - -echo "=== Keymap configuration ===" -# Needed for sure on Debian 11: -cp ./keyboard /etc/default/keyboard -# Keyboard layout switcher: -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/autostart -sudo -u $MISO_USERNAME cp ./fbxkb.desktop /home/$MISO_USERNAME/.config/autostart/fbxkb.desktop -# 00-keyboard.conf can be managed by localectl. In fact, this is one of such files produced by localectl. -# May not be needed in Debian 11: -mkdir -p /etc/X11/xorg.conf.d -cp ./00-keyboard.conf /etc/X11/xorg.conf.d/00-keyboard.conf -echo "KEYMAP=it" > /etc/vconsole.conf - -echo "=== Locale configuration ===" -cp ./locale.gen /etc/locale.gen -cp ./locale.conf /etc/locale.conf -locale-gen -update-locale -# . /etc/locale.conf -# Prints POSIX everywhere despite different variables have just been sourced. -# Whatever, it is correct once boot. -# locale - -echo "=== SSH daemon configuration ===" -cp ./sshd_config /etc/ssh/sshd_config - -echo "=== Modules configuration ===" -_MODULES=("eeprom" "at24" "ee1004" "i2c-i801") -for i in ${!_MODULES[@]}; do - if [[ ! -f "/etc/modules-load.d/${_MODULES[$i]}.conf" ]]; then - printf "${_MODULES[$i]}\n" > /etc/modules-load.d/${_MODULES[$i]}.conf - fi -done - -echo "=== DNS configuration ===" -cp ./resolv.conf /etc/resolv.conf -cp ./resolved.conf /etc/systemd/resolved.conf -rm -f /var/run/NetworkManager/* 2>/dev/null - -echo "=== NTP configuration ===" -systemctl enable systemd-timesyncd -rm -f /etc/localtime -ln -s /usr/share/zoneinfo/Europe/Rome /etc/localtime - -echo "=== Top configuration ===" -cp ./toprc /root/.toprc -sudo -u $MISO_USERNAME cp ./toprc /home/$MISO_USERNAME/.toprc - -echo "=== Prepare peracotta ===" -apt-get install -y python3-pip pipx - -sudo -u $MISO_USERNAME pipx ensurepath -sudo -u $MISO_USERNAME pipx install peracotta - -cp ./peracotta_update /etc/cron.d/peracotta_update - -#sudo -u $MISO_USERNAME sh -c 'cd /home/$MISO_USERNAME/peracotta && python3 polkit.py' -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/WEEE\ Open/peracotta # Ensure the dir exists -sudo -u $MISO_USERNAME cp ./features.json /home/$MISO_USERNAME/.config/WEEE\ Open/peracotta/features.json - - -echo "=== Add env to peracotta ===" -if [[ -f "./env.txt" ]]; then - sudo -u $MISO_USERNAME cp ./env.txt /home/$MISO_USERNAME/.config/WEEE\ Open/peracotta/.env -else - echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" - echo "@ @" - echo "@ WARNING @" - echo "@ @" - echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" - echo "@ @" - echo "@ env.txt not found in weeedebian/. @" - echo "@ You're missing out many great peracotta features! @" - echo "@ Check README for more info if you want to create the @" - echo "@ file and automate your life! @" - echo "@ @" - echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" -fi - -echo "=== s.sh ===" -cp ./s.sh /usr/sbin/s.sh -chmod +x /usr/sbin/s.sh -sudo -u $MISO_USERNAME cp ./ssh.desktop /home/$MISO_USERNAME/Desktop -sudo -u $MISO_USERNAME chmod +x /home/$MISO_USERNAME/Desktop/ssh.desktop -# su - $MISO_USERNAME -c "gio set -t string /home/$MISO_USERNAME/Desktop/ssh.desktop metadata::xfce-exe-checksum $(sha256sum /home/$MISO_USERNAME/Desktop/ssh.desktop | awk '{print $1}')" - -echo "=== XFCE configuration ===" -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/xfce4 -rsync -a --force ./xfce4 /home/$MISO_USERNAME/.config -chown weee: -R /home/$MISO_USERNAME/.config -sudo -u $MISO_USERNAME cp ./light-locker.desktop /home/$MISO_USERNAME/.config/autostart/light-locker.desktop -# sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/xfce4/desktop /home/$MISO_USERNAME/.config/xfce4/terminal - -echo "=== Desktop shortcuts ===" -#if [[ -d "/home/$MISO_USERNAME/limone" ]]; then -# sudo -u $MISO_USERNAME git -C /home/$MISO_USERNAME/limone pull --ff-only -#else -# sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/limone -# sudo -u $MISO_USERNAME git clone https://github.com/WEEE-Open/limone.git /home/$MISO_USERNAME/limone -#fi -# -#for desktop_file in $(sudo -u $MISO_USERNAME find /home/$MISO_USERNAME/limone -name "*.desktop" -type f -printf "%f "); do -# sudo -u $MISO_USERNAME cp "/home/$MISO_USERNAME/limone/$desktop_file" "/home/$MISO_USERNAME/Desktop/$desktop_file" -# sudo -u $MISO_USERNAME chmod +x "/home/$MISO_USERNAME/Desktop/$desktop_file" -# sed -ri -e "s#Icon=(.*/)*([a-zA-Z0-9\-\.]+)#Icon=/home/$MISO_USERNAME/limone/\2#" "/home/$MISO_USERNAME/Desktop/$desktop_file" -#done - -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/WEEE\ Open/tarallo -sudo -u $MISO_USERNAME cp ./Tarallo.desktop /home/$MISO_USERNAME/Desktop -sudo -u $MISO_USERNAME cp ./tarallo.png /home/$MISO_USERNAME/.config/WEEE\ Open/tarallo/tarallo.png -sudo -u $MISO_USERNAME chmod +x /home/$MISO_USERNAME/Desktop/Tarallo.desktop -# su - $MISO_USERNAME -c "gio set -t string /home/$MISO_USERNAME/Desktop/Tarallo.desktop metadata::xfce-exe-checksum $(sha256sum /home/$MISO_USERNAME/Desktop/Tarallo.desktop | awk '{print $1}')" - -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/WEEE\ Open/wiki -sudo -u $MISO_USERNAME cp ./Wiki.desktop /home/$MISO_USERNAME/Desktop -sudo -u $MISO_USERNAME cp ./limone.png /home/$MISO_USERNAME/.config/WEEE\ Open/wiki/wiki.png -sudo -u $MISO_USERNAME chmod +x /home/$MISO_USERNAME/Desktop/Wiki.desktop -# su - $MISO_USERNAME -c "gio set -t string /home/$MISO_USERNAME/Desktop/Wiki.desktop metadata::xfce-exe-checksum $(sha256sum /home/$MISO_USERNAME/Desktop/Wiki.desktop | awk '{print $1}')" - - -#if [[ -f "/home/$MISO_USERNAME/Desktop/PeracottaGUI.desktop" ]]; then -# rm -f "/home/$MISO_USERNAME/Desktop/PeracottaGUI.desktop" -#fi -sudo -u $MISO_USERNAME cp ./Peracotta.desktop /home/$MISO_USERNAME/Desktop -sudo -u $MISO_USERNAME cp ./peracotta.png /home/$MISO_USERNAME/.config/WEEE\ Open/peracotta/peracotta.png -sudo -u $MISO_USERNAME chmod +x /home/$MISO_USERNAME/Desktop/Peracotta.desktop -# su - $MISO_USERNAME -c "gio set -t string /home/$MISO_USERNAME/Desktop/Peracotta.desktop metadata::xfce-exe-checksum $(sha256sum /home/$MISO_USERNAME/Desktop/Peracotta.desktop | awk '{print $1}')" - -sudo -u $MISO_USERNAME cp ./Peracruda.desktop /home/$MISO_USERNAME/Desktop -sudo -u $MISO_USERNAME cp ./peracruda.png /home/$MISO_USERNAME/.config/WEEE\ Open/peracotta/peracruda.png -sudo -u $MISO_USERNAME chmod +x /home/$MISO_USERNAME/Desktop/Peracruda.desktop -# su - $MISO_USERNAME -c "gio set -t string /home/$MISO_USERNAME/Desktop/Peracruda.desktop metadata::xfce-exe-checksum "$(sha256sum /home/$MISO_USERNAME/Desktop/Peracruda.desktop | awk '{print $1}')" - -echo "=== Pointerkeys thing ===" -sudo -u $MISO_USERNAME mkdir -p /home/$MISO_USERNAME/.config/autostart -sudo -u $MISO_USERNAME cp ./Pointerkeys.desktop /home/$MISO_USERNAME/.config/autostart/Pointerkeys.desktop -sudo -u $MISO_USERNAME cp ./pointerkeys.txt /home/$MISO_USERNAME/Desktop - -echo "=== Autologin stuff ===" -cat << EOF > /etc/lightdm/lightdm.conf -[LightDM] - -[Seat:*] -autologin-user=$MISO_USERNAME -autologin-user-timeout=0 -EOF -mkdir -p /etc/systemd/system/getty@.service.d -touch /etc/systemd/system/getty@.service.d/override.conf -printf "[Service]\n" > /etc/systemd/system/getty@.service.d/override.conf -printf "ExecStart=\n" >> /etc/systemd/system/getty@.service.d/override.conf -printf "ExecStart=-/sbin/agetty --noissue --autologin weee %%I $TERM" >> /etc/systemd/system/getty@.service.d/override.conf - -echo "=== Final cleanup ===" -# Remove unused packages -apt-get autoremove -y -# Clean the cache -apt-get clean -y -rm -rf /var/lib/apt/lists/* - -echo "=== Set hostname part 2 ===" -cat << EOF > /etc/hosts -127.0.0.1 localhost $MISO_HOSTNAME -::1 localhost ip6-localhost ip6-loopback $MISO_HOSTNAME -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -EOF - -echo "=== Set desktop shortcuts as trusted ===" -echo "@reboot weee f=/home/$MISO_USERNAME/Desktop/*.desktop; gio set -t string \$f metadata::xfce-exe-checksum \$(sha256sum \$f | awk '{print \$1}')" > /etc/cron.d/trust_desktop_shortcuts - -echo "=== Automatic configuration done ===" -# read -p 'Open a shell in the chroot environment? [y/n] ' ans -# if [[ $ans == "y" ]]; then -# sudo -u $MISO_USERNAME /bin/bash -# fi - diff --git a/weeedebian/peracotta.png b/weeedebian/peracotta.png deleted file mode 100644 index cb9e9c7..0000000 Binary files a/weeedebian/peracotta.png and /dev/null differ diff --git a/weeedebian/peracotta_update b/weeedebian/peracotta_update deleted file mode 100644 index f845c44..0000000 --- a/weeedebian/peracotta_update +++ /dev/null @@ -1 +0,0 @@ -@reboot weee pipx upgrade peracotta diff --git a/weeedebian/peracruda.png b/weeedebian/peracruda.png deleted file mode 100644 index a6832ec..0000000 Binary files a/weeedebian/peracruda.png and /dev/null differ diff --git a/weeedebian/pointerkeys.txt b/weeedebian/pointerkeys.txt deleted file mode 100644 index 8b9a28f..0000000 --- a/weeedebian/pointerkeys.txt +++ /dev/null @@ -1,15 +0,0 @@ -=== Controlling your mouse pointer with the keyboard === - -Hold shift and press num lock to enable this feature. - -Use number keys on the keypad to navigate (or fn+number keys on laptops). - -To select a mouse button: -/ left mouse button (press twice for double, thrice for triple click) -* middle mouse button -- right mouse button - -Then press: -5 or + actually click with the selected button -0 or Ins press and hold (to start dragging files) -. or Del release the button (to stop dragging) diff --git a/weeedebian/resolv.conf b/weeedebian/resolv.conf deleted file mode 100644 index 6750165..0000000 --- a/weeedebian/resolv.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by quel_tale and not systemd -nameserver 1.1.1.1 -nameserver 8.8.8.8 diff --git a/weeedebian/resolved.conf b/weeedebian/resolved.conf deleted file mode 100644 index d8bccc1..0000000 --- a/weeedebian/resolved.conf +++ /dev/null @@ -1,24 +0,0 @@ -# This file is not really part of systemd. It was edited by hand. -# -# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. -# -# See resolved.conf(5) for details. - -[Resolve] -# Some examples of DNS servers which may be used for DNS= and FallbackDNS=: -# Cloudflare: 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001 -# Google: 8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844 -# Quad9: 9.9.9.9 2620:fe::fe -DNS=1.1.1.1 8.8.8.8 -FallbackDNS=1.0.0.1 8.8.4.4 9.9.9.9 2606:4700:4700::1111 2620:fe::10 2001:4860:4860::8888 -Domains=lab.weeeopen.it -DNSSEC=no -DNSOverTLS=opportunistic -#MulticastDNS=yes -#LLMNR=yes -#Cache=yes -#CacheFromLocalhost=no -#DNSStubListener=yes -#DNSStubListenerExtra= -#ReadEtcHosts=yes -#ResolveUnicastSingleLabel=no \ No newline at end of file diff --git a/weeedebian/s.sh b/weeedebian/s.sh deleted file mode 100755 index fa366e1..0000000 --- a/weeedebian/s.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -# enable and start sshd, print local IP and interface - -set -u - -# systemctl enable --now sshd -if sudo systemctl start sshd ; then - echo "ssh service started sucessfully." - _INT=$(ip -4 route |awk '/^default/ {print $5}') - _IPV4=$(ip addr show $_INT | grep -oP '(?<=inet\s)\d+(\.\d+){3}') - echo "Your local address is $_IPV4 on interface $_INT" -else - echo "ssh service failed to start." -fi - -read -p "Press enter to close" - diff --git a/weeedebian/ssh.desktop b/weeedebian/ssh.desktop deleted file mode 100755 index 027f995..0000000 --- a/weeedebian/ssh.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=ssh -Comment=Start SSH server -Terminal=true -Exec=/usr/sbin/s.sh -Icon=network-transmit-receive diff --git a/weeedebian/sshd_config b/weeedebian/sshd_config deleted file mode 100644 index f9fd9f3..0000000 --- a/weeedebian/sshd_config +++ /dev/null @@ -1,19 +0,0 @@ -# $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $ -# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin - -#Port 22 -#AddressFamily any -#ListenAddress 0.0.0.0 -#ListenAddress :: - -PasswordAuthentication yes -ChallengeResponseAuthentication no -UsePAM yes -X11Forwarding yes -PrintMotd no - -# Allow client to pass locale environment variables -AcceptEnv LANG LC_* - -# override default of no subsystems -Subsystem sftp /usr/lib/openssh/sftp-server diff --git a/weeedebian/tarallo.png b/weeedebian/tarallo.png deleted file mode 100644 index d1e4c06..0000000 Binary files a/weeedebian/tarallo.png and /dev/null differ diff --git a/weeedebian/toprc b/weeedebian/toprc deleted file mode 100644 index 68b74d6..0000000 --- a/weeedebian/toprc +++ /dev/null @@ -1,15 +0,0 @@ -top's Config File (Linux processes with windows) -Id:i, Mode_altscr=0, Mode_irixps=1, Delay_time=3.0, Curwin=0 -Def fieldscur=¥¨³´»½ÀÄ·º¹Å&')*+,-./012568<>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij - winflags=163124, sortindx=18, maxtasks=0, graph_cpus=1, graph_mems=1 - summclr=2, msgsclr=6, headclr=2, taskclr=7 -Job fieldscur=¥¦¹·º(³´Ä»½@<§Å)*+,-./012568>?ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij - winflags=193844, sortindx=0, maxtasks=0, graph_cpus=0, graph_mems=0 - summclr=6, msgsclr=6, headclr=7, taskclr=6 -Mem fieldscur=¥º»<½¾¿ÀÁMBNÃD34·Å&'()*+,-./0125689FGHIJKLOPQRSTUVWXYZ[\]^_`abcdefghij - winflags=193844, sortindx=21, maxtasks=0, graph_cpus=0, graph_mems=0 - summclr=5, msgsclr=5, headclr=4, taskclr=5 -Usr fieldscur=¥¦§¨ª°¹·ºÄÅ)+,-./1234568;<=>?@ABCFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij - winflags=193844, sortindx=3, maxtasks=0, graph_cpus=0, graph_mems=0 - summclr=3, msgsclr=3, headclr=2, taskclr=3 -Fixed_widest=0, Summ_mscale=1, Task_mscale=1, Zero_suppress=1 diff --git a/weeedebian/weee b/weeedebian/weee deleted file mode 100644 index 962be7e..0000000 --- a/weeedebian/weee +++ /dev/null @@ -1,2 +0,0 @@ -Defaults lecture = never -weee ALL=(ALL) NOPASSWD: ALL