ReadyNASDuoSparc
This repository contains information, binaries, scripts regarding the readynas duo v1 sparc machine from netgear.
"The ReadyNAS RAIDiator 4.1.x firmware is a 32-bit SPARC Debian derivative mated to a Linux 2.6.17 kernel with numerous proprietary drivers" For more information check: http://wiki.dietpc.org/index.php/DIET-PC_on_SPARC_ReadyNASQemu image of readynas https://community.netgear.com/t5/Community-Add-ons/Sparc-platform-development-envrionment-using-Qemu/td-p/720841 (dev version)
Hints
- If there is no space left on the root partition you can workaround the issue with:
mount --bind /path/to/dir/with/plenty/of/space /tmp
- Better create a symlink for /usr/local/ -> /c/usr/local/
- create dpkg packages with
checkinstall --dpkgflags=--force-overwrite --exclude /usr/local/share/ make install
- use
dpkg -i --force-overwrite whatever.deb
to install debian packages from this repository. - If you retriev error messages like
debian-sparc:~# curl --version curl: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory
when executing an installed application (in this case it would be curl), make sure you installed the required library (in this example it would be libnettle) and exported the enviroment variable LD_LIBRARY_PATH with the proper paths.
Start
- Download this github repository with
wget --no-check-certificate https://github.com/mfe-/ReadyNASDuoSparc/archive/master.zip
- Unzip and install your required software
- You can execute steps 1 to 12 of init.
- It makes sense to export some enviroment variables when logging into bash.
a. You can make use of
.bashrc
b. add the following lines to export some paths
export PATH=$PATH:/opt/rfw/bin/:/usr/local/ssl/bin/:/opt/git-2.21.0/bin/
export PATH=$HOME/.local/bin:$PATH
export LD_LIBRARY_PATH=/opt/gcc-4.6.0/lib/:/usr/local/ssl/lib/:/usr/local/lib/
Init
I reset my readynas and did the following steps:
Because netgear turned off there package repository you can't get the customized netgear packages like libc6-dev for the debian system. You can get the contained files from the libc6-dev folder. You only need to copy them to the system root partion /.
- Remove netgear sources from apt.sources
- apt-get update
Fix some broken stuff on the readynas
-
apt-get install grep --reinstall (rly important this was related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81421)
-
Apt-get install nano -y
-
apt-get install less --reinstall -y
-
useradd -s /bin/false man
-
apt-get install man-db
-
apt-get install manpages-dev
-
apt-get install --reinstall perl
-
Apt-get install screen
-
Apt-get install less
-
ln -s /usr/bin/less /usr/bin/sensible-pager
-
Apt-get install checkinstall
Do not execute the underneath steps. Those are only for documentation purposes. Install gcc 3.3.5 with apt
- apt-get install gcc
- gcc --v Reading specs from /usr/lib/gcc-lib/sparc-linux/3.3.5/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --with-cpu=v7 --enable-objc-gc sparc-linux Thread model: posix gcc version 3.3.5 (Debian 1:3.3.5-13)
Install gcc 4.0.4 from source
- download mpc-0.9.tar.gz, gmp-4.3.2.tar, mpfr-3.1.1.tar.gz and extract them
- download and extract gcc-4.0.4.tar.gz
- rename the extracted folder to mpc, gmp, mpfr and move them to into the extracted gcc source folder
- create a new folder outside of the gcc sourcefolder called gcc-4.0.4-compiled
- cd to gcc-4.0.4-compiled
- ../gcc-4.0.4/configure --prefix=/opt/gcc-4.0.4 --mandir=/usr/share/man --infodir=/usr/share/info --with-cpu=v7 --enable-objc-gc --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-languages=c,c++ --build=sparc-linux --host=sparc-linux
- make && make install
- export LD_LIBRARY_PATH=/opt/gcc-4/lib:/usr/local/lib/ or add it to /root/.bashrc
- checkinstall --dpkgflags=--force-overwrite make install #create .deb package Use the new gcc by setting CC and CXX. For example ./configure CC=/opt/gcc-4/bin/gcc CXX=/opt/gcc-4/bin/g++
Install last gnu enviroment libraries
- install with dpkg -i -f perl-base_5.8.8-7.infrant2_sparc.deb, perl-modules_5.8.8-7.infrant2_all.deb, perl_5.8.8-7.infrant2_sparc.deb from this repository
- install last make
- install last automake
- install last m4
- install last gmp, mpfr, mpc
- install libiconv
- install Bison
- install libtool
- install ncurse
- install expat
- install libxml
- install gettext
- install texinfo version <5 otherwise you can't compile gcc 4.6
- install ils
Install gcc 4.6
- install gcc 4.6 with gcc-4.6-compiled# ../gcc-4.6/configure CC=/opt/gcc-4/bin/gcc CXX=/opt/gcc-4/bin/g++ --enable-languages=c,c++ --prefix=/opt/gcc-4.6 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --enable-clocale=gnu --enable-debug --with-cpu=v7 --enable-objc-gc sparc-linux --with-system-zlib=/usr/local --with-mpc=/usr/local --with-mpfr=/usr/local --with-gmp=/usr/local --with-isl=/usr/local/
Compile kernel modules
- Download last firmware from Netgear ReadyNAS devices running RAIDiator 4.1 (NV / NV+ / 1100 / Duo) GPL Bundle, RAIDiator 4.1.16
Issues
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81579 sanitizer_platform_limits_linux.cc:37:15: error: conflicting declaration ‘typedef __gid_t __kernel_gid_t’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81451 - missing futex check - libgo/runtime/thread-linux.c:12:0 futex.h:13:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘long’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56827 Building Go support for gcc 4.8.0 fails on Linux: undefined type ‘SockFilter’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81449 - runtime.inc:782:28: error: field ‘__sem_lock’ has incomplete type
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82043 - error: redefinition of ...
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82208 - exec_linux.go:197:27: error: reference to undefined name 'SYS_UNSHARE'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82348 - math.lo.dep bytes.gox dependency dropped
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87013 -gcc8
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88060 - [Bug go/88060] ../../../gcc-8.2.0/libgo/go/syscall/libcall_linux_utimesnano.go:17:18: error: reference to undefined name ‘_AT_FDCWD’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88135 - Bug 88135 - error: reference to undefined identifier ‘syscall.WEXITED’
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90527 - gcc9.1 alloc.c:72:7: error: implicit declaration of function ‘posix_memalign’
init
apt-get update
mkdir /c/opt
mkdir /c/usr
mkdir /c/usr/local
mv /opt/* /c/opt/
rm /opt/ -Rf
ln -s /c/opt/ /opt
mv /usr/local/* /c/usr/local/
rm /usr/local/ -R
ln -s /c/usr/local/ /usr/local
apt-get install grep --reinstall
apt-get install nano -y
apt-get install less -y
useradd -s /bin/false man
apt-get install man-db -y
apt-get install less -y
ln -s /usr/bin/less /usr/bin/sensible-pager
apt-get install screen -y
apt-get install gcc g++ -y