zloop wrote:did you have a vanilla/pristine buildroot ?
Yes I have. To make sure, I have just done in an empty directory:
git clone git://git.openwrt.org/openwrt.git
cd openwrt
make menuconfig
#In the menuconfig:
#Target System (Broadcom BCM947xx/953xx)
#Target Profile (Broadcom SoC, b44 Ethernet, BCM43xx WiFi (b43, default))
#Target Images -> ramdisk [*]
#Target Images -> ramdisk -> Compression (lzma)
#Kernel modules -> Filesystems -> kmod-fs-ext4 (*)
#Kernel modules -> USB Support -> kmod-usb-ohci (*)
#Kernel modules -> USB Support -> kmod-usb-storage (*)
#Kernel modules -> USB Support -> kmod-usb2 (*)
#Utilities -> Filesystem -> e2fsprogs (*)
#Base system -> block-mount (*) ?
make kernel_menuconfig
#Kernel hacking -> Built-in kernel command line [*]
#Kernel hacking -> Default kernel command string (init=/bin/sh noinitrd console=ttyS0,115200)
#Kernel hacking-> Built-in command line overrides firmware arguments [*]
make -j 8 V=99 world
Afterwards I have copied the resulting kernel openwrt-brcm47xx-vmlinux-initramfs.elf to my ext4 formatted USB disk,
and also copied contents of the build_dir/target-mipsel_mips32_uClibc-0.9.33.2/root-brcm47xx directory to the same disk.
zloop wrote:that might explain why your patches to kernel commandline did have no effect
When I put the disk to mu Asus WL500gP v2 with the "bootloader", I can see the following output:
[ 43.112000] Starting new kernel
[ 43.116000] Will call new kernel at 000056f0
[ 43.116000] Bye ...
[ 0.000000] Linux version 3.10.13 (wzab@WZlap) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r3
[ 0.000000] CFE's entrypoint seal doesn't match.
[ 0.000000] CPU revision is: 00029029 (Broadcom BMIPS3300)
[ 0.000000] bcm47xx: using ssb bus
[ 0.000000] ssb: Found chip with id 0x5354, rev 0x02 and package 0x00
[ 0.000000] Couldn't find supported flash memory
[ 0.000000] ssb: Sonics Silicon Backplane found at address 0x18000000
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 16 bytes.
[ 0.000000] Primary data cache 16kB, 2-way, VIPT, cache aliases, linesize 16 bytes
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: init=/bin/sh noinitrd console=ttyS0,115200
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 26892k/32768k available (2394k kernel code, 5876k reserved, 562k data, 2348k in)
[ 0.000000] NR_IRQS:128
[ 0.000000] console [ttyS0] enabled
So it is clearly visible, that "init=/bin/sh" was passed to the kernel
However later on I can see:
[ 0.084000] Calibrating delay loop... 237.82 BogoMIPS (lpj=475648)
[ 0.120000] pid_max: default: 32768 minimum: 301
[ 0.124000] Mount-cache hash table entries: 512
[ 0.136000] NET: Registered protocol family 16
[ 0.172000] bio: create slab <bio-0> at 0
[ 0.188000] Switching to clocksource MIPS
[ 0.216000] NET: Registered protocol family 2
[ 0.224000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[ 0.232000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[ 0.236000] TCP: Hash tables configured (established 512 bind 512)
[ 0.244000] TCP: reno registered
[ 0.248000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.256000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.260000] NET: Registered protocol family 1
[ 8.452000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 8.460000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red H.
[ 8.472000] msgmni has been set to 52
[ 8.476000] io scheduler noop registered
[ 8.480000] io scheduler deadline registered (default)
[ 8.488000] Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
[ 8.516000] serial8250: ttyS0 at MMIO 0xb8000300 (irq = 3) is a U6_16550A
[ 8.544000] serial8250: ttyS1 at MMIO 0xb8000400 (irq = 3) is a U6_16550A
[ 8.572000] serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 3) is a U6_16550A
[ 8.604000] serial8250.0: ttyS1 at MMIO 0xb8000400 (irq = 3) is a U6_16550A
[ 8.620000] physmap platform flash device: 02000001 at 1c000000
[ 8.624000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chb
[ 8.636000] Amd/Fujitsu Extended Query Table at 0x0040
[ 8.640000] Amd/Fujitsu Extended Query version 1.1.
[ 8.648000] number of CFI chips: 1
[ 8.676000] 6 bcm47xxpart partitions found on MTD device physmap-flash.0
[ 8.684000] Creating 6 MTD partitions on "physmap-flash.0":
[ 8.688000] 0x000000000000-0x000000020000 : "boot"
[ 8.700000] 0x000000020000-0x0000007f0000 : "linux"
[ 8.712000] 0x00000002001c-0x000000020960 : "loader"
[ 8.724000] 0x000000020960-0x000000122c00 : "kernel"
[ 8.728000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller y
[ 8.748000] 0x000000122c00-0x0000007f0000 : "rootfs"
[ 8.752000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller y
[ 8.772000] mtd: partition "rootfs" set to be root filesystem
[ 8.776000] mtd: partition "rootfs_data" created automatically, ofs=0x390000, len=0x460000
[ 8.784000] 0x000000390000-0x0000007f0000 : "rootfs_data"
[ 8.796000] 0x0000007f0000-0x000000800000 : "nvram"
[ 8.816000] bcm47xx-wdt bcm47xx-wdt.0: BCM47xx Watchdog Timer enabled (30 seconds, Software Timer)
[ 8.828000] GPIO_WDT: failed to register misc device
[ 8.832000] TCP: cubic registered
[ 8.836000] NET: Registered protocol family 17
[ 8.844000] 8021q: 802.1Q VLAN Support v1.8
[ 8.896000] Freeing unused kernel memory: 2348K (802e5000 - 80530000)
Console is alive
procd: Console is alive
- watchdog -
procd: - watchdog -
So the argument "init=/bin/sh" was silently ignored (?!)and procd (probably via symlink /sbin/init) was started. Whan I look into "init/main.c" in the kernel sources, in the kernel_init function I find:
static int __ref kernel_init(void *unused)
{
kernel_init_freeable();
/* need to finish all async __init code before freeing the memory */
async_synchronize_full();
free_initmem();
mark_rodata_ro();
system_state = SYSTEM_RUNNING;
numa_default_policy();
flush_delayed_fput();
if (ramdisk_execute_command) {
if (!run_init_process(ramdisk_execute_command))
return 0;
pr_err("Failed to execute %s\n", ramdisk_execute_command);
}
/*
* We try each of these until one succeeds.
*
* The Bourne shell can be used instead of init if we are
* trying to recover a really broken machine.
*/
if (execute_command) {
if (!run_init_process(execute_command))
return 0;
pr_err("Failed to execute %s. Attempting defaults...\n",
execute_command);
}
if (!run_init_process("/etc/preinit") ||
!run_init_process("/sbin/init") ||
!run_init_process("/etc/init") ||
!run_init_process("/bin/init") ||
!run_init_process("/bin/sh"))
return 0;
panic("No init found. Try passing init= option to kernel. "
"See Linux Documentation/init.txt for guidance.");
}
So I'd expect, that I should receive at least an error message. But what I get is just silent skipping of the "init=" argument :-(
(Last edited by wzab on 5 Oct 2013, 10:12)