scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit e7299d91751363b8eefe9256f7f5ec86797a4ec9
parent 18a74b617de951286ff40fcd41b8ca68e6179054
Author: sin <sin@2f30.org>
Date:   Wed Jul 31 11:14:35 +0100

Rename busybox_initramfs.sh

Diffstat:
busybox-initramfs | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
busybox_initramfs.sh | 51---------------------------------------------------
2 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/busybox-initramfs b/busybox-initramfs @@ -0,0 +1,51 @@ +#!/bin/sh + +SRC=n +BUSYBOX_VERSION=1.16.1 + +if [ $SRC = "y" ]; then + # build statically linked busybox + if [ ! -d busybox-${BUSYBOX_VERSION} ]; then + wget -c http://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2 + tar jxvf busybox-${BUSYBOX_VERSION}.tar.bz2 + fi + cd busybox-${BUSYBOX_VERSION} + make defconfig + make CONFIG_STATIC=y + cp busybox .. + cd .. +else + wget -O busybox -c http://www.busybox.net/downloads/binaries/${BUSYBOX_VERSION}/busybox-$(uname -m) +fi + +echo "building initramfs" +rm -rf initramfs +mkdir -p initramfs/{bin,sbin,usr/bin,usr/sbin,etc,proc,sys} +cp busybox initramfs/bin +chmod +x initramfs/bin/busybox +ln -s busybox initramfs/bin/sh +touch initramfs/etc/mdev.conf + +cat << EOF > initramfs/init +#!/bin/sh + +busybox mount -t proc proc /proc +busybox mount -o remount,rw / +/bin/busybox --install + +mount -t sysfs sysfs /sys +mknod /dev/null c 1 3 +mknod /dev/tty c 5 0 +mdev -s + +while :; do + sh +done +EOF + +chmod +x initramfs/init + +cd initramfs +find . | cpio --quiet -H newc -o | gzip -9 -n > ../initramfs.img +rm -rf initramfs +echo Done diff --git a/busybox_initramfs.sh b/busybox_initramfs.sh @@ -1,51 +0,0 @@ -#!/bin/sh - -SRC=n -BUSYBOX_VERSION=1.16.1 - -if [ $SRC = "y" ]; then - # build statically linked busybox - if [ ! -d busybox-${BUSYBOX_VERSION} ]; then - wget -c http://busybox.net/downloads/busybox-${BUSYBOX_VERSION}.tar.bz2 - tar jxvf busybox-${BUSYBOX_VERSION}.tar.bz2 - fi - cd busybox-${BUSYBOX_VERSION} - make defconfig - make CONFIG_STATIC=y - cp busybox .. - cd .. -else - wget -O busybox -c http://www.busybox.net/downloads/binaries/${BUSYBOX_VERSION}/busybox-$(uname -m) -fi - -echo "building initramfs" -rm -rf initramfs -mkdir -p initramfs/{bin,sbin,usr/bin,usr/sbin,etc,proc,sys} -cp busybox initramfs/bin -chmod +x initramfs/bin/busybox -ln -s busybox initramfs/bin/sh -touch initramfs/etc/mdev.conf - -cat << EOF > initramfs/init -#!/bin/sh - -busybox mount -t proc proc /proc -busybox mount -o remount,rw / -/bin/busybox --install - -mount -t sysfs sysfs /sys -mknod /dev/null c 1 3 -mknod /dev/tty c 5 0 -mdev -s - -while :; do - sh -done -EOF - -chmod +x initramfs/init - -cd initramfs -find . | cpio --quiet -H newc -o | gzip -9 -n > ../initramfs.img -rm -rf initramfs -echo Done