Opened 9 years ago

Closed 9 years ago

#4745 closed defect (fixed)

kamikaze 8.09/x86/soekris net5501: Imagebuilder-generated image does not activate init scripts

Reported by: mvalsasna@… Owned by: developers
Priority: high Milestone: Kamikaze 8.09.1
Component: packages Version: Kamikaze 8.09
Keywords: imageguilder init script enable jffs Cc:



I am working on a custom image for the soekris net5501 board.

I compiled from source using the x86/net4801 target, producing both the squashfs image and the ImageBuilder.

the squashfs image generated by the build system was ok, but the image generated by the Imagebuilder (make image with no arguments or extra files) shows some problems, most of which can be traced back to the init scripts not being enabled in the squashfs filesystem.

any hint on how to fix this?

more detail below

I compared the contents of the two squashfs filesystem, and found that the one generated by imagebuilder lacks these files:

 Solo in fs_src/etc/rc.d: K40network
 Solo in fs_src/etc/rc.d: K99umount
 Solo in fs_src/etc/rc.d: S10boot
 Solo in fs_src/etc/rc.d: S20fstab
 Solo in fs_src/etc/rc.d: S39usb
 Solo in fs_src/etc/rc.d: S40network
 Solo in fs_src/etc/rc.d: S50cron
 Solo in fs_src/etc/rc.d: S50dropbear
 Solo in fs_src/etc/rc.d: S50httpd
 Solo in fs_src/etc/rc.d: S50telnet
 Solo in fs_src/etc/rc.d: S60dnsmasq
 Solo in fs_src/etc/rc.d: S60led
 Solo in fs_src/etc/rc.d: S95done
 Solo in fs_src/etc/rc.d: S97watchdog
 Solo in fs_src/etc/rc.d: S99sysctl 

so I guess the imagebuilder image does not enable the init scripts.

note: I am using a 32MB flash chips, so I selected CONFIG_TARGET_ROOTFS_FSPART=24, (the default was 48), otherwise the image would try to create a 48MB jffs filesystem and fail while trying to write past the device size.

malfuncions found:

a) JFFS filesystem not automatically mounted/created

on the first boot after writing the image to the flash, the JFFS filesystem is not created automatically, but manually creating it works:

hda: STI Flash 8.0.0, CFA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: max request size: 128KiB
hda: 62720 sectors (32 MB), CHS=490/4/32
hda: cache flushes not supported
 hda: hda1 hda2 hda3
block2mtd: version $Revision: 1.30 $
Creating 1 MTD partitions on "rootfs":
0x00000000-0x01810000 : "rootfs"
mtd: partition "rootfs_data" created automatically, ofs=100000, len=1710000 
0x00100000-0x01810000 : "rootfs_data"
block2mtd: mtd0: [rootfs] erase_size = 64KiB [65536]

root@(none):/# ls /etc/rc.d/

root@(none):/#  mount -tjffs2 /dev/mtdblock1 /jffs/
jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
jffs2_build_filesystem(): unlocking the mtd device... done.
jffs2_build_filesystem(): erasing all blocks after the end marker... done.
root@(none):/# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
tmpfs on /dev type tmpfs (rw,size=512k)
devpts on /dev/pts type devpts (rw,mode=600)
mini_fo:/tmp/root on / type mini_fo (rw)
/dev/mtdblock1 on /jffs type jffs2 (rw)

b) modules.dep not autogenerated

root@(none):/# modprobe natsemi
modprobe: cannot parse modules.dep
root@(none):/# depmod -a
root@(none):/# modprobe natsemi
natsemi dp8381x driver, version 2.1, Sept 11, 2006
  originally by Donald Becker <>
  2.4.x kernel port by Jeff Garzik, Tjeerd Mulder

c) no modules loaded automatically

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by mvalsasna@…

cause: filesystem root directory renamed from root to root-x86, imagebuilder makefile not changed accordingly

# make image
Activating init scripts
--: line 1: cd: /root/OpenWrt-ImageBuilder-x86-for-Linux-i686/build_dir/i386/root: No such file or directory

# ls -l /root/OpenWrt-ImageBuilder-x86-for-Linux-i686/build_dir/i386/
total 4
drwxr-sr-x 16 root root 4096 2009-04-09 18:20 root-x86

From imagebuilder Makefile:

package_postinst: FORCE
        @echo Activating init scripts
        @( \
                cd $(BUILD_DIR)/root; \
                for script in ./etc/init.d/*; do \
                        grep '#!/bin/sh /etc/rc.common' $$script >/dev/null || continue; \
                        IPKG_INSTROOT=$(BUILD_DIR)/root $(which bash) ./etc/rc.common $$script enable; \
                done || true; \

quick fix: add a symlink once the imagebuilder is unpacked

# cd /root/OpenWrt-ImageBuilder-x86-for-Linux-i686/build_dir/i386/
# ln -s  root-x86 root
# ls -l /root/OpenWrt-ImageBuilder-x86-for-Linux-i686/build_dir/i386/
total 4
lrwxrwxrwx  1 root rt      9 2009-04-16 11:59 root -> root-x86/
drwxr-sr-x 16 root root 4096 2009-04-09 18:20 root-x86

root@OpenWrt:/# ls /etc/rc.d/
K40network   S20fstab     S45firewall  S50httpd     S60ipsec     S95done
K99umount    S39usb       S50cron      S50telnet    S60led       S97watchdog
S10boot      S40network   S50dropbear  S60dnsmasq   S65ntpd      S99sysctl

comment:2 Changed 9 years ago by florian

  • Milestone set to Kamikaze 8.09.1
  • Priority changed from normal to high
  • Version set to Kamikaze 8.09

comment:3 Changed 9 years ago by nico

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [15320], thanks!

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.