Skip to content

Commit

Permalink
update readme + small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
parmigggiana committed Jul 26, 2024
1 parent b3ff12f commit b893e91
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 40 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export VERSION=2.0.0
export MISO_DISTRO_NAME=weeedebian
export MISO_ARCH=amd64
export MISO_CHROOT_SCRIPT=/weeedebian/martello.sh
export MISO_HOSTNAME=weeedebian
export MISO_ROOTPASSWD=asd
export MISO_USERNAME=weee
Expand Down
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,28 @@ Build Debian Live images, with the maximum amount of automation

## Usage

```shell
docker build -t weee-open/miso:latest .
docker run --name miso \
-i --rm \
-v $(readlink -f build):/build:rw \
-v $(readlink -f weeedebian):/weeedebian:ro \
-e MISO_BUILD_DIR=/build \
-e MISO_CHROOT_SCRIPT=/weeedebian/martello.sh \
-e MISO_HOSTNAME=weeedebian \
-e MISO_ROOTPASSWD=asd \
-e MISO_USERNAME=weee \
-e MISO_USERPASSWD=asd \
-e MISO_ARCH=amd64 \
-e MISO_CONTAINER=true \
weee-open/miso:latest
```
Appropriately configure the `.env` file.
Also useful if you don't have an endless amount of RAM: `MISO_MKSQUASHFS_MEM=500m`

Also useful if you don't have an endless amount of RAM: `-e MISO_MKSQUASHFS_MEM=500m \`
If needed, customization can be done by modifying or adding files in the directory `chroot_scripts`. They must be marked as executable.

This will output weeedebian-amd64.iso into build/weeedebian.
To build the iso, run

On a Debian/Ubuntu machine, you can run the script without any container:
```shell
docker compose up --build
```
This will output weeedebian-{MISO_ARCH}.iso into build/weeedebian-{MISO_ARCH}.

On a Debian/Ubuntu machine, you could also run the script without any container:
```shell
# Install dependencies
./install_dep.sh
./miso.sh build weeedebian/martello.sh amd64
./miso.sh
# Uninstall dependencies if you want to save space
./uninstall_dep.sh
```

This also works on WSL.
This also works on WSL (Untested).

### Requirements

Expand All @@ -48,8 +38,7 @@ Checklist:
* A [Tarallo](https://github.com/WEEE-Open/tarallo) token (optional)
* A bit of asd

Get the Tarallo token and create a file named `env.txt` inside `weeedebian` with this content:

To configure TARALLO, just add these two keys to the `.env` file
```text
export TARALLO_URL=http://127.0.0.1:8080
export TARALLO_TOKEN=yoLeCHmEhNNseN0BlG0s3A:ksfPYziGg7ebj0goT0Zc7pbmQEIYvZpRTIkwuscAM_k
Expand Down
34 changes: 18 additions & 16 deletions miso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,24 @@ 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}"
else
echo -e "${_BLUE}Bootstrapping${_RESET_COLOR}"
mmdebstrap \
--arch=$MISO_ARCH \
--variant=minbase \
--mode=sudo \
--include=linux-image-$LINUX_IMAGE_ARCH,live-boot,systemd-sysv,apt-utils,zstd,gpgv \
--components=main,contrib,non-free-firmware \
"--customize-hook=set +e; cp -r $MISO_CHROOT_SCRIPTS_DIR \$1; echo 'cd chroot_scripts; for file in *; do [ ! -d \$file ] && [ -x \$file ] && echo && echo -e +++ Running \$file +++ && bash ./\$file; done' | chroot \$1 '/bin/bash'; set -e" \
$MISO_VARIANT \
$MISO_BUILD_DIR/chroot \
http://ftp.it.debian.org/debian/
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}"
#else
# For now, always redo bootstrap since the setup is done with hooks. Eventually, this whole thing could be done properly through a makefile
# Skipping this skep isn't so important, since boostrap takes about 1 minute of the 5/6 total
echo -e "${_BLUE}Bootstrapping${_RESET_COLOR}"
mmdebstrap \
--arch=$MISO_ARCH \
--variant=minbase \
--mode=sudo \
--include=linux-image-$LINUX_IMAGE_ARCH,live-boot,systemd-sysv,apt-utils,zstd,gpgv \
--components=main,contrib,non-free-firmware \
"--customize-hook=set +e; cp -r $MISO_CHROOT_SCRIPTS_DIR \$1; echo 'cd chroot_scripts; for file in *; do [ ! -d \$file ] && [ -x \$file ] && echo && echo -e +++ Running \$file +++ && bash ./\$file; done' | chroot \$1 '/bin/bash'; set -e" \
$MISO_VARIANT \
$MISO_BUILD_DIR/chroot \
http://ftp.it.debian.org/debian/
#fi

if [[ "$1" == "--bootstrap" ]]; then
exit 0
Expand Down

0 comments on commit b893e91

Please sign in to comment.