From f14bd215486deacfeddea081ba0986019b3b0b9b Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Fri, 5 May 2023 22:30:33 +0900 Subject: [PATCH] esh: Migrate shell to /bin/esh --- apps/{sh.c => esh.c} | 0 apps/reload_desktop.sh | 2 +- apps/set-wallpaper.sh | 2 +- apps/sysinfo.c | 2 +- base/etc/master.passwd | 6 +++--- base/etc/passwd | 6 +++--- base/etc/startup.d/00_startuplog.sh | 2 +- base/etc/startup.d/01_migrate.sh | 2 +- base/etc/startup.d/02_hostname.sh | 2 +- base/etc/startup.d/03_tmpfs.sh | 2 +- base/etc/startup.d/04_modprobe.sh | 2 +- base/etc/startup.d/05_mountcd.sh | 2 +- base/etc/startup.d/40_dhcp.sh | 2 +- base/etc/startup.d/50_msk.sh | 2 +- base/etc/startup.d/99_runstart.sh | 2 +- base/home/local/.yutanirc | 2 +- util/createramdisk.py | 7 +++++++ 17 files changed, 26 insertions(+), 19 deletions(-) rename apps/{sh.c => esh.c} (100%) diff --git a/apps/sh.c b/apps/esh.c similarity index 100% rename from apps/sh.c rename to apps/esh.c diff --git a/apps/reload_desktop.sh b/apps/reload_desktop.sh index 55e30850..d4b113db 100644 --- a/apps/reload_desktop.sh +++ b/apps/reload_desktop.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh export-cmd DESKTOP cat /var/run/.wallpaper.pid diff --git a/apps/set-wallpaper.sh b/apps/set-wallpaper.sh index bd9da22e..cba0a54b 100644 --- a/apps/set-wallpaper.sh +++ b/apps/set-wallpaper.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh if empty? "$1" then exec sh -c "echo 'usage: $0 WALLPAPER'" if not stat -Lq "$1" then exec sh -c "echo '$0: $1 does not exist'" diff --git a/apps/sysinfo.c b/apps/sysinfo.c index 91fcd3af..b3acd4e4 100644 --- a/apps/sysinfo.c +++ b/apps/sysinfo.c @@ -96,7 +96,7 @@ int main(int argc, char * argv[]) { prog_lines[i] = "msk count"; sprintf(data_lines[i++], C_A "Packages: " C_O); - prog_lines[i] = "sh -v"; + prog_lines[i] = "esh -v"; sprintf(data_lines[i++], C_A "Shell: " C_O); prog_lines[i] = "yutani-query resolution"; diff --git a/base/etc/master.passwd b/base/etc/master.passwd index 7496724b..99de36ad 100644 --- a/base/etc/master.passwd +++ b/base/etc/master.passwd @@ -1,3 +1,3 @@ -root:toor:0:0:Administrator:/home/root:/bin/sh:fancy -local:local:1000:1000:Local User:/home/local:/bin/sh:fancy -guest:guest:1001:1001:Guest User:/home/guest:/bin/sh:fancy +root:toor:0:0:Administrator:/home/root:/bin/esh:fancy +local:local:1000:1000:Local User:/home/local:/bin/esh:fancy +guest:guest:1001:1001:Guest User:/home/guest:/bin/esh:fancy diff --git a/base/etc/passwd b/base/etc/passwd index dbb9b56a..4c0f02fe 100644 --- a/base/etc/passwd +++ b/base/etc/passwd @@ -1,5 +1,5 @@ -root:x:0:0:Administrator:/home/root:/bin/sh:fancy +root:x:0:0:Administrator:/home/root:/bin/esh:fancy adm:x:1:1:Administrators:/tmp:/bin/false:nope dialout:x:2:2:Serial Users:/tmp:/bin/false:nope -local:x:1000:1000:Local User:/home/local:/bin/sh:fancy -guest:x:1001:1001:Guest User:/home/guest:/bin/sh:fancy +local:x:1000:1000:Local User:/home/local:/bin/esh:fancy +guest:x:1001:1001:Guest User:/home/guest:/bin/esh:fancy diff --git a/base/etc/startup.d/00_startuplog.sh b/base/etc/startup.d/00_startuplog.sh index 32af7d94..8b731db3 100755 --- a/base/etc/startup.d/00_startuplog.sh +++ b/base/etc/startup.d/00_startuplog.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh # This daemonizes exec splash-log diff --git a/base/etc/startup.d/01_migrate.sh b/base/etc/startup.d/01_migrate.sh index 7c6b1942..c21497e2 100755 --- a/base/etc/startup.d/01_migrate.sh +++ b/base/etc/startup.d/01_migrate.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh if not kcmdline -q migrate then exit 0 diff --git a/base/etc/startup.d/02_hostname.sh b/base/etc/startup.d/02_hostname.sh index da7f5243..174e0231 100755 --- a/base/etc/startup.d/02_hostname.sh +++ b/base/etc/startup.d/02_hostname.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh export-cmd HOSTNAME cat /etc/hostname diff --git a/base/etc/startup.d/03_tmpfs.sh b/base/etc/startup.d/03_tmpfs.sh index 8d94769b..f40f6f90 100755 --- a/base/etc/startup.d/03_tmpfs.sh +++ b/base/etc/startup.d/03_tmpfs.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh echo -n "Mounting tmpfs..." > /dev/pex/splash mount tmpfs tmp,777 /tmp diff --git a/base/etc/startup.d/04_modprobe.sh b/base/etc/startup.d/04_modprobe.sh index 28c44413..28ec9eb8 100755 --- a/base/etc/startup.d/04_modprobe.sh +++ b/base/etc/startup.d/04_modprobe.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh echo -n "Installing device driver modules..." > /dev/pex/splash diff --git a/base/etc/startup.d/05_mountcd.sh b/base/etc/startup.d/05_mountcd.sh index 41057b01..e8de7b69 100755 --- a/base/etc/startup.d/05_mountcd.sh +++ b/base/etc/startup.d/05_mountcd.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh if not stat -Lq /dev/cdrom0 then exit 0 diff --git a/base/etc/startup.d/40_dhcp.sh b/base/etc/startup.d/40_dhcp.sh index 0bb22a18..99c3b219 100755 --- a/base/etc/startup.d/40_dhcp.sh +++ b/base/etc/startup.d/40_dhcp.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh if kcmdline -q no-startup-dhcp then exit 0 diff --git a/base/etc/startup.d/50_msk.sh b/base/etc/startup.d/50_msk.sh index 01ddd20b..fac80e8d 100755 --- a/base/etc/startup.d/50_msk.sh +++ b/base/etc/startup.d/50_msk.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh if kcmdline -q no-startup-msk then exit 0 diff --git a/base/etc/startup.d/99_runstart.sh b/base/etc/startup.d/99_runstart.sh index cee25215..753bff6c 100755 --- a/base/etc/startup.d/99_runstart.sh +++ b/base/etc/startup.d/99_runstart.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh export-cmd START kcmdline -g start diff --git a/base/home/local/.yutanirc b/base/home/local/.yutanirc index c7264204..503dfa5e 100755 --- a/base/home/local/.yutanirc +++ b/base/home/local/.yutanirc @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/esh # Start wallpaper cd ~/Desktop diff --git a/util/createramdisk.py b/util/createramdisk.py index 6cc936ea..6768f3dd 100644 --- a/util/createramdisk.py +++ b/util/createramdisk.py @@ -48,6 +48,12 @@ def file_filter(tarinfo): return tarinfo +def symlink(file,target): + ti = tarfile.TarInfo(file) + ti.type = tarfile.SYMTYPE + ti.linkname = target + return ti + with tarfile.open('ramdisk.igz','w:gz') as ramdisk: ramdisk.add('base',arcname='/',filter=file_filter) @@ -63,5 +69,6 @@ with tarfile.open('ramdisk.igz','w:gz') as ramdisk: ramdisk.add('tags',arcname='/src/tags',filter=file_filter) ramdisk.add('util/auto-dep.krk',arcname='/bin/auto-dep.krk',filter=file_filter) ramdisk.add('kuroko/src/kuroko',arcname='/usr/include/kuroko',filter=file_filter) + ramdisk.addfile(symlink('bin/sh','esh'))