On 12/12/17 20:13, A.W.C. wrote:
Hi,

I have trouble to resolve this. It's definitely it's not so easy as it might 
look, not so trivial. I tried different steps, but can't fix this. Possibly 
some steps is wrong.

BusyBox v1.10.2 (2017-08-02 14:07:25 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
# mount -t proc proc /proc
# mount -o remount,rw /
# mount -t sysfs sysfs /sys
# mount -t tmpfs tmpfs /tmp
# mknod -m 666 /dev/null c 1 3
mknod: /dev/null: Read-only file system
Hi,
Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes up to 1 MB for greater compression. Several compression algorithms are supported. Squashfs is also the name of free software, licensed under the GPL, for accessing Squashfs filesystems.

Squashfs is intended for general read-only file-system use and in constrained block-device memory systems (e.g. embedded systems) where low overhead is needed.
You should also read:
http://www.iitk.ac.in/LDP/LDP/lfs/5.0/html/chapter06/proc.html
and
http://www.iitk.ac.in/LDP/LDP/lfs/5.0/html/chapter06/makedev.html

I would add:

mount -t devtmpfs none /dev

or If your kernel supports the devfs file system, run the following command to mount devfs:

mount -t devfs devfs /dev

mkdir /dev/pts
mount devpts /dev/pts -t devpts

Hope this helps,
Ciao,
Tito

# pwd
/
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /tmp tmpfs rw 0 0
# mknod -m 644 /dev/mtd4        c 90 4
mknod: /dev/mtd4: Read-only file system
# mknod -m 644 /dev/mtdblock4   b 31  4
mknod: /dev/mtdblock4: Read-only file system
# mount -t squashfs /dev/mtdblock4 /mnt
mount: mounting /dev/mtdblock4 on /mnt failed: No such file or directory
# mknod -m 666 /dev/null c 1 3
mknod: /dev/null: Read-only file system
# mknod -m 644 /dev/mtd4        c 90 4
mknod: /dev/mtd4: Read-only file system
# ls -al /dev
drwxr-xr-x    2 0        0              32 Aug  2  2017 .
drwxr-xr-x   19 1005     1005          219 Aug  2  2017 ..
crw-r--r--    1 0        0          5,   1 Jan  1 00:24 console
crw-r--r--    1 0        0          2,   0 Aug  2  2017 nfs
# ls -al
drwxr-xr-x   19 1005     1005          219 Aug  2  2017 .
drwxr-xr-x   19 1005     1005          219 Aug  2  2017 ..
drwxrwxr-x    6 1005     1005           86 Aug  2  2017 .svn
drwxrwxr-x    2 1005     1005          432 Aug  2  2017 bin
-rwxr-xr-x    1 1005     1005       715844 Aug  2  2017 cordless_nodect.coma
drwxr-xr-x    2 0        0              32 Aug  2  2017 dev
drwxr-xr-x    2 1005     1005            3 Aug  2  2017 eeprom
drwxr-xr-x    4 1005     1005          386 Aug  2  2017 etc
drwxr-xr-x    2 1005     1005            3 Aug  2  2017 fpar
drwxr-xr-x    4 0        0              48 Aug  2  2017 home
drwxr-xr-x    2 1005     1005            3 Aug  2  2017 hsfw
drwxr-xr-x    3 1005     1005          287 Aug  2  2017 lib
drwxrwxr-x    2 1005     1005            3 Aug  2  2017 mnt
drwxr-xr-x    2 1005     1005            3 Aug  2  2017 nvram
dr-xr-xr-x   27 0        0               0 Jan  1 00:00 proc
lrwxrwxrwx    1 1005     1005            8 Aug  2  2017 root -> tmp/root
drwxr-xr-x    2 1005     1005          642 Aug  2  2017 sbin
drwxr-xr-x   10 0        0               0 Jan  1 00:00 sys
drwxrwxrwt    2 0        0              40 Jan  1 00:03 tmp
drwxr-xr-x    7 1005     1005           73 Aug  2  2017 usr
lrwxrwxrwx    1 1005     1005            7 Aug  2  2017 var -> tmp/var
drwxr-xr-x    6 1005     1005         4051 Aug  2  2017 www

# fstab
/bin/sh: fstab: not found
# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw)
# mount -t squashfs /dev/mtdblock4 /mnt
mount: mounting /dev/mtdblock4 on /mnt failed: No such file or directory
# mount -t jffs2 /dev/mtdblock10 /mnt/
mount: mounting /dev/mtdblock10 on /mnt/ failed: No such file or directory
# mknod -m 644 /dev/mtd10       c 90 20
mknod: /dev/mtd10: Read-only file system

One day I sucessfully managed mount mtd9 nvram partition (jffs2), but next time 
I can't mount anymore, all time system is 'Read-only file system' for any 
partition.

Regards,
Aex


--------------------------------------------
On Mon, 12/4/17, Mattias Schlenker <[email protected]> wrote:

  Subject: Re: BusyBox built-in shell (ash)
  To: [email protected]
  Date: Monday, December 4, 2017, 9:21 AM
Am 04.12.2017
  um 00:09 schrieb A.W.C.:
Hi
  Baruch,
what
  I want is
  manually
                  mount the root file system
  from busybox
              rescue shell. To make some changes,
  umount and exit
            from shell.  Linux v 2.6.26.5,
  rootfstype=squashfs, root
            filesystem is on mtd4, NAND flash, jffs2.
#
            mount -t proc none /proc
# mount -t sysfs none /sys #
            mount -t devtmpfs devtmpfs /dev
mount: mounting devtmpfs on /dev failed: No such
  device
Seems devtmpfs is not supported by your kernel. Use
  mknod to create
      the most basic device nodes (/dev/null, /dev/zero,
      /dev/mtdblock{,1,2,3,4} and a few ttys).  But: This is
  absolutely
      not busybox related. This is linux basics.
#
            mount -t jffs2 /dev/mtd4 /mnt/root
mount: mounting /dev/mtd4 on /mnt/root failed: No
  such file or
            directory
After creating the device node with the proper minor
  major mount
      will work.
Yours, Mattias On Sunday, December 3, 2017 9:23 AM,
                    Baruch Siach <[email protected]>
  wrote:
Hi Alex, On Fri, Dec 01, 2017 at 03:17:39PM +0000,
  A.W.C. wrote:
> But I already have directories /dev,
  /proc, /sys,
                  /tmp
> If I'll make these new dir for
  TinyCross they will
                  replace existing ones?
> > mkdir -p /proc > mkdir -p /sys > mkdir -p /tmp > mkdir -p /var/log > > Basically, I want mount root partition,
  its located
                  on /dev/mtd4. In my
> specific case I need manually mount a
  few
                  partitions only required for this
> task, correct? > Then mount root > > mount /dev/mtd4 /mnt/root You must specify the type of the filesystem
  when
                  mounting raw MTD filesystems.
This is probably jffs2 in your case, though
  it might
                  also be ubifs. In case of
ubifs you also need to "attach"
  the ubi volume before
                  you mount it.
> Please correct me if I'm wrong. > > How to exit from busybox shell
  properly? Command
                  'exit' produces Kernel panic.
This is expected behaviour. The kernel
  panics when PID
                  1, your shell, exits.
The common implementation is to exec the
  rootfs init
                  from the initramfs init
script. baruch --     http://baruch.siach.name/blog/
                                  ~. .~  Tk Open
  Systems
=}------------------------------------------------ooO--U--Ooo------------{=   - [email protected]
                  - tel: +972.2.679.5364, http://www.tkos.co.il
- _______________________________________________
  busybox mailing list
  [email protected]
  http://lists.busybox.net/mailman/listinfo/busybox
--
  Mattias Schlenker - Freier IT-Fachredakteur und -autor
  [email protected]
Mattias Schlenker - IT-Consulting, Softwareentwicklung
  [email protected]
August-Bebel-Str. 74 - D-04275 LEIPZIG - GERMANY
  Phone: +49 341 39290767 - Fax: +49 341 25365955
  Mobile (primary): +49 163 6953657
  Mobile (secondary): +49 163 1848610
  VATIN DE240998538
https://github.com/mschlenker http://www.mattiasschlenker.de/ http://www.arduino-hausautomation.de/ _______________________________________________
  busybox mailing list
  [email protected]
  http://lists.busybox.net/mailman/listinfo/busybox
-----Inline Attachment Follows----- _______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to