Compare commits

...

6 Commits

Author SHA1 Message Date
Alexandre Aubin 5fc15bbd6c Add config file for yunohost builds 2020-06-18 17:40:39 +02:00
Alexandre Aubin ad19a25249 For some reason these packages are not available on stretch 2020-06-18 17:40:39 +02:00
Alexandre Aubin 5ddbc1692c Add first time script that force resize2fs + message about running the postinstall 2020-06-18 17:40:36 +02:00
Alexandre Aubin bd0f49e4f8 Add yunohost installation as stage3 2020-06-18 17:40:32 +02:00
Alexandre Aubin d9ed7ea44f We don't want a first user 2020-06-17 21:34:58 +02:00
Alexandre Aubin 14da13285f Remove stage 3, 4, 5 2020-06-09 19:47:53 +02:00
37 changed files with 108 additions and 196 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
deploy/*
work/*
config
postrun.sh
SKIP
SKIP_IMAGES

View File

@ -114,14 +114,6 @@ The following environment variables are supported:
To get the current value from a running system, look in
`/etc/timezone`.
* `FIRST_USER_NAME` (Default: "pi" )
Username for the first user
* `FIRST_USER_PASS` (Default: "raspberry")
Password for the first user
* `WPA_ESSID`, `WPA_PASSWORD` and `WPA_COUNTRY` (Default: unset)
If these are set, they are use to configure `wpa_supplicant.conf`, so that the Raspberry Pi can automatically connect to a wifi network on first boot. If `WPA_ESSID` is set and `WPA_PASSWORD` is unset an unprotected wifi network will be configured. If set, `WPA_PASSWORD` must be between 8 and 63 characters.

View File

@ -164,8 +164,6 @@ export LOG_FILE="${WORK_DIR}/build.log"
export TARGET_HOSTNAME=${TARGET_HOSTNAME:-raspberrypi}
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
export FIRST_USER_PASS=${FIRST_USER_PASS:-raspberry}
export RELEASE=${RELEASE:-buster}
export WPA_ESSID
export WPA_PASSWORD
@ -210,12 +208,6 @@ source "${SCRIPT_DIR}/dependencies_check"
dependencies_check "${BASE_DIR}/depends"
#check username is valid
if [[ ! "$FIRST_USER_NAME" =~ ^[a-z][-a-z0-9_]*$ ]]; then
echo "Invalid FIRST_USER_NAME: $FIRST_USER_NAME"
exit 1
fi
if [[ -n "${APT_PROXY}" ]] && ! curl --silent "${APT_PROXY}" >/dev/null ; then
echo "Could not reach APT_PROXY server: ${APT_PROXY}"
exit 1

7
config Normal file
View File

@ -0,0 +1,7 @@
IMG_NAME="yunohost"
RELEASE="stretch"
USE_QEMU="1"
LOCALE_DEFAULT="en_US.UTF-8"
TARGET_HOSTNAME="yunohost"
KEYBOARD_KEYMAP="us"
ENABLE_SSH="1"

View File

@ -12,10 +12,6 @@ if hash hardlink 2>/dev/null; then
fi
EOF
if [ -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config" ]; then
chmod 700 "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.config"
fi
rm -f "${ROOTFS_DIR}/etc/apt/apt.conf.d/51cache"
rm -f "${ROOTFS_DIR}/usr/bin/qemu-arm-static"

View File

@ -5,10 +5,6 @@ install -m 644 files/noclear.conf "${ROOTFS_DIR}/etc/systemd/system/getty@tty1.s
install -v -m 644 files/fstab "${ROOTFS_DIR}/etc/fstab"
on_chroot << EOF
if ! id -u ${FIRST_USER_NAME} >/dev/null 2>&1; then
adduser --disabled-password --gecos "" ${FIRST_USER_NAME}
fi
echo "${FIRST_USER_NAME}:${FIRST_USER_PASS}" | chpasswd
echo "root:root" | chpasswd
EOF

View File

@ -24,7 +24,5 @@ policykit-1
ssh-import-id
rng-tools
ethtool
vl805fw
ntfs-3g
pciutils
rpi-eeprom

View File

@ -40,9 +40,6 @@ on_chroot <<EOF
for GRP in input spi i2c gpio; do
groupadd -f -r "\$GRP"
done
for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev; do
adduser $FIRST_USER_NAME \$GRP
done
EOF
on_chroot << EOF

View File

@ -1,2 +0,0 @@
NOOBS_NAME="Raspbian Lite"
NOOBS_DESCRIPTION="A port of Debian with no desktop environment"

View File

@ -1,2 +0,0 @@
# Adobe Flash Player. Copyright 1996-2015. Adobe Systems Incorporated. All Rights Reserved.
rpi-chromium-mods rpi-chromium-mods/adobe note

View File

@ -1,15 +0,0 @@
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav
qpdfview gtk2-engines alsa-utils
desktop-base
git
omxplayer
raspberrypi-artwork
policykit-1
gvfs
rfkill
chromium-browser rpi-chromium-mods
gldriver-test
fonts-droid-fallback
fonts-liberation2
obconf
arandr

View File

@ -1,6 +0,0 @@
xserver-xorg-video-fbdev xserver-xorg xinit xserver-xorg-video-fbturbo
mousepad
lxde lxtask menu-xdg
zenity xdg-utils
gvfs-backends gvfs-fuse
lightdm gnome-themes-standard-data gnome-icon-theme

View File

@ -1,8 +0,0 @@
#!/bin/bash -e
on_chroot << EOF
update-alternatives --install /usr/bin/x-www-browser \
x-www-browser /usr/bin/chromium-browser 86
update-alternatives --install /usr/bin/gnome-www-browser \
gnome-www-browser /usr/bin/chromium-browser 86
EOF

View File

@ -0,0 +1,62 @@
#!/bin/bash -e
# Prevent dhcp setting the "search" thing in /etc/resolv.conf, leads to many
# weird stuff (e.g. with numericable) where any domain will ping >.>
on_chroot << EOF
echo 'supersede domain-name "";' >> /etc/dhcp/dhclient.conf
echo 'supersede domain-search "";' >> /etc/dhcp/dhclient.conf
echo 'supersede search ""; ' >> /etc/dhcp/dhclient.conf
EOF
# Disable those damn supposedly "predictive" interface names
# c.f. https://unix.stackexchange.com/a/338730
on_chroot << EOF
rm -f /etc/systemd/network/99-default.link
ln -s /dev/null /etc/systemd/network/99-default.link
EOF
# Run the actual install
on_chroot << EOF
apt-get install insserv resolvconf -y
curl https://install.yunohost.org/stretch | bash -s -- -a
rm -f /etc/ssh/ssh_host_*
EOF
echo "Enabling ssh login for root + setting default password"
on_chroot << EOF
sed -i '/PermitRootLogin/c\PermitRootLogin yes' /etc/ssh/sshd_config
echo "root:yunohost" | chpasswd
EOF
install -m 755 files/check_yunohost_is_installed.sh "${ROOTFS_DIR}/etc/profile.d/"
echo "Cleaning ..."
on_chroot << EOF
apt-get clean
find /var/log -type f -exec rm {} \;
EOF
# Gotta manually kill those stuff which are some sort of daemon running
# for slapd / nscd / nslcd ... otherwise the script is unable to unmount
# the rootfs/image after that ?
while lsof 2>/dev/null | grep -q /root/rpi-image/work/*/export-image/rootfs/dev;
do
for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'`
do
echo "Killing $PID"
kill -9 $PID || true
sleep 1
done
sleep 5
done
while ps -ef --forest | grep "qemu-arm-static" | grep -v "grep"
do
for PID in `ps -ef --forest | grep "qemu-arm-static" | grep -v "grep" | grep "nginx\|nscd\|slapd\|nslcd" | awk '{print $2}'`
do
echo "Killing $PID"
kill -9 $PID || true
sleep 1
done
sleep 5
done

View File

@ -0,0 +1,36 @@
#!/bin/sh
if [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*i}" ]; then
# Trigger resize2fs_once in case it wasnt triggered so far ...
if [ -f "/etc/init.d/resize2fs_once" ];
then
echo "Resizing root partition ... (this may take up to a few minutes)"
systemctl restart resize2fs_once
fi
if [ ! -f "/etc/yunohost/installed" ];
then
normal=$(printf '\033[0m')
bold=$(printf '\033[1m')
blue=$(printf '\033[34m')
IPS=$(hostname --all-ip-address | sed 's/ /\n /g')
cat << EOF
======================================================================
${bold}${blue}
Congratulations on setting up your YunoHost server !
${normal}${bold}
To finish the installation, you should run the postinstallation.
You can find documentation about it on :${normal}
https://yunohost.org/postinstall
${normal}${bold}
You can run it from the command line interface with :${normal}
$ yunohost tools postinstall
${normal}${bold}
Or from a browser by accessing one of your local IP :${normal}
$IPS${normal}
======================================================================
EOF
fi
fi

View File

@ -1,3 +0,0 @@
#!/bin/bash -e
rm -f "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/wait.conf"

2
stage3/EXPORT_NOOBS Normal file
View File

@ -0,0 +1,2 @@
NOOBS_NAME="YunoHost Raspbian"
NOOBS_DESCRIPTION="A port of Debian for the Raspberry Pi with YunoHost pre-installed"

View File

@ -1,5 +1,5 @@
#!/bin/bash -e
if [ ! -d "${ROOTFS_DIR}" ]; then
if [ ! -d ${ROOTFS_DIR} ]; then
copy_previous
fi

View File

@ -1,2 +0,0 @@
# Enable realtime process priority?
jackd2 jackd/tweak_rt_limits boolean true

View File

@ -1,25 +0,0 @@
python python3-pygame python-pygame python-tk
python3 python3-tk thonny
python3-pgzero
python-serial python3-serial
python-picamera python3-picamera
debian-reference-en dillo
raspberrypi-net-mods raspberrypi-ui-mods
python-pip python3-pip
python3-numpy
pypy
alacarte rc-gui sense-hat
tree
libgl1-mesa-dri libgles1 libgles2-mesa xcompmgr
geany
piclone
wiringpi pigpio python-pigpio python3-pigpio raspi-gpio python-gpiozero python3-gpiozero python3-rpi.gpio
python-spidev python3-spidev
python-twython python3-twython
python-smbus python3-smbus
python-flask python3-flask
pprompt
piwiz
rp-prefapps
ffmpeg
vlc

View File

@ -1,2 +0,0 @@
pi-package
realvnc-vnc-server

View File

@ -1,22 +0,0 @@
python-automationhat python3-automationhat
python-blinkt python3-blinkt
python-cap1xxx python3-cap1xxx
python-drumhat python3-drumhat
python-envirophat python3-envirophat
python-explorerhat python3-explorerhat
python-fourletterphat python3-fourletterphat
python-microdotphat python3-microdotphat
python-mote python3-mote
python-motephat python3-motephat
python-phatbeat python3-phatbeat
python-pianohat python3-pianohat
python-piglow python3-piglow
python-rainbowhat python3-rainbowhat
python-scrollphat python3-scrollphat
python-scrollphathd python3-scrollphathd
python-sn3218 python3-sn3218
python-skywriter python3-skywriter
python-touchphat python3-touchphat
python-buttonshim python3-buttonshim
python-unicornhathd python3-unicornhathd
python-pantilthat python3-pantilthat

View File

@ -1,4 +0,0 @@
hunspell-en-gb
hyphen-en-gb
wamerican
wbritish

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
on_chroot << EOF
SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_boot_behaviour B4
EOF

View File

@ -1,7 +0,0 @@
#!/bin/bash -e
#Alacarte fixes
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share/applications"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.local/share/desktop-directories"

View File

@ -1,15 +0,0 @@
#!/bin/sh -e
magpi_regex="MagPi[[:digit:]]*.pdf"
magpi_loc="$(curl -s https://magpi.raspberrypi.org/latest-pdf)"
magpi_latest="$(echo "$magpi_loc" | grep "$magpi_regex" -m 1 -o)"
if [ ! -f "files/$magpi_latest" ]; then
find files/ -regextype grep -regex "files/$magpi_regex" -delete
wget "$magpi_loc" -O "files/$magpi_latest"
fi
file "files/$magpi_latest" | grep -q "PDF document"
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/MagPi"
install -v -o 1000 -g 1000 -m 644 "files/$magpi_latest" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/MagPi/"

View File

@ -1 +0,0 @@
*.pdf

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
on_chroot << EOF
raspi-config nonint do_xcompmgr 0
EOF

View File

@ -1,4 +0,0 @@
IMG_SUFFIX=""
if [ "${USE_QEMU}" = "1" ]; then
export IMG_SUFFIX="${IMG_SUFFIX}-qemu"
fi

View File

@ -1,2 +0,0 @@
NOOBS_NAME="Raspbian"
NOOBS_DESCRIPTION="A port of Debian with the Raspberry Pi Desktop"

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous
fi

View File

@ -1,16 +0,0 @@
mu-editor
sonic-pi
scratch nuscratch scratch2 scratch3
smartsim
minecraft-pi python-minecraftpi python-picraft python3-picraft
python-sense-emu sense-emu-tools python-sense-emu-doc
wolfram-engine
claws-mail
greenfoot-unbundled bluej
nodered
realvnc-vnc-viewer
python-games
code-the-classics

View File

@ -1,3 +0,0 @@
libreoffice-pi
libreoffice-help-en-gb
libreoffice-l10n-en-gb

View File

@ -1,4 +0,0 @@
IMG_SUFFIX="-full"
if [ "${USE_QEMU}" = "1" ]; then
export IMG_SUFFIX="${IMG_SUFFIX}-qemu"
fi

View File

@ -1,2 +0,0 @@
NOOBS_NAME="Raspbian Full"
NOOBS_DESCRIPTION="A port of Debian with desktop and recommended applications"

View File

@ -1,5 +0,0 @@
#!/bin/bash -e
if [ ! -d "${ROOTFS_DIR}" ]; then
copy_previous
fi