Skip to content

Commit

Permalink
start cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
parmigggiana committed Jul 25, 2024
1 parent c8bea93 commit df723a0
Show file tree
Hide file tree
Showing 38 changed files with 284 additions and 711 deletions.
7 changes: 4 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"fossil.ignoreMissingFossilWarning": true
}
24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@

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 \
dosfstools \
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"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
3 changes: 0 additions & 3 deletions build/README.md

This file was deleted.

35 changes: 35 additions & 0 deletions chroot_scripts/00-hostname_setup.sh
Original file line number Diff line number Diff line change
@@ -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 <<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
114 changes: 114 additions & 0 deletions chroot_scripts/10-software_installation.sh
Original file line number Diff line number Diff line change
@@ -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
21 changes: 7 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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: .
- ./build:/miso/build:rwz
- ./weeedebian:/miso/weeedebian:roz
- ./chroot_scripts:/miso/chroot_scripts:roz
- /proc:/proc:rwz
build: .
stdin_open: true
Loading

0 comments on commit df723a0

Please sign in to comment.