Hmm, I decided not to play with backup and restore. I simply created my own very stripped down image with the ImageBuilder to fit into the 2MB flash. After flashing this image I loaded e2fsprogs, libuuid and fdisk in the ramdisk (no space left on the device) and repartioned and reformatted the internal IDE HDD. Then I replaced /sbin/init script to extend /jffs on a 512MB partition on the HDD.
Create a image with a real minimal set of packages to fit into the 2MB flash:
make clean image PACKAGES="base-files busybox dropbear kmod-diag kmod-fs-ext3 kmod-ide-aec62xx kmod-ide-core kmod-switch libgcc uclibc -kmod-ppp -kmod-pppoe -ppp -ppp-mod-pppoe -nvram -dnsmasq -iptables -kmod-ipt-nathelper -mtd -e2fsprogs -fdisk"
Building images for Broadcom BCM947xx/953xx [2.4] - Generic, Broadcom WiFi (default)
Packages: base-files-brcm-2.4 bridge busybox dropbear kernel kmod-diag kmod-fs-ext3 kmod-ide-aec62xx kmod-ide-core kmod-switch libgcc uclibc
make[2] package_index
make[2] package_install
make[2] package_postinst
make[2] build_image
-rw-r--r-- 1 ubuntu ubuntu 1380352 2007-10-06 10:38 bin/openwrt-brcm-2.4-squashfs.trx
/sbin/init (see also: http://forum.openwrt.org/viewtopic.php?id=11495 - 1. Boot from USB-Stick)
#!/bin/sh
boot_dev="/dev/ide/host0/bus0/target0/lun0/part1"
for module in ide-core aec62xx ide-detect ide-disk jbd ext3; do {
insmod $module
}; done
sleep 5s
mount -o rw "$boot_dev" /mnt
[ -x /mnt/sbin/init ] && {
. /bin/firstboot
pivot /mnt /mnt
}
exec /bin/busybox init
Now I can install the rest of the packages the normal way on the HDD
fdisk -l /dev/ide/host0/bus0/target0/lun0/disc
Disk /dev/ide/host0/bus0/target0/lun0/disc: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/ide/host0/bus0/target0/lun0/part1 1 63 506016 83 Linux
/dev/ide/host0/bus0/target0/lun0/part2 64 30339 243191970 83 Linux
/dev/ide/host0/bus0/target0/lun0/part3 30340 30401 498015 82 Linux swap / Solaris
mount
rootfs on / type rootfs (rw)
/dev/root on /mnt/rom type squashfs (ro)
none on /dev type devfs (rw)
none on /proc type proc (rw)
none on /tmp type tmpfs (rw,nosuid,nodev)
none on /dev/pts type devpts (rw)
/dev/mtdblock/4 on /jffs type jffs2 (rw)
mini_fo:/jffs on /mnt type mini_fo (rw)
/dev/ide/host0/bus0/target0/lun0/part1 on / type ext3 (rw)
df -h
Filesystem Size Used Available Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part1
768.0k 768.0k 0 100% /mnt/rom
none 30.7M 24.0k 30.7M 0% /tmp
/dev/mtdblock/4 448.0k 324.0k 124.0k 72% /jffs
mini_fo:/jffs 768.0k 768.0k 0 100% /mnt
/dev/ide/host0/bus0/target0/lun0/part1
486.3M 16.8M 444.7M 4% /
ipkg list_installed
base-files-brcm-2.4 - 10-9111 -
bridge - 1.0.6-1 -
busybox - 1.7.2-2 -
dnsmasq - 2.39-1 -
dropbear - 0.50-2 -
iptables - 1.3.7-1 -
iptables-mod-conntrack - 1.3.7-1 -
iptables-mod-filter - 1.3.7-1 -
iptables-mod-imq - 1.3.7-1 -
iptables-mod-ipopt - 1.3.7-1 -
kernel - 2.4.34-brcm-1 -
kmod-brcm-wl - 2.4.34+4.80.53.0-1 -
kmod-diag - 2+2.4.34-brcm-1 -
kmod-fs-ext3 - 2.4.34-brcm-1 -
kmod-ide-aec62xx - 2.4.34-brcm-1 -
kmod-ide-core - 2.4.34-brcm-1 -
kmod-ipt-conntrack - 2.4.34-brcm-1 -
kmod-ipt-filter - 2.4.34-brcm-1 -
kmod-ipt-imq - 2.4.34-brcm-1 -
kmod-ipt-ipopt - 2.4.34-brcm-1 -
kmod-loop - 2.4.34-brcm-1 -
kmod-sched - 2.4.34-brcm-1 -
kmod-scsi-core - 2.4.34-brcm-1 -
kmod-switch - 2.4.34-brcm-1 -
kmod-usb-core - 2.4.34-brcm-1 -
kmod-usb-storage - 2.4.34-brcm-1 -
kmod-usb-uhci-iv - 2.4.34-brcm-1 -
kmod-usb2 - 2.4.34-brcm-1 -
kmod-wlcompat - 2.4.34+brcm-6 -
libgcc - 3.4.6-10 -
libncurses - 5.6-1 -
libopenssl - 0.9.8e-1 -
libpcre - 7.2-2 -
libpthread - 0.9.28-10 -
libsqlite3 - 3.4.2-1 -
libusb - 0.1.12-1 -
libxml2 - 2.6.20-1 -
lighttpd - 1.4.18-2 -
lighttpd-mod-accesslog - 1.4.18-2 -
losetup - 2.12r-2 -
mtd - 5 -
nano - 2.0.6-1 -
nas - 4.80.53.0-1 -
ntpclient - 2003_194-4 -
nvram - 1 -
pciutils - 2.2.1-1 -
qos-scripts - 1.2.1-1 -
swap-utils - 2.12r-2 -
tc - 2.6.20-070313-1 -
uclibc - 0.9.28-10 -
usbutils - 0.72-1 -
vsftpd - 2.0.5-2 -
wget - 1.10.2-2 -
wireless-tools - 29-1 -
wlc - 4.80.53.0-1 -
zlib - 1.2.3-4 -
Done.
free
total used free shared buffers
Mem: 62928 21956 40972 0 4876
Swap: 498004 0 498004
Total: 560932 21956 538976
cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 64438272 22495232 41943040 0 4993024 9211904
Swap: 509956096 0 509956096
MemTotal: 62928 kB
MemFree: 40960 kB
MemShared: 0 kB
Buffers: 4876 kB
Cached: 8996 kB
SwapCached: 0 kB
Active: 9872 kB
Inactive: 4024 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 62928 kB
LowFree: 40960 kB
SwapTotal: 498004 kB
SwapFree: 498004 kB
Btw. this is a image with 7.09 built with backported Busybox 1.7.2 from trunk and swap enabled
(Last edited by forum2006 on 6 Oct 2007, 10:20)