Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.40.1 #12

Merged
merged 33 commits into from
Jan 16, 2025
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6570985
v0.40.1
VHSgunzo Mar 23, 2024
6d07537
v0.40.1
VHSgunzo Mar 23, 2024
5395936
Update README.md
VHSgunzo Mar 23, 2024
83c9d19
Add RUNTMPDIR and RUNPIDDIR
VHSgunzo Mar 23, 2024
542fcd7
CHANGELOG will be later
VHSgunzo Jun 9, 2024
8d8f6d9
CHANGELOG will be later
VHSgunzo Dec 16, 2024
392a960
CHANGELOG will be later
VHSgunzo Dec 17, 2024
3d9ab89
CHANGELOG will be later
VHSgunzo Dec 18, 2024
df17363
CHANGELOG will be later
VHSgunzo Dec 19, 2024
8381678
CHANGELOG will be later
VHSgunzo Dec 25, 2024
7ce73c9
CHANGELOG will be later
VHSgunzo Dec 27, 2024
feaa336
CHANGELOG will be later
VHSgunzo Dec 28, 2024
100ec72
CHANGELOG will be later
VHSgunzo Dec 29, 2024
5497501
CHANGELOG will be later
VHSgunzo Dec 30, 2024
afa2bd9
CHANGELOG will be later
VHSgunzo Jan 2, 2025
0ed0f14
Update
VHSgunzo Jan 3, 2025
d9eca53
CHANGELOG will be later
VHSgunzo Jan 5, 2025
475561d
CHANGELOG will be later
VHSgunzo Jan 7, 2025
6739fe3
Merge branch 'main' into v0.40.1
VHSgunzo Jan 7, 2025
29f59d1
CHANGELOG will be later
VHSgunzo Jan 8, 2025
cb3dee1
CHANGELOG will be later
VHSgunzo Jan 9, 2025
de4e800
Update
VHSgunzo Jan 11, 2025
a81c0f7
Update CHANGELOG and README
VHSgunzo Jan 11, 2025
1f3ea35
Update
VHSgunzo Jan 14, 2025
be4f6da
Update
VHSgunzo Jan 15, 2025
8739210
Update README
VHSgunzo Jan 16, 2025
fada2a9
Update README
VHSgunzo Jan 16, 2025
1166a40
Update README
VHSgunzo Jan 16, 2025
1ed6f7f
Update
VHSgunzo Jan 16, 2025
9982c78
Update
VHSgunzo Jan 16, 2025
14d3053
Update README
VHSgunzo Jan 16, 2025
6b7c89e
Update README
VHSgunzo Jan 16, 2025
bd7fdc9
Update
VHSgunzo Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CHANGELOG will be later
VHSgunzo committed Dec 17, 2024
commit 392a960020b1c34af0aeaec531ab78339bd108cb
12 changes: 6 additions & 6 deletions runbootstrap → rim-bootstrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
shopt -s extglob

RUNIMAGE_VERSION='v0.39.1'
@@ -21,10 +21,10 @@ if [ ! -x 'RunDir/Run' ]
fi

# download shrinking script
if [ ! -x 'runshrink' ]
if [ ! -x 'rim-shrink' ]
then
curl -LO "https://raw.githubusercontent.com/VHSgunzo/runimage/main/runshrink"
chmod +x runshrink
curl -LO "https://raw.githubusercontent.com/VHSgunzo/runimage/main/rim-shrink"
chmod +x rim-shrink
fi

# create new runimage rootfs
@@ -355,7 +355,7 @@ cp -f ../pacman.conf ./RunDir/rootfs/etc/pacman.conf
./RunDir/Run pac -Rsndd lib32-glibc lib32-fakeroot lib32-fakechroot --noconfirm

# optional for shrink
../runshrink
../rim-shrink

# optional for shrink
rm -rf "${SHRINK_ITEMS[@]}"
@@ -365,5 +365,5 @@ rm -rf ./RunDir/rootfs/{dev,sys,proc,tmp,run}/*
rm -f RunDir/rootfs/etc/pacman.d/gnupg/S.*

# build new runimage
./RunDir/Run rim-build -zstd
./RunDir/Run rim-build
)
File renamed without changes.
1 change: 0 additions & 1 deletion rootfs/usr/bin/desktop-integration

This file was deleted.

1 change: 1 addition & 0 deletions rootfs/usr/bin/rim-build
1 change: 1 addition & 0 deletions rootfs/usr/bin/rim-desktop
1 change: 1 addition & 0 deletions rootfs/usr/bin/rim-dinteg
1 change: 1 addition & 0 deletions rootfs/usr/bin/rim-psmon
1 change: 1 addition & 0 deletions rootfs/usr/bin/rim-update
1 change: 0 additions & 1 deletion rootfs/usr/bin/rpidsmon

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/usr/bin/runbuild

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/usr/bin/rundesktop

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/usr/bin/runupdate

This file was deleted.

1 change: 0 additions & 1 deletion rootfs/usr/bin/transfer

This file was deleted.

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ Target = usr/share/desktop-directories/*
Target = etc/xdg/menus/applications-merged/*

[Action]
Description = Desktop integration remove...
Description = Remove desktop integration...
When = PreTransaction
Exec = /var/RunDir/utils/desktop-integration remove hook
Exec = /var/RunDir/utils/rim-dinteg --remove hook
NeedsTargets
4 changes: 2 additions & 2 deletions rootfs/usr/share/libalpm/hooks/desktop-integration.hook
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ Target = usr/share/desktop-directories/*
Target = etc/xdg/menus/applications-merged/*

[Action]
Description = Desktop integration install...
Description = Add desktop integration...
When = PostTransaction
Exec = /var/RunDir/utils/desktop-integration install hook
Exec = /var/RunDir/utils/rim-dinteg --add hook
NeedsTargets
44 changes: 26 additions & 18 deletions rootfs/var/RunDir/Run.sh
Original file line number Diff line number Diff line change
@@ -1371,7 +1371,7 @@ print_version() {
run_update() {
info_msg "RunImage update"
RIM_ROOT=1 RIM_NO_NVIDIA_CHECK=1 RIM_QUIET_MODE=1 \
bwrun runupdate
bwrun rim-update
UPDATE_STATUS="$?"
if [ "$UPDATE_STATUS" == 0 ]
then
@@ -1533,7 +1533,7 @@ decrypt_rootfs() {
fi
}

run_build() { "$RUNSTATIC/bash" "$RUNUTILS/runbuild" "$@" ; }
run_build() { "$RUNSTATIC/bash" "$RUNUTILS/rim-build" "$@" ; }

check_unshare_tmp() {
if [ "$UNSHARE_TMP" == 1 ]
@@ -1605,7 +1605,7 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
${BLUE}rim-build $YELLOW {build args}$GREEN Build new runimage container
${BLUE}rim-update $YELLOW {build args}$GREEN Update packages and rebuild runimage
${BLUE}rim-kill $GREEN Kill all running runimage containers
${BLUE}rim-procmon$YELLOW {RUNPIDs}$GREEN Monitoring of processes running in runimage containers
${BLUE}rim-psmon$YELLOW {RUNPIDs}$GREEN Monitoring of processes running in runimage containers
${BLUE}rim-exec $YELLOW {RUNPID} {args}$GREEN Attach to a running runimage container or exec command

${RED}Only for not extracted (RunImage runtime options):
@@ -1645,7 +1645,6 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
${YELLOW}RIM_KEEP_OVERFS$GREEN=1 Enables OverlayFS mode with saving after closing runimage
${YELLOW}RIM_OVERFS_ID$GREEN=ID Specifies the OverlayFS ID
${YELLOW}RIM_KEEP_OLD_BUILD$GREEN=1 Creates a backup of the old RunImage when building a new one
${YELLOW}RIM_BUILD_WITH_EXTENSION$GREEN=1 Adds an extension when building (compression method and rootfs type)
${YELLOW}RIM_CMPRS_ALGO$GREEN={zstd|xz|lz4} Specifies the compression algo for runimage build
${YELLOW}RIM_ZSDT_CMPRS_LVL$GREEN={1-22} Specifies the compression ratio of the zstd algo for runimage build
${YELLOW}RIM_SHELL$GREEN=\"shell\" Selects ${YELLOW}\$SHELL$GREEN in runimage
@@ -1744,6 +1743,8 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
${YELLOW}RUNUSER${GREEN}=\"$RUNUSER\"
${GREEN}mksquashfs:
${YELLOW}MKSQFS${GREEN}=\"$MKSQFS\"
${GREEN}mkdwarfs:
${YELLOW}MKDWFS${GREEN}=\"$MKDWFS\"
${GREEN}unsquashfs:
${YELLOW}UNSQFS${GREEN}=\"$UNSQFS\"
${GREEN}unionfs:
@@ -1763,14 +1764,14 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
${YELLOW}pac$GREEN sudo pacman (fake sudo)
${YELLOW}packey$GREEN sudo pacman-key (fake sudo)
${YELLOW}panelipmon$GREEN Shows information about an active network connection
${YELLOW}runbuild$GREEN Starts the runimage build
${YELLOW}rundesktop$GREEN Starts the desktop mode
${YELLOW}rim-build$GREEN Starts the runimage build
${YELLOW}rim-desktop$GREEN Starts the desktop mode
${YELLOW}{xclipsync,xclipfrom}$GREEN For clipboard synchronization in desktop mode
${YELLOW}webm2gif$GREEN Convert webm to gif
${YELLOW}transfer$GREEN Upload file to ${BLUE}https://transfer.sh
${YELLOW}rpidsmon$GREEN For monitoring of processes running in runimage containers
${YELLOW}rim-psmon$GREEN For monitoring of processes running in runimage containers
${YELLOW}hostexec$GREEN For execute commands at the host level (see ${YELLOW}RIM_ENABLE_HOSTEXEC$GREEN)
${YELLOW}runupdate$GREEN For runimage update
${YELLOW}rim-update$GREEN For runimage update

${YELLOW}ls$GREEN='ls --color=auto'
${YELLOW}dir$GREEN='dir --color=auto'
@@ -1848,7 +1849,7 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
then external configs are run if they are found.

${RED}RunImage desktop:${GREEN}
Ability to run RunImage in desktop mode. Default DE: XFCE (see rundesktop)
Ability to run RunImage in desktop mode. Default DE: XFCE (see rim-desktop)
If the launch is carried out from an already running desktop, then Xephyr will start
in windowed/full screen mode (see ${YELLOW}XEPHYR_*$GREEN environment variables)
Use CTRL+SHIFT to grab the keyboard and mouse.
@@ -1877,9 +1878,9 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
This works both externally by passing build args:
$RED┌─[$GREEN$RUNUSER$YELLOW@$BLUE${RUNHOSTNAME}$RED]─[$GREEN$PWD$RED]
$RED└──╼ \$ ${GREEN}runimage ${BLUE}rim-build ${YELLOW}{build args}${GREEN}
And it also works inside the running instance (see runbuild):
And it also works inside the running instance (see rim-build):
$RED┌─[$GREEN$RUNUSER$YELLOW@$BLUE${RUNHOSTNAME}$RED]─[$GREEN$PWD$RED] - in runimage
$RED└──╼ \$ ${GREEN}runbuild ${YELLOW}{build args}${GREEN}
$RED└──╼ \$ ${GREEN}rim-build ${YELLOW}{build args}${GREEN}
Optionally, you can specify the following build arguments:
${YELLOW}{/path/new_runimage_name} {-zstd|-xz|-lz4} {zstd compression level 1-19}${GREEN}
By default, runimage is created in the current directory with a standard name and
@@ -1889,7 +1890,7 @@ ${GREEN}RunImage ${RED}v${RUNIMAGE_VERSION} ${GREEN}by $DEVELOPERS
${RED}RunImage update:${GREEN}
Allows you to update packages and rebuild RunImage. In unpacked form, automatic build will
not be performed. When running an update, you can also pass arguments for a new build.
(see RunImage build) (also see runupdate)
(see RunImage build) (also see rim-update)
$RED┌─[$GREEN$RUNUSER$YELLOW@$BLUE${RUNHOSTNAME}$RED]─[$GREEN$PWD$RED]
$RED└──╼ \$ ${GREEN}runimage ${BLUE}rim-update ${YELLOW}{build args}${GREEN}
By default, update and rebuild is performed in ${YELLOW}\$RUNIMAGEDIR${GREEN}
@@ -2036,8 +2037,6 @@ if [ "$RIM_CONFIG" != 0 ]
set +a
info_msg "Found RunImage config: '$RIM_CONFIG'"
fi
else
warn_msg "RunImage config is disabled!"
fi

export RUNCACHEDIR="${RIM_CACHEDIR:=$RUNIMAGEDIR/cache}"
@@ -2062,7 +2061,7 @@ case "$1" in
rim-portfw ) if [ "$RIM_RUN_IN_ONE" != 1 ]
then shift ; run_attach portfw "$@" ; exit $?
fi ;;
rim-procmon ) set_default_option ; RIM_TMP_HOME=1
rim-psmon ) set_default_option ; RIM_TMP_HOME=1
RIM_UNSHARE_PIDS=0 ; RIM_CONFIG=0
export SSRV_SOCK="unix:$RUNPIDDIR/rmp"
RIM_NO_RPIDSMON=1 ; RIM_QUIET_MODE=1 ;;
@@ -2254,7 +2253,8 @@ fi
[ "$RIM_SYS_TOOLS" == 1 ] && \
export RIM_SYS_MKSQFS=1 RIM_SYS_UNSQFS=1 \
RIM_SYS_SQFUSE=1 RIM_SYS_BUWRAP=1 \
RIM_SYS_UNIONFS=1 RIM_SYS_SLIRP=1
RIM_SYS_UNIONFS=1 RIM_SYS_SLIRP=1 \
RIM_SYS_MKDWFS=1

if [ "$RIM_SYS_MKSQFS" == 1 ] && is_sys_exe mksquashfs
then
@@ -2272,6 +2272,14 @@ if [ "$RIM_SYS_UNSQFS" == 1 ] && is_sys_exe unsquashfs
export UNSQFS="$RUNSTATIC/unsquashfs"
fi

if [ "$RIM_SYS_MKDWFS" == 1 ] && is_sys_exe mkdwarfs
then
info_msg "The system mkdwarfs is used!"
export MKDWFS="$(which_sys_exe mkdwarfs)"
else
export MKDWFS="$RUNSTATIC/mkdwarfs"
fi

if [ "$RIM_SYS_SLIRP" == 1 ] && is_sys_exe slirp4netns
then
info_msg "The system slirp4netns is used!"
@@ -3108,9 +3116,9 @@ case "$1" in
rim-ofsls ) overlayfs_list ;;
rim-update ) shift ; run_update "$@" ;;
rim-ofsrm ) shift ; overlayfs_rm "$@" ;;
rim-desktop ) bwrun rundesktop ;;
rim-desktop ) bwrun rim-desktop ;;
rim-shell ) shift ; bwrun "${RIM_SHELL[@]}" "$@" ;;
rim-procmon ) shift ; bwrun rpidsmon "$@" ;;
rim-psmon ) shift ; bwrun rim-psmon "$@" ;;
rim-build ) shift ; run_build "$@" ;;
*)
if [ -n "$RIM_AUTORUN" ]
Empty file added rootfs/var/RunDir/config/.keep
Empty file.
7 changes: 0 additions & 7 deletions rootfs/var/RunDir/config/rpidsmon.rcfg

This file was deleted.

5 changes: 0 additions & 5 deletions rootfs/var/RunDir/config/runbuild.rcfg

This file was deleted.

10 changes: 0 additions & 10 deletions rootfs/var/RunDir/config/runupdate.rcfg

This file was deleted.

2 changes: 0 additions & 2 deletions rootfs/var/RunDir/config/stable-diffusion.rcfg

This file was deleted.

3 changes: 0 additions & 3 deletions rootfs/var/RunDir/config/sw_runtime.rcfg

This file was deleted.

2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/cip
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/bash
#!/usr/bin/env bash
curl -s ifconfig.io 2>/dev/null
2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/dbus-flmgr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

dbus-filemgr() {
dbus-send --session --dest=org.freedesktop.FileManager1 \
15 changes: 6 additions & 9 deletions rootfs/var/RunDir/utils/hostexec
Original file line number Diff line number Diff line change
@@ -80,16 +80,13 @@ set_supassapp() {
}

print_help() {
RUNHOSTNAME="$(uname -a|awk '{print$2}')"
echo -e "
${RED}Usage:
$RED┌──[$GREEN$RUNUSER$YELLOW@$BLUE${RUNHOSTNAME}$RED]─[$GREEN$PWD$RED]
$RED└──╼ \$$GREEN ${0}${BLUE} {args} $GREEN{executable} $YELLOW{executable args}
echo -e "[ Usage ]: hostexec [OPTIONS] {executable} {executable args}

${BLUE}--help ${RED}|${BLUE}-h$GREEN Show this usage info
${BLUE}--superuser ${RED}|${BLUE}-su$GREEN $YELLOW{args}$GREEN Execute command as superuser
${BLUE}--terminal ${RED}|${BLUE}-t$GREEN $YELLOW{args}$GREEN Execute command in host terminal
"
[ Options ]:
-su, --superuser {args} Execute command as superuser
-t, --terminal {args} Execute command in host terminal
-h, --help Show this message"
exit 1
}

if [ -e "$RIM_HEXEC_SOCK" ]
4 changes: 2 additions & 2 deletions rootfs/var/RunDir/utils/nocap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/bash
# Use this to disable capabilities for run steam or another bubblewrap, if you don't disable capabilities by NO_CAP=1
#!/usr/bin/env bash
# Use this to disable capabilities for run steam or another bubblewrap, if you don't disable capabilities by RIM_NO_CAP=1
# $ nocap steam
# See https://github.com/containers/bubblewrap/issues/380
# And https://github.com/containers/bubblewrap/issues/397
2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/pac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
if [ "$EUID" != 0 ]
then sudo /usr/bin/pacman "$@"
else /usr/bin/pacman "$@"
2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/packey
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
if [ "$EUID" != 0 ]
then sudo /usr/bin/pacman-key "$@"
else /usr/bin/pacman-key "$@"
2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/panelipmon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
unset TOR_IP TORIP
TOR_IP="$(proxychains -q curl 2ip.ru 2>/dev/null)"
NET_DEV="$(ip route show default|awk '{print$5}'|head -1)"
290 changes: 290 additions & 0 deletions rootfs/var/RunDir/utils/rim-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
#!/usr/bin/env bash

RED='\033[1;91m'
BLUE='\033[1;94m'
GREEN='\033[1;92m'
YELLOW='\033[1;33m'
RESETCOLOR='\033[1;00m'

BUILDKEY="$BASHPID"
EXEPT_RUNSRCNAMES=("Run" "runbuild" "rundesktop" "runupdate" "rpidsmon")

[ -f "$RIMENVFL" ] && \
source "$RIMENVFL"

nocolor() { sed -r 's|\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]||g' ; }

error_msg() {
echo -e "${RED}[ ERROR ][$(date +"%Y.%m.%d %T")]: $@ $RESETCOLOR"
if [ "$NOT_TERM" == 1 ]
then notify-send -a 'RunImage Error' "$(echo -e "$@"|nocolor)" 2>/dev/null &
fi
}

info_msg() {
if [ "$RIM_QUIET_MODE" != 1 ]
then echo -e "${GREEN}[ INFO ][$(date +"%Y.%m.%d %T")]: $@ $RESETCOLOR"
if [[ "$NOT_TERM" == 1 && "$RIM_DONT_NOTIFY" != 1 ]]
then notify-send -a 'RunImage Info' "$(echo -e "$@"|nocolor)" 2>/dev/null &
fi
fi
}

warn_msg() {
if [[ "$RIM_QUIET_MODE" != 1 && "$RIM_NO_WARN" != 1 ]]
then echo -e "${YELLOW}[ WARNING ][$(date +"%Y.%m.%d %T")]: $@ $RESETCOLOR"
if [[ "$NOT_TERM" == 1 && "$RIM_DONT_NOTIFY" != 1 ]]
then notify-send -a 'RunImage Warning' "$(echo -e "$@"|nocolor)" 2>/dev/null &
fi
fi
}

empty_msg() {
error_msg "${YELLOW}Option ${BLUE}$1 ${YELLOW}requires a non-empty argument!\n"
print_help
}

print_help() {
echo -e "[ Usage ]: runbuild [OPTIONS] /path/runimage
[ Options ]:
-b, --bsize '1M|20' Set block size (env: RIM_CMPRS_BSIZE=1M)
-c, --clvl '1-22' Set compression level (env: RIM_CMPRS_LVL=1)
-d, --dwfs Use DwarFS file system (env: RIM_CMPRS_FS=dwfs)
-l, --lz4 Use lz4 compression (env: RIM_CMPRS_ALGO=lz4)
-h, --help Show this message
-s, --sqfs Use SquashFS file system (env: RIM_CMPRS_FS=sqfs)
-x, --xz Use xz (lzma for DwarFS) compression (env: RIM_CMPRS_ALGO=xz)
-z, --zstd Use zstd compression (env: RIM_CMPRS_ALGO=zstd)"
exit 1
}

[ ! -n "$(tty|grep -v 'not a'|grep -Eo 'tty|pts')" ] && \
NOT_TERM=1

if [ ! -x "$RUNRUNTIME" ]
then
error_msg "RunImage runtime not found!"
exit 1
fi

RIM_CMPRS_FS="${RIM_CMPRS_FS:=sqfs}"
RIM_CMPRS_ALGO="${RIM_CMPRS_ALGO:=zstd}"
RIM_CMPRS_LVL="${RIM_CMPRS_LVL:=1}"

unset RUNBASENAME
while [[ $# -gt 0 ]]
do
case "$1" in
-h|--help ) print_help ;;
-z|--zstd ) RIM_CMPRS_ALGO='zstd' ;;
-x|--xz ) RIM_CMPRS_ALGO='xz' ;;
-l|--lz4 ) RIM_CMPRS_ALGO='lz4' ;;
-s|--sqfs ) RIM_CMPRS_FS='sqfs' ;;
-d|--dwfs ) RIM_CMPRS_FS='dwfs' ;;
-c|--clvl )
if [[ -n "$2" && "$2" != -* ]]
then RIM_CMPRS_LVL="$2"; shift
else empty_msg "$1"
fi ;;
-b|--bsize)
if [[ -n "$2" && "$2" != -* ]]
then RIM_CMPRS_BSIZE="$2"; shift
else empty_msg "$1"
fi ;;
-*) error_msg "Unknown parameter: ${BLUE}$1\n"; print_help ;;
*)
if [ -d "$(dirname "$1" 2>/dev/null)" ]
then
if [ -d "$1" ]
then
if [[ "${EXEPT_RUNSRCNAMES[@]}" =~ "$RUNSRCNAME" ]]
then RUNBASENAME="$1/runimage"
else RUNBASENAME="$1/$RUNSRCNAME"
fi
else RUNBASENAME="$1"
fi
else
error_msg "The build directory does not exist!"
exit 1
fi ;;
esac
shift
done

info_msg "RunImage build"

if [ ! -n "$RUNBASENAME" ]
then
if [[ "${EXEPT_RUNSRCNAMES[@]}" =~ "$RUNSRCNAME" ]]
then RUNBASENAME="runimage"
else RUNBASENAME="$RUNSRCNAME"
fi
fi

NEWRUNIMAGE="$(realpath "$RUNBASENAME").new$BUILDKEY"
OLDRUNIMAGE="${NEWRUNIMAGE%.new$BUILDKEY}"
[[ -f "$NEWRUNIMAGE" || -d "$NEWRUNIMAGE" || -L "$NEWRUNIMAGE" ]] && \
rm -rf "$NEWRUNIMAGE"

[ -d "$OVERFS_MNT" ] && \
RUNDIR="$OVERFS_MNT"

CMPRS_CMD=()
case "$RIM_CMPRS_FS" in
sqfs)
RUNOFFSET="${RUNOFFSET:="$("$RUNRUNTIME" --runtime-offset)"}"
[ ! -x "$MKSQFS" ] && \
MKSQFS="$RUNSTATIC/mksquashfs"
CMPRS_CMD+=(
"$MKSQFS" "$RUNDIR" "$NEWRUNIMAGE" -root-owned -offset "$RUNOFFSET"
-no-recovery -no-xattrs -noappend -mkfs-time 0
-action "prune @ type(c) || type(s) || type(b) || type(p)" -b
)
info_msg "Compression file system: SquashFS"
;;
dwfs)
trap "rm -f '$NEWRUNIMAGE'" INT TERM
[ ! -x "$MKDWFS" ] && \
MKDWFS="$RUNSTATIC/mkdwarfs"
CMPRS_CMD+=(
"$MKDWFS" -f --set-owner 0 --set-group 0 --no-history --log-level error
--no-create-timestamp --header "$RUNRUNTIME"
--chmod=o+r # FIXME https://github.com/mhx/dwarfs/discussions/244#discussioncomment-11593534
-i "$RUNDIR" -o "$NEWRUNIMAGE" -B16 --compression
)
info_msg "Compression file system: DwarFS"
;;
*) error_msg "Invalid compression file system: $RIM_CMPRS_FS"; print_help ;;
esac

case "$RIM_CMPRS_ALGO" in
zstd)
info_msg "Compression algorithm: zstd"
info_msg "Compression level: $RIM_CMPRS_LVL"
if [ "$RIM_CMPRS_FS" == 'sqfs' ]
then
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=128K}"
CMPRS_CMD+=("$RIM_CMPRS_BSIZE" -comp zstd -Xcompression-level "$RIM_CMPRS_LVL")
else
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=18}"
CMPRS_CMD+=(zstd:level="$RIM_CMPRS_LVL" -S"$RIM_CMPRS_BSIZE")
fi
;;
lz4)
info_msg "Compression algorithm: lz4"
if [ "$RIM_CMPRS_FS" == 'sqfs' ]
then
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=256K}"
CMPRS_CMD+=("$RIM_CMPRS_BSIZE" -comp lz4 -Xhc)
else
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=20}"
CMPRS_CMD+=(lz4hc:level="$RIM_CMPRS_LVL" -S"$RIM_CMPRS_BSIZE")
info_msg "Compression level: $RIM_CMPRS_LVL"
fi
;;
xz)
if [ "$RIM_CMPRS_FS" == 'sqfs' ]
then
info_msg "Compression algorithm: xz"
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=1M}"
CMPRS_CMD+=("$RIM_CMPRS_BSIZE" -comp xz -Xdict-size 100%)
else
info_msg "Compression algorithm: lzma"
RIM_CMPRS_BSIZE="${RIM_CMPRS_BSIZE:=24}"
CMPRS_CMD+=(lzma -S"$RIM_CMPRS_BSIZE")
fi
;;
*) error_msg "Invalid compression algorithm: $RIM_CMPRS_ALGO"; print_help ;;
esac
info_msg "Compression block size: $RIM_CMPRS_BSIZE"

[[ "$INSIDE_RUNIMAGE" == 1 && ! -d "$RUNROOTFS" ]] && \
RUNROOTFS='/'

unset IS_PACLOCKFL IS_DECFSFL
DECFSFL="$RUNROOTFS/.decfs"
PACLOCKFL="$RUNROOTFS/var/lib/pacman/db.lck"
if [ -w "$RUNROOTFS" ]
then
info_msg "Updating build timestamp..."
date '+%y.%m.%d.%H%M%S' > "$RUNROOTFS/.build"
info_msg "Cleanup rootfs..."
find "$RUNROOTFS/var/log/" -type f -name '*.log' -exec rm -f {} \; 2>/dev/null
rm -rf "$RUNROOTFS/var/tmp"/*
if [ -f "$PACLOCKFL" ]
then
IS_PACLOCKFL=1
rm -f "$PACLOCKFL"
fi
if [ -f "$DECFSFL" ]
then
IS_DECFSFL=1
rm -f "$DECFSFL"
fi
rm -rf "$RUNROOTFS/var/lib/pacman/sync"/*
rm -rf "$RUNROOTFS/var/cache/pacman/pkg"/*
rm -rf "$RUNROOTFS/var/cache/apt/archives"/*.deb
rm -rf "$RUNROOTFS/var/cache/apt"/*.bin
rm -rf "$RUNROOTFS/var/lib/apt/lists"/deb.*
rm -rf "$RUNROOTFS/var/log/apt"/*
rm -rf "$RUNROOTFS/var/cache/apk"/*
rm -rf "$RUNROOTFS/var/cache/xbps/"/*
else
warn_msg "Unable to update build timestamp. Read-only!"
warn_msg "Unable to cleanup rootfs. Read-only!"
fi

info_msg "Creating new RunImage..."
info_msg "Path: '$OLDRUNIMAGE'"
"${CMPRS_CMD[@]}"
cmprs_stat=$?

[ "$IS_PACLOCKFL" == 1 ] && \
touch "$PACLOCKFL"
[ "$IS_DECFSFL" == 1 ] && \
touch "$DECFSFL"

if [[ "$cmprs_stat" == 0 && -f "$NEWRUNIMAGE" ]]
then
if [ "$RIM_CMPRS_FS" == 'sqfs' ]
then
info_msg "Embedding RunImage runtime..."
if ! dd if="$RUNRUNTIME" bs="$RUNOFFSET" count=1 of="$NEWRUNIMAGE" conv=notrunc &>/dev/null
then
error_msg "Failed to embed RunImage runtime!"
rm -f "$NEWRUNIMAGE"
exit 1
fi
fi
info_msg "Marking RunImage as executable..."
if ! chmod +x "$NEWRUNIMAGE"
then
error_msg "Failed to mark RunImage as executable!"
exit 1
fi
if [ -f "$OLDRUNIMAGE" ]
then
if [ "$RIM_KEEP_OLD_BUILD" == 1 ]
then
info_msg "Saving old RunImage: '${OLDRUNIMAGE}.old'"
mv -f "${OLDRUNIMAGE}" "${OLDRUNIMAGE}.old"
else
info_msg "Removing old RunImage..."
rm -f "$OLDRUNIMAGE"
[ -f "${OLDRUNIMAGE}.old" ] && \
rm -f "${OLDRUNIMAGE}.old"
fi
fi
if ! mv -f "$NEWRUNIMAGE" "$OLDRUNIMAGE"
then
error_msg "Failed to rename new RunImage: [$NEWRUNIMAGE] -> [$OLDRUNIMAGE]"
exit 1
fi
RUNIMAGESIZE=($(du -sm "$OLDRUNIMAGE"))
info_msg "The build is complete!"
info_msg "Final size: $RUNIMAGESIZE MB"
else
error_msg "The build failed!"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/bash
#!/usr/bin/env bash

unset RUN_X
RED='\033[1;91m'
BLUE='\033[1;94m'
GREEN='\033[1;92m'
YELLOW='\033[1;33m'
RESETCOLOR='\033[1;00m'

DESKTOP_DISPLAY=1337
export GDK_BACKEND="x11"
export DESKTOP_KEY="$BASHPID"
@@ -95,6 +95,7 @@ while true
DESKTOP_DISPLAY="$(( $DESKTOP_DISPLAY + 1 ))"
done

unset RUN_X
if [[ "$RUNTTY" =~ "tty" ]]
then
export DISPLAY=:$DESKTOP_DISPLAY
@@ -139,7 +140,7 @@ if [[ "$XEPHYR" == 1 || "$RIM_XEPHYR_FULLSCREEN" == 1 ]] || \
info_msg "Xephyr screen resolution: $RIM_XEPHYR_SIZE"
fi
Xephyr $([ "$RIM_XEPHYR_FULLSCREEN" == 1 ] && echo "-fullscreen"||echo "-screen $RIM_XEPHYR_SIZE") \
-resizeable +extension GLX -br -title "RunImage Desktop [$RIM_XEPHYR_DISPLAY]" \
-resizeable -br -title "RunImage Desktop [$RIM_XEPHYR_DISPLAY]" \
-once -ac -name 'RunImage' $RIM_XEPHYR_DISPLAY &>/dev/null &
XEPHYR_PID="$!"
sleep 0.01
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/bash
#!/usr/bin/env bash

RED='\033[1;91m'
BLUE='\033[1;94m'
GREEN='\033[1;92m'
YELLOW='\033[1;33m'
RESETCOLOR='\033[1;00m'

HINTEG_DIR="$HOME/.local/share"
HINTEG_APPS_DIR="$HINTEG_DIR/applications"
@@ -37,15 +43,33 @@ MIME_DIRS=(
'/usr/share/mime/x-epoc'
)

nocolor() { sed -r 's|\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]||g' ; }

error_msg() {
echo -e "${RED}[ ERROR ][$(date +"%Y.%m.%d %T")]: $@ $RESETCOLOR"
if [ "$NOT_TERM" == 1 ]
then notify-send -a 'RunImage Error' "$(echo -e "$@"|nocolor)" 2>/dev/null &
fi
}

info_msg() {
if [ "$RIM_QUIET_MODE" != 1 ]
then echo -e "${GREEN}[ INFO ][$(date +"%Y.%m.%d %T")]: $@ $RESETCOLOR"
if [[ "$NOT_TERM" == 1 && "$RIM_DONT_NOTIFY" != 1 ]]
then notify-send -a 'RunImage Info' "$(echo -e "$@"|nocolor)" 2>/dev/null &
fi
fi
}

lsapps() {
local apps="$(grep -m1 '^Name=' -nr "$APPS_DIR" 2>/dev/null|\
sed 's|.*:Name=||g;s|.*|"&"|g'|sort)"
sed 's|.*:Name=||g;s|.*|"&"|g'|sort -u)"
[ -n "$apps" ] && cat -n<<<"$apps"
}

lsintegapps() {
local apps="$(grep -m1 '^Name=.* \[RunImage\]' -nr "$HINTEG_APPS_DIR"/*-rimg.desktop 2>/dev/null|\
sed 's|.*:Name=||g;s| \[RunImage\]$||g;s|.*|"&"|g'|sort)"
local apps="$(grep -m1 '^Name=.* \[RunImage\]' -nr "$HINTEG_APPS_DIR"/*-rim.desktop 2>/dev/null|\
sed 's|.*:Name=||g;s| \[RunImage\]$||g;s|.*|"&"|g'|sort -u)"
[ -n "$apps" ] && cat -n<<<"$apps"
}

@@ -66,14 +90,14 @@ dinteg() {
then
unset postfix postfix_dir target exec_args
target="$(awk -F/ '{print$4}'<<<"$file")"
postfix="$(cut -d'/' -f4-<<<"$file"|sed 's|.desktop$|-rimg.desktop|i;s|.png$|-rimg.png|i;s|.svg$|-rimg.svg|i;s|.xml$|-rimg.xml|i')"
postfix="$(cut -d'/' -f4-<<<"$file"|sed 's|.desktop$|-rim.desktop|i;s|.png$|-rim.png|i;s|.svg$|-rim.svg|i;s|.xml$|-rim.xml|i')"
postfix_dir="$(dirname "$postfix")"
[ "$target" == 'menus' ] && \
HINTEG_DIR="$HOME/.config"
hinteg_file="${HINTEG_DIR}/${postfix}"
hinteg_file_dir="${HINTEG_DIR}/${postfix_dir}"
case "$act" in
i)
a)
mkdir $verb -p "$hinteg_file_dir"
cp $verb -f "$file" "$hinteg_file"

@@ -82,14 +106,10 @@ dinteg() {
exec_args="env "
[ -n "$RIM_OVERFS_ID" ] && \
exec_args+="RIM_OVERFS_ID='$RIM_OVERFS_ID' "
#if [[ "$RUNSRCNAME" == "Run"* || \
# "$RUNSRCNAME" == "runimage"* ]]
# then exec_args+="'$RUNSRC' "
#fi
exec_args+="'$RUNSRC' "

sed -i "s|^Icon.*|&-rimg|g;s|^Name.*|& [RunImage]|g;s|^Exec=|Exec=$exec_args|g;/^TryExec/d" "$hinteg_file"
chmod +x "$hinteg_file"
sed -i "s|^Icon.*|&-rim|g;s|^Name.*|& [RunImage]|g;s|^Exec=|Exec=$exec_args|g;/^TryExec/d" "$hinteg_file"
chmod $verb +x "$hinteg_file"
fi
;;
r)
@@ -102,28 +122,47 @@ dinteg() {
done
}

unset act ret
case "$1" in
list|ls|l) shift
ret=1
case "$1" in
install|in|i) lsintegapps ;;
*) lsapps ;;
esac
if [ "$?" == 0 ]
then ret=0
else echo "No apps found!"
fi
exit $ret
;;
install|in|i) shift ; act=i ;;
remove|rm|r) shift ; act=r ;;
*) echo "Unknown argument!" ; exit 1 ;;
esac
print_help() {
echo -e "[ Usage ]: desktop-integration [OPTIONS] {apps}
[ Options ]:
-a, --add [num|name|all|mime] Add applications to apps menu
-h, --help Show this message
-l, --list [a|added] List applications
-m, --mime With MIME types (env: RIM_DINTEG_WITH_MIME=1)
-v, --verbose Verbose output
-r, --remove [num|name|all|mime] Remove applications from apps menu"
exit 1
}

unset act ret verb
while [[ $# -gt 0 ]]
do
case "$1" in
-m|--mime ) shift ; RIM_DINTEG_WITH_MIME=1 ;;
-v|--verbose) shift ; verb='-v' ;;
-a|--add ) shift ; act=a ;;
-r|--remove ) shift ; act=r ;;
-h|--help ) print_help ;;
-l|--list ) shift
ret=1
case "$1" in
a|added) lsintegapps ;;
*) lsapps ;;
esac
if [ "$?" == 0 ]
then ret=0
else error_msg "No apps found!"
fi
exit $ret
;;
-*) error_msg "Unknown parameter: ${BLUE}$1\n"; print_help ;;
*) break ;;
esac
done

if [ -n "$1" ]
then
verb='-v'
case "$1" in
hook) shift
unset verb
@@ -145,7 +184,7 @@ if [ -n "$1" ]
;;
*) IFS=$'\n'
app_list="$(case "$act" in
i) lsapps ;;
a) lsapps ;;
r) lsintegapps ;;
esac)"
for app in "$@"
@@ -157,18 +196,22 @@ if [ -n "$1" ]
integ_files=("$(grep -wm1 "^Name=$app_name$" -lr "$APPS_DIR" 2>/dev/null|head -1)")
if [ -n "$integ_files" ]
then
echo "[ $app_name ]:"
case "$act" in
a) act_info='Add' ;;
r) act_info='Remove' ;;
esac
info_msg "$act_info app: $app_name"
icon_name="$(grep -m1 "^Icon=" "$integ_files" 2>/dev/null|sed 's|^Icon=||')"
integ_files+=($(find_fl "$ICONS_DIR" -name "${icon_name}.*" 2>/dev/null))
for file in "${integ_files[@]}";do echo "$file";done|dinteg
else
echo "The app was not found!"
error_msg "The app was not found: $([ "$app_name" ] && echo "$app_name"||echo "$app")"
exit 1
fi)
done
;;
esac
else
echo "Specify the name or number of the app!"
error_msg "Specify the name or number of the app!"
exit 1
fi
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

is_exe_exist() { command -v "$@" &>/dev/null ; }

207 changes: 0 additions & 207 deletions rootfs/var/RunDir/utils/runbuild

This file was deleted.

2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/webm2gif
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

ffmpeg -y -i "$1" -vf palettegen _tmp_palette.png
ffmpeg -y -i "$1" -i _tmp_palette.png -filter_complex paletteuse -r 10 "${1%.webm}.gif"
2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/xclipfrom
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/wish
#!/usr/bin/env wish

wm withdraw .

2 changes: 1 addition & 1 deletion rootfs/var/RunDir/utils/xclipsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

if [[ -z "$DISPLAY" || -z "$SYS_DISPLAY" ]]
then