#!/bin/sh # Exit on errors set -e # Be verbose set -x version=$(uname -r | cut -d "-" -f 1-2) # "12.2-RELEASE" or "13.0-CURRENT" VER=$(echo "${version}" | cut -d "-" -f 1) # "12.2" or "13.0" MAJOR=$(echo "${version}" | cut -d "." -f 1) # "12" or "13" # Allow all users to write extended attributes; setuid chmod +s "${uzip}/usr/sbin/setextattr" mkdir -p /tmp/system-overlay cd /tmp/system-overlay # Wallpaper # TODO: Also check # https://papers.co/desktop/vg41-ribbon-abstract-art-blue-pattern/ # https://papers.co/desktop/vm16-abstract-blue-rhytm-pattern/ # wget "https://res.allmacwallpaper.com/get/iMac-21-inch-wallpapers/Minimalist-blue-1920x1080/1686-9.jpg" -O "${uzip}"/usr/local/share/slim/themes/default/background.jpg wget -q "https://github.com/helloSystem/ISO/releases/download/assets/graphite.jpg" -O "${uzip}"/usr/local/share/slim/themes/default/background.jpg wget -q "https://github.com/helloSystem/ISO/releases/download/assets/graphite_shadow.jpg" -O "${uzip}"/usr/local/share/slim/themes/default/background_shadow.jpg # Icons # Use blue folder icons instead of the ones packaged in FreeBSD which have yellow folder icons # Don't extract directly in /tmp, as tar will modify its permissions icons_temp=$(mktemp -d /tmp/icons.XXXXX) cd $icons_temp wget -c -q http://archive.ubuntu.com/ubuntu/pool/universe/x/xubuntu-artwork/xubuntu-icon-theme_16.04.2_all.deb tar xf xubuntu-icon-theme_16.04.2_all.deb tar xf data.tar.xz mkdir -p "${uzip}"/usr/local/share/icons/ mv ./usr/share/icons/elementary-xfce "${uzip}"/usr/local/share/icons/ mv ./usr/share/doc/xubuntu-icon-theme/copyright "${uzip}"/usr/local/share/icons/elementary-xfce/ sed -i -e 's|usr/share|usr/local/share|g' "${uzip}"/usr/local/share/icons/elementary-xfce/copyright rm "${uzip}"/usr/local/share/icons/elementary-xfce/copyright-e cd - rm -r $icons_temp # hello icons wget -q "https://raw.githubusercontent.com/helloSystem/Artwork/main/elementary-hello/usr/local/share/icons/devices/128/computer.png" -O "${uzip}"/usr/local/share/icons/elementary-xfce/devices/128/computer.png wget -q "https://raw.githubusercontent.com/helloSystem/Artwork/main/elementary-hello/usr/local/share/icons/devices/128/computer-laptop.png" -O "${uzip}"/usr/local/share/icons/elementary-xfce/devices/128/computer-laptop.png # Set default icon theme ( cd "${uzip}/usr/local/share/icons/" ; ln -s elementary-xfce default ) # Give disk images the CD image icon as long as we don't have a proper one # FIXME: https://github.com/shimmerproject/elementary-xfce/issues/234 # application/x-raw-disk-image # application-x-cd-image.png for j in 16 22 24 32 48 64 96 128; do ln -s "${uzip}/usr/local/share/icons/elementary-xfce/mimes/${j}/application-x-cd-image.png" "${uzip}/usr/local/share/icons/elementary-xfce/mimes/${j}/application-x-raw-disk-image.png" done # Cursor theme with HiDPi Support, sizes: 22 24 28 32 40 48 56 64 72 80 88 96 wget -c -q https://github.com/ful1e5/apple_cursor/releases/download/v1.0.6/macOSBigSur.tar.gz tar xfv macOSBigSur.tar.gz cp -r macOSBigSur/cursor* "${uzip}/usr/local/share/icons/default/" rm -rf macOSBigSur/ # mv macOSBigSur "${uzip}/usr/local/share/icons/" # ( cd "${uzip}/usr/local/share/icons/" ; ln -s macOSBigSur default ) # chmod 755 "${uzip}/usr/local/share/icons/macOSBigSur" rm macOSBigSur.tar.gz ln -s "${uzip}/usr/local/share/icons/macOSBigSur"/cursor* "${uzip}/usr/local/share/icons/elementary-xfce/" # KWin if [ "${MAJOR}" == "13" ] ; then wget -q "https://github.com/helloSystem/KWin/releases/download/main-13.2/KWin.app.zip" md5sum KWin.app.zip else wget -q "https://github.com/helloSystem/KWin/releases/download/main-14.0/KWin.app.zip" md5sum KWin.app.zip fi unzip KWin.app.zip rm KWin.app.zip wget -q "https://raw.githubusercontent.com/helloSystem/BreezeEnhanced/master/etc/xdg/breezerc" -O "${uzip}/usr/local/etc/xdg/breezerc" wget -q "https://raw.githubusercontent.com/helloSystem/BreezeEnhanced/master/etc/xdg/kwinrc" -O "${uzip}/usr/local/etc/xdg/kwinrc" # Filer wget -q https://github.com/helloSystem/Filer/releases/download/continuous/Filer_FreeBSD.zip unzip Filer_FreeBSD.zip rm -f Filer_FreeBSD.zip # Ugly hack so that drag and drop in Filer shows the normal mouse cursor (arrow pointer) instead of one with "+" chroot "${uzip}" ln -sf /usr/local/share/icons/default/cursors/left_ptr /usr/local/share/icons/default/cursors/dnd-copy # QtPlugin wget -q https://github.com/helloSystem/QtPlugin/releases/download/continuous/QtPlugin_FreeBSD.zip unzip QtPlugin_FreeBSD.zip cp -Rf QtPlugin/ "${uzip}/" rm -f QtPlugin_FreeBSD.zip rm -rf QtPlugin/ wget -q https://raw.githubusercontent.com/helloSystem/QtPlugin/master/stylesheet.qss mkdir -p "${uzip}/usr/local/etc/xdg/" sudo mv stylesheet.qss "${uzip}/usr/local/etc/xdg/" # launch wget -q https://github.com/helloSystem/launch/releases/download/continuous/launch_FreeBSD.zip unzip launch_FreeBSD.zip cp launch "${uzip}/usr/local/sbin/xdg-open" # Override the one provided by devel/xdg-utils mv launch open bundle-thumbnailer "${uzip}/usr/local/bin/" rm -f launch_FreeBSD.zip # DSBexec # FIXME: Get it into ports, and install it from a package instead wget -q https://github.com/helloSystem/DSBexec/releases/download/continuous/dsbexec_FreeBSD.zip unzip dsbexec_FreeBSD.zip mv dsbexec "${uzip}/usr/local/bin/" rm -f dsbexec_FreeBSD.zip # Menu wget -q https://github.com/helloSystem/Menu/releases/download/continuous/Menu_FreeBSD.zip unzip Menu_FreeBSD.zip rm -f Menu_FreeBSD.zip # TODO: Get self-hosted gmenudbusmenuproxy # because the one from pkg pulls in a lot of KDE Plasma wget -q https://github.com/helloSystem/ISO/releases/download/assets/gmenudbusmenuproxy chmod +x gmenudbusmenuproxy mv gmenudbusmenuproxy "${uzip}/usr/local/bin/" # Dock # wget -q https://github.com/helloSystem/Dock/releases/download/continuous/Dock_FreeBSD.zip # unzip Dock_FreeBSD.zip # rm -f Dock_FreeBSD.zip mv * "${uzip}/System/" # Scheduled for removal # Symlink menubar in place; FIXME: Remove once desktop2app does not need to restart it from there anymore # chroot "${uzip}" ln -s /System/Menu.app/usr/bin/menubar /usr/local/bin # Add applications from the helloSystem/Utilities repository mkdir -p "${uzip}/Applications/" mkdir -p "${uzip}/System/" # The direct download link gives 403 Forbidden now, so we git clone it instead git clone --depth 1 --branch master https://github.com/helloSystem/Utilities.git Utilities-master mv "Utilities-master/Root/"* "${uzip}"/ mv 'Utilities-master/Internet' "${uzip}/Applications/" mv 'Utilities-master/3D Printing' "${uzip}/Applications/" mv 'Utilities-master/Audio' "${uzip}/Applications/" mv 'Utilities-master/Developer' "${uzip}/Applications/" mv 'Utilities-master/Under Construction' "${uzip}/Applications/" mv 'Utilities-master/Graphics' "${uzip}/Applications/" mv 'Utilities-master/Office' "${uzip}/Applications/" mv 'Utilities-master/Preferences' "${uzip}/Applications/" mv 'Utilities-master/System'/* "${uzip}/System/" mv 'Utilities-master/Utilities' "${uzip}/Applications/" mv 'Utilities-master/Video' "${uzip}/Applications/" ( cd "${uzip}/System/Welcome.app/Resources/" && wget -q "https://github.com/helloSystem/Utilities/releases/download/assets/pamgaea-by-kevin-macleod-from-filmmusic-io.ogg" ) rm -rf Utilities-master/ # Experimental Filer wget -q -q https://github.com/probonopd/Filer/releases/download/continuous/Filer_FreeBSD.zip unzip Filer_FreeBSD.zip rm -f Filer_FreeBSD.zip mv Filer.app "${uzip}/Applications/Under Construction/" # Tasmota Device Manager wget -q https://github.com/helloSystem/ISO/releases/download/assets/Tasmota.Device.Manager.app.zip unzip "Tasmota.Device.Manager.app.zip" mv "Tasmota Device Manager.app" "${uzip}/Applications/Utilities" rm -f "Tasmota.Device.Manager.app.zip" # Required for Remote Assistance.app wget -c -q https://github.com/gjedeer/tuntox/releases/download/0.0.9/tuntox-freebsd-x64 -O tuntox chmod +x tuntox mv tuntox "${uzip}/usr/local/bin/" # BuildNotify.app: Notifications about continuous build server status # wget -q https://github.com/anaynayak/buildnotify/archive/2.0.0.zip # unzip 2.0.0.zip # mkdir -p BuildNotify.app # mv buildnotify-2.0.0 BuildNotify.app/Resources # ( cd BuildNotify.app && ln -s Resources/buildnotifyapplet.py BuildNotify ) # rm -f 2.0.0.zip # sed -i -e 's|/usr/bin/env python|/usr/bin/env python3|g' BuildNotify.app/Resources/buildnotifyapplet.py # rm -f BuildNotify.app/Resources/buildnotifyapplet.py-e # mv BuildNotify.app "${uzip}/Applications/Utilities/" # Lector.app: E-book reader # Requires: py37-xmltodict py37-beautifulsoup git clone https://github.com/BasioMeusPuga/Lector rm -rf Lector/.git mv Lector Lector.app mkdir -p Lector.app/Resources echo "application/epub+zip" > Lector.app/Resources/can-open mv Lector.app/* Lector.app/Resources 2>/dev/null || true ( cd Lector.app/ ; ln -s Resources/lector/__main__.py Lector ) cp Lector.app/Resources/lector/resources/raw/Lector.png Lector.app/Resources/ mv Lector.app "${uzip}"/Applications # Sticky Notes.app # TODO: Resurrect it based on the latest version # Requires: py37-qt5-dbus # git clone https://gitlab.com/william.belanger/qtpad # ( cd qtpad ; git checkout b7a7764d ) # rm -rf qtpad/screenshots # mv qtpad/qtpad qtpad/Resources # mv qtpad/* qtpad/Resources 2>/dev/null || true # rm -rf qtpad/.git # ( cd qtpad ; ln -s Resources/__init__.py "Sticky Notes" ) # sed -i -e 's|/usr/bin/python3|/usr/bin/env python3|g' qtpad/Resources/__init__.py # rm qtpad/Resources/__init__.py-e # cp qtpad/Resources/icons/qtpad.svg "qtpad/Resources/Sticky Notes.svg" # rsvg-convert -a -w 256 -h 256 "qtpad/Resources/Sticky Notes.svg" -o "qtpad/Resources/Sticky Notes.png" # mv qtpad/ "Sticky Notes.app" # mv "Sticky Notes.app" "${uzip}"/Applications/Utilities # QHexEdit wget -q https://github.com/helloSystem/QHexEdit/releases/download/continuous/QHexEdit_FreeBSD.zip unzip QHexEdit_FreeBSD.zip mv QHexEdit.app "${uzip}/Applications/Developer/" rm -f QHexEdit_FreeBSD.zip # URW fonts including Nimbus Sans # The direct download link gives 403 Forbidden now, so we git clone it instead # wget -c -q https://github.com/ArtifexSoftware/urw-base35-fonts/archive/20200910.zip # unzip -q 20200910.zip git clone --depth 1 --branch master https://github.com/ArtifexSoftware/urw-base35-fonts.git urw-base35-fonts-master mkdir -p "${uzip}/usr/local/share/fonts/TTF/" cp -R urw-base35-fonts-master/fonts/*.ttf "${uzip}/usr/local/share/fonts/TTF/" rm -rf urw-base35-fonts-master/ # Inter font, needed for proper special characters in menus wget -c -q https://github.com/rsms/inter/releases/download/v3.19/Inter-3.19.zip unzip Inter-3.19.zip mv 'Inter Desktop/Inter-V.ttf' "${uzip}/usr/local/share/fonts/TTF/" rm -rf "Inter *" # Applications mkdir -p "${uzip}/Applications" chmod a+rwx "${uzip}/Applications" # chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/org.kde.falkon.desktop /Applications/ # See workaround below chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/featherpad.desktop /Applications/ chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/qpdfview.desktop /Applications/ # Links on the Desktop # mkdir -p "${uzip}"/usr/share/skel/Desktop # cd "${uzip}"/usr/share/skel/Desktop/ # ln -s /Applications . chroot "${uzip}" ln -s /Applications/Internet/Falkon.app /usr/share/skel/Desktop # More Preferences mkdir -p "${uzip}/Applications/Preferences" # chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/lxqt-config-globalkeyshortcuts.desktop /Applications/Preferences/ chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/arandr.desktop /Applications/Preferences/ -g chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/system-config-printer.desktop /Applications/Preferences/ echo "GenericName=Sound" >> "${uzip}"/usr/local/share/applications/dsbmixer.desktop chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/dsbmixer.desktop /Applications/Preferences/ -g # https://github.com/PreyK/HelloDisplay git clone https://github.com/PreyK/HelloDisplay mkdir -p Display.app/ mv HelloDisplay Display.app/Resources mv Display.app/Resources/graphics/disp.png Display.app/Resources/Display.png cat > Display.app/Display <<\EOF #!/bin/sh HERE="$(dirname "$(readlink -f "${0}")")" cd "${HERE}/Resources/" exec python3 "${HERE}/Resources/Display.py" EOF chmod +x Display.app/Display mv Display.app "${uzip}/Applications/Under Construction/" # More Utilities mkdir -p "${uzip}/Applications/Utilities" # chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/org.kde.systemmonitor.desktop /Applications/Utilities/ # TODO: Find lighter replacement # chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/qterminal.desktop /Applications/Utilities/ # For now, we are using a patched version of QTerminal that includes https://github.com/lxqt/qtermwidget/pull/418 wget -c -q "https://github.com/helloSystem/ISO/releases/download/assets/QTerminal_FreeBSD.zip" unzip QTerminal_FreeBSD.zip mv "QTerminal.app" "${uzip}/Applications/Utilities/" rm QTerminal_FreeBSD.zip # Needed for /usr/local/bin/mountarchive wget -c -q "https://github.com/helloSystem/ISO/releases/download/assets/fuse-archive" chmod +x fuse-archive sudo mv fuse-archive "${uzip}/usr/local/bin/" # cp "${uzip}"/usr/local/share/applications/usr_local_lib_qt5_bin_assistant.desktop "${uzip}"/tmp/documentation.desktop # sed -i -e 's|^GenericName=.*|GenericName=Documentation|g' "${uzip}"/tmp/documentation.desktop # sed -i -e 's|^Icon=.*|Icon=documentation_section|g' "${uzip}"/tmp/documentation.desktop # chroot "${uzip}" desktop2app /tmp/documentation.desktop /Applications/Utilities -g # Remove non-hello xessions desktop files # to silence misleading messages from slim on the command line rm -rf ${uzip}/usr/local/share/xsessions/*.desktop # Finishing touches on installed packages cp /etc/resolv.conf ${uzip}/etc/resolv.conf mount_nullfs ${packages} ${uzip}/var/cache/pkg mount -t devfs devfs ${uzip}/dev # Needed for translations in the helloSystem/Utilities repository chroot "${uzip}" python3 -m pip install translate-toolkit # Needed for Display.app chroot "${uzip}" python3 -m pip install pyedid # Needed for FUSE mounting by users chmod 1777 ${uzip}/media # Workaround for: appmenu-gtk-module is not yet in quarterly packages; FIXME: install it from the packages once it is there # https://github.com/helloSystem/ISO/issues/20 # FIXME: This fails on 13-CURRENT https://github.com/helloSystem/ISO/issues/27 # IGNORE_OSVERSION=yes /usr/local/sbin/pkg-static -c "${uzip}" add "https://github.com/helloSystem/Menu/releases/download/helper/appmenu-gtk-module-0.7.3.2.txz" || true # /usr/local/sbin/pkg-static -c "${uzip}" install appmenu-gtk-module || true # --> We are installing the package from quarterly for now because the above tends to fail with SSH Authentication Error # Workaround for disappeared falkon package # This works only if all dependency pkgs have been added beforehand # IGNORE_OSVERSION=yes /usr/local/sbin/pkg-static -c "${uzip}" add "https://github.com/helloSystem/ISO/releases/download/fallback/falkon-3.1.0.txz" || true # Workaround for disappeared ssvnc package # Mirrored from http://pkg.freebsd.org/FreeBSD:13:amd64/release_0/All/ssvnc-1.0.29_4.txz # This works only if all dependency pkgs have been added beforehand IGNORE_OSVERSION=yes /usr/local/sbin/pkg-static -c "${uzip}" add "https://github.com/helloSystem/ISO/releases/download/assets/ssvnc-1.0.29_4.txz" || true # Remove pkg (it will be bootstrapped if needed) # chroot "${uzip}" sudo pkg remove -y -f pkg # Breaks furybsd-init-helper # Prevent the hello package from being upgraded with an unrelated package of the same name # and prevent the modifications made to the system in this script from being overwritten # by package updates done by the user at a later time; FIXME: Find a cleaner way chroot "${uzip}" pkg lock -y hello automount slim dejavu liberation-fonts-ttf noto-basic rm ${uzip}/etc/resolv.conf umount ${uzip}/var/cache/pkg umount ${uzip}/dev # Workaround for disappeared falkon package # chroot "${uzip}" env QT_QPA_PLATFORM=minimal QT_QPA_PLATFORMTHEME=panda /usr/local/bin/desktop2app /usr/local/share/applications/org.kde.falkon.desktop /Applications/ # Autostart mkdir -p "${uzip}/Applications/Autostart/" # ( cd "${uzip}/Applications/Autostart/" ; ln -s ../Utilities/BuildNotify.app . ) ( cd "${uzip}/Applications/Autostart/" ; ln -s ../../System/Volume.app . ) ( cd "${uzip}/Applications/Autostart/" ; ln -s ../../System/Network.app . ) ( cd "${uzip}/Applications/Autostart/" ; ln -s /usr/local/bin/qlipper . ) # Silence late boot messages cat > /tmp/rc <<\EOF #!/bin/sh # The following block was added by helloSystem # FIXME: Let us know how to do this properly # Silence messages if boot_mute="YES" is set if [ "$(kenv boot_mute 2>/dev/null)" = "YES" ] ; then conscontrol delete ttyv0 >/dev/null 2>&1 exec 1>>/dev/null 2>&1 fi # EOF cat "${uzip}/etc/rc" >> /tmp/rc mv /tmp/rc "${uzip}/etc/rc" # Silence shutdown messages cat > /tmp/rc.shutdown <<\EOF #!/bin/sh # The following block was added by helloSystem # FIXME: Let us know how to do this properly # Silence messages if boot_mute="YES" is set if [ "$(kenv boot_mute 2>/dev/null)" = "YES" ] ; then exec 1>>/dev/null 2>&1 fi # EOF cat "${uzip}/etc/rc.shutdown" >> /tmp/rc.shutdown mv /tmp/rc.shutdown "${uzip}/etc/rc.shutdown" ## TODO: Remove this block once no longer needed ## # Prevent boot from being visually interrupted by vidcontrol related errors ## mv "${uzip}/usr/sbin/vidcontrol" "${uzip}/usr/sbin/vidcontrol.original" ## cat > "${uzip}/usr/sbin/vidcontrol" <<\EOF ## #!/bin/sh ## exit 0 ## EOF ## chmod +x "${uzip}/usr/sbin/vidcontrol" # Branded kernel boot logo image mkdir -p "${uzip}/tmp/logo/" wget -c -q "https://github.com/helloSystem/ISO/releases/download/assets/logo.bin" -O "${uzip}/tmp/logo/logo.bin" wget -c -q "https://github.com/helloSystem/ISO/releases/download/assets/logo2kernel" -O "${uzip}/tmp/logo/logo2kernel" chmod +x "${uzip}/tmp/logo/logo2kernel" cat << EOR | chroot "${uzip}" cd /tmp/logo ./logo2kernel mv kernel.modified /boot/kernel/kernel EOR rm -rf "${uzip}/tmp/logo/" # setuid, setgid so that normal users can attach disk images chmod 6755 "${uzip}"/sbin/mdconfig # setuid, setgid so that normal users can bring up and down (especially wireless) network devices chmod 6755 "${uzip}"/sbin/ifconfig # Disable most text-based consoles, especially ttyv0, # to prevent boot from being visually interrupted by login prompts mv "${uzip}/etc/ttys" "${uzip}/etc/ttys.original" cat > "${uzip}/etc/ttys" <<\EOF ttyv1 "/usr/libexec/getty Pc" xterm on secure EOF # Prevent boot from being visually interrupted by syslog messages # by commenting out the line that ends in '/dev/console' sed -i -e 's|^\(.*/dev/console\)|# \1|g' "${uzip}"/etc/syslog.conf rm "${uzip}/etc/syslog.conf-e" # Workaround to get rounded corners as long as picom in FreeBSD ports # does not have this yet; FIXME: Remove once no longer needed # wget -q https://github.com/helloSystem/ISO/releases/download/assets/picom.tar.bz2 # tar xf picom.tar.bz2 # mv picom "${uzip}/usr/local/bin/picom" # rm -f picom.tar.bz2 cat >> "${uzip}"/etc/devfs.conf <<\EOF # Allow users to write optical media # https://github.com/helloSystem/ISO/issues/327 own acd* root:wheel perm acd* 0660 own cd* root:wheel perm cd* 0660 own pass* root:wheel perm pass* 0660 # Allow users access to serial ports own cua* root:wheel perm cua* 0660 own tty* root:wheel perm tty* 0660 EOF # https://github.com/helloSystem/hello/issues/50#issuecomment-753237990 # Workaround to allow unmounting as normal user # setuid root chmod +s "${uzip}/sbin/umount" # Remove surrogate fonts # FIXME: Get this dependency removed from packages upstream # sudo pkg remove dejavu # would result in the deinstallation of 2GB of the desktop # Can we have a stand-in dummy package that would be used instead? # https://github.com/helloSystem/ISO/issues/91 chroot ${uzip} sh -c 'for FILE in $(pkg list dejavu) ; do rm $FILE ; done' # X.Org miscellaneous fonts chroot ${uzip} sh -c 'for FILE in $(pkg list font-bh-ttf) ; do rm $FILE ; done' chroot ${uzip} sh -c 'for FILE in $(pkg list font-misc-ethiopic) ; do rm $FILE ; done' chroot ${uzip} sh -c 'for FILE in $(pkg list font-misc-meltho) ; do rm $FILE ; done' # Liberation was released in 2007 by Red Hat, who had commissioned the designs from the # commercial foundry Ascender Corporation Serif, and Liberation Mono. # Designed to have the same metrics as the proprietary Monotype fonts # Arial, Times New Roman, and Courier New. Ever since, every Linux desktops looks ugly chroot ${uzip} sh -c 'for FILE in $(pkg list liberation-fonts-ttf) ; do rm $FILE ; done' chroot ${uzip} sh -c 'for FILE in $(pkg list noto-basic) ; do rm $FILE ; done' # chroot "${uzip}" update-desktop-database # Needed for mountarchive to be associated with the MIME types it can handle; TODO: Get rid of XDG # Temporary workaround for https://github.com/helloSystem/ISO/issues/14 # mv "${uzip}/usr/sbin/pkg" "${uzip}/usr/sbin/pkg.real" # cat > "${uzip}/usr/sbin/pkg" <<\EOF # #!/bin/sh # # Temporary workaround for https://github.com/helloSystem/ISO/issues/14 # case "$@" in # *update*) echo "pkg update is not yet supported in helloSystem" ;; # *upgrade*) echo "pkg update is not yet supported in helloSystem" ;; # *) pkg.real "$@" ;; # esac # EOF # chmod +x "${uzip}/usr/sbin/pkg" # No longer needed? # Brute force method to make FAT media fully accessible and executable by everyone # https://github.com/vermaden/automount/issues/21#issuecomment-808753031 # https://github.com/vermaden/automount/issues/27 # https://github.com/vermaden/automount/commit/f50118920208e49890067d00ecd6bb1a97b47ce3 # FIXME: Use better solution # sed -i '' -e 's|longnames -m 644|longnames -m 777|g' "${uzip}/usr/local/sbin/automount" # sed -i '' -e 's|longnames -m 755|longnames -m 777|g' "${uzip}/usr/local/sbin/automount" # Required for runappimage # FIXME: Replace by something written in Python that does not need to be compiled # and hence is cross-platform wget -c -q "https://github.com/helloSystem/elfsize/releases/download/0/elfsize" chmod +x elfsize mv elfsize "${uzip}/usr/local/bin/" # Add /Users symkink ( cd "${uzip}" ; ln -s home Users ) # Improve compatibility with many scripts from the Linux world, # including those in many AppImages chroot ${uzip} ln -s /usr/local/bin/bash /bin/bash # Remove unwanted UDisks2VolumeMonitor D-Bus service # TODO: Find a proper way to do this. The correct thing to do would probably to split up the FreeBSD package # FIXME: This is guaranteed to break as soon as the user updates/upgrades the package if [ -f "${uzip}/usr/local/share/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service" ] ; then rm -rf "${uzip}/usr/local/share/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service" touch "${uzip}/usr/local/share/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service" # Make the file immutable so that even root cannot overwrite it chflags schg "${uzip}/usr/local/share/dbus-1/services/org.gtk.vfs.UDisks2VolumeMonitor.service" fi # Library needed to display symbols for keyboard shortcuts # https://github.com/helloSystem/hello/issues/46 wget -c -q "https://github.com/helloSystem/QKeySequenceOverride/releases/download/continuous/libQKeySequenceOverride.so.1.0.0" mv libQKeySequenceOverride.so.1.0.0 "${uzip}/usr/local/lib/" # 'pause' command that does nothing, but never exits # Needed for /usr/local/bin/start-hello cat > /tmp/pause.c <<\EOF #define _POSIX_SOURCE #include int main() { pause(); } EOF clang /tmp/pause.c -o /tmp/pause strip /tmp/pause mv /tmp/pause "${uzip}/usr/local/bin/" # FIXME: Desperate attempt at reducing image size rm -rf "${uzip}"/usr/local/share/icons/breeze* rm -rf "${uzip}"/usr/local/*-portbld-*/ # What is it; is it actually needed? https://forums.freebsd.org/threads/what-is-the-portbld-directory.71759/ # We might want to use empty dummy packages instead of the below; https://dan.langille.org/2021/02/16/preventing-a-given-package-from-being-installed/ # Actually the approach below has the advantage that if a package is installed that requires e.g., Perl, then the Perl package gets installed # since FreeBSD packages seem to depend not just on packages but on the files inside the packages, and the dependency package seemingly gets # installed whenever the file that is needed is missing. Good! chroot ${uzip} sh -c 'for FILE in $(pkg list spidermonkey78) ; do rm $FILE ; done' # Delete the contents of the spidermonkey78 package while keeping the package "installed" chroot ${uzip} sh -c 'for FILE in $(pkg list adwaita-icon-theme) ; do rm $FILE ; done' # Was: rm -rf "${uzip}"/usr/local/share/icons/Adwaita chroot ${uzip} sh -c 'for FILE in $(pkg list kf5-breeze-icons) ; do rm $FILE ; done' # Pulled in by plasma5-kwin? https://github.com/helloSystem/hello/issues/164#issuecomment-861800117 chroot ${uzip} sh -c 'for FILE in $(pkg list plasma5-breeze) ; do rm $FILE ; done' # Pulled in by plasma5-kwin? https://github.com/helloSystem/hello/issues/164#issuecomment-861800117 # chroot ${uzip} sh -c 'for FILE in $(pkg list perl5) ; do rm $FILE ; done' # FIXME: Hardware Probe needs Perl # A more proper way to do this would not require us the unwanted packages in the first place. There should really be a global blacklist of unwanted packages! # * Debian can do: Install the package with '--ignore-depends', then edit /var/lib/dpkg/status to remove unwanted packages, then run 'apt-get -f install' # * Unpack the pkg, remove the dependency, repack the pkg, then install - https://serverfault.com/a/859394 # Remove all .a files; TODO: Create a separate download for those # find ${uzip} -name '*.a' -delete # https://github.com/helloSystem/ISO/issues/213 # Breaks the compiler! # FIXME: Prevent extraneous versions of Python from being installed in the first place # https://github.com/helloSystem/ISO/issues/191#issuecomment-861822967 # Do not fail if a certain python version can't be uninstalled chroot ${uzip} pkg remove -y python310 || true chroot ${uzip} pkg remove -y python38 || true chroot ${uzip} pkg remove -y python37 || true chroot ${uzip} pkg remove -y python36 || true chroot ${uzip} pkg remove -y python27 || true # Amend /etc/os-release by helloSystem specific entries # https://www.freedesktop.org/software/systemd/man/os-release.html if [ -n "${CIRRUS_CHANGE_IN_REPO}" ] ; then SHA=$(echo "${CIRRUS_CHANGE_IN_REPO}" | head -c 7) cat >> "${uzip}/etc/os-release" << ' eof' VARIANT=\"helloSystem\" VARIANT_ID=\"hellosystem\" IMAGE_ID=\"iso\" IMAGE_VERSION="\${BUILDNUMBER}_"${SHA}\" eof fi # chroot "${uzip}" update-desktop-database # Needed? # Add some random data to debug https://github.com/helloSystem/ISO/issues/389 # TODO: Remove this # dd if=/dev/random of="${uzip}"/random.data bs=1M count=2 # hello-0.8.0_0H106-FreeBSD-14.0-amd64.iso WITH the above line uncommented crashes with: # panic: guz_zstd_decompress: Expected 262144 bytes, got 163840 # Create and lock a package that depends on non-automatic packages on the ISO # https://github.com/helloSystem/hello/issues/161#issuecomment-1267976086 chroot "${uzip}" /usr/local/libexec/lock-hellosystem-essential-packages