patching sh with mksh
#1
patching sh with mksh
I have been fiddling with building mksh as a patch to 6.5.22 so that I can fully replace. I am building from scratch using MIPSpro and GNUmake and using gendist to build a real patch which will fully replace the existing sh. An issue I am running into is that several of the init scripts expect to use ksh and some weird test options.

Specifically, in 
Code:
/dev/MAKEDEV
the shell is set to ksh (which in the patch is actually mksh). However, we have

Code:
@if [ -d rmt -a -l rmt ];

which as far as test commands go, is pretty non-standard. I can symlink /sbin/test to mksh, but it will not fully execute this expression. In old ksh terms -l checks if file exists and is a symlink. mksh and other newer shells do -L. 

Option 1) scrub the init scripts and other random shell scripts to deal with this. Downside: a lot of patches.
Option 2) patch mksh during build to leave in a compatibility mode. Downside: got to patch mksh.

 My work in progress is https://github.com/23jodys/irix-patches/...sh_package
23jodys
O2

Trade Count: (0)
Posts: 6
Threads: 5
Joined: Aug 2018
Find Reply
12-24-2019, 05:02 PM
#2
RE: patching sh with mksh
Hi Jody,

Some of the KSH operations I saw didn't really require any updates on the version of mksh I used, but I also tried pdksh, and a few others and they work fine as well. As far as the basic OS goes, you lose nothing by upgrading to mksh. Only an old version of pre-adobe framemaker failed to run on my system.

Additionally, upgrading tcsh to the latest tcsh works too.

Patching the initscripts should be easy, especially if you were to redeploy it in the tardist format IRIX uses.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
12-24-2019, 05:51 PM
#3
RE: patching sh with mksh
Update:

I created a set of scripts looking for errors along with carefully checking the syslog.

It looks like /dev/MAKEDEV, which isn't invoked normally, and /etc/init.d/mail are the **only** instances where a -l is used for sh, and it's only 8 instances in the former case, and 1 in the latter, on line 174. That is peanuts to patch, you could use a vim substitution pattern to get the desired effect.

I don't use Github for personal reasons, but I'll be happy to help if there's any other concerns or issues you find. I have been running /bin/sh as /bin/mksh for a while and it's not a problem. I imagine bash or zsh would work too; if you're so inclined.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
01-30-2020, 04:44 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)