Merge pull request #2 from BeresfordHare/master
The suggested changes look great and I'm merging them in the current sources. This hasn't tested them yet (TODO) but the changes are quite simple and I believe there will be no issues at all.
This commit is contained in:
		
						commit
						7a97f7e982
					
				| @ -3,3 +3,5 @@ | |||||||
| rm -rf work | rm -rf work | ||||||
| mkdir work | mkdir work | ||||||
| 
 | 
 | ||||||
|  | # -p stops errors if the directory already exists | ||||||
|  | mkdir -p source | ||||||
|  | |||||||
| @ -1,13 +1,22 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
| 
 | 
 | ||||||
|  | # Grab everything after the '=' sign | ||||||
| DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') | DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=') | ||||||
|  | 
 | ||||||
|  | # Grab everything after the last '/' | ||||||
| ARCHIVE_FILE=${DOWNLOAD_URL##*/} | ARCHIVE_FILE=${DOWNLOAD_URL##*/} | ||||||
| 
 | 
 | ||||||
| cd work | cd source | ||||||
| rm -f $ARCHIVE_FILE |  | ||||||
| wget $DOWNLOAD_URL |  | ||||||
| rm -rf kernel |  | ||||||
| mkdir kernel |  | ||||||
| tar -xvf $ARCHIVE_FILE -C kernel |  | ||||||
| cd .. |  | ||||||
| 
 | 
 | ||||||
|  | # Downloading kernel file | ||||||
|  | # -c option allows the download to resume | ||||||
|  | wget -c $DOWNLOAD_URL | ||||||
|  | 
 | ||||||
|  | # Delete folder with previously extracted kernel | ||||||
|  | rm -rf ../work/kernel | ||||||
|  | mkdir ../work/kernel | ||||||
|  | 
 | ||||||
|  | # Extract kernel to folder 'kernel' | ||||||
|  | # Full path will be something like, kernel\linux-3.16 | ||||||
|  | tar -xvf $ARCHIVE_FILE -C ../work/kernel | ||||||
|  | cd .. | ||||||
|  | |||||||
| @ -1,10 +1,21 @@ | |||||||
| #/bin/sh | #!/bin/sh | ||||||
| 
 | 
 | ||||||
| cd work/kernel | cd work/kernel | ||||||
| cd $(ls -d *) |  | ||||||
| make clean |  | ||||||
| make defconfig |  | ||||||
| sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal-linux-live\"/" .config |  | ||||||
| make vmlinux |  | ||||||
| cd ../../.. |  | ||||||
| 
 | 
 | ||||||
|  | # Change to the first directory ls finds, e.g. linux-3.16 | ||||||
|  | cd $(ls -d *) | ||||||
|  | 
 | ||||||
|  | # Cleans up the kernel sources, including configuration files | ||||||
|  | make mrproper | ||||||
|  | 
 | ||||||
|  | # Create a default configuration file for the kernel | ||||||
|  | make defconfig | ||||||
|  | 
 | ||||||
|  | # Changes the name of the system | ||||||
|  | sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal-linux-live\"/" .config | ||||||
|  | 
 | ||||||
|  | # Compile the kernel | ||||||
|  | # Good explanation of the different kernels | ||||||
|  | # http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux | ||||||
|  | make bzImage | ||||||
|  | cd ../../.. | ||||||
|  | |||||||
| @ -1,13 +1,23 @@ | |||||||
| #/bin/sh | #!/bin/sh | ||||||
| 
 | 
 | ||||||
|  | # Grab everything after the '=' sign | ||||||
| DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=') | DOWNLOAD_URL=$(grep -i BUSYBOX_SOURCE_URL .config | cut -f2 -d'=') | ||||||
|  | 
 | ||||||
|  | # Grab everything after the last '/' | ||||||
| ARCHIVE_FILE=${DOWNLOAD_URL##*/} | ARCHIVE_FILE=${DOWNLOAD_URL##*/} | ||||||
| 
 | 
 | ||||||
| cd work | cd source | ||||||
| rm -f $ARCHIVE_FILE | 
 | ||||||
| wget $DOWNLOAD_URL | # Downloading busybox source | ||||||
| rm -rf busybox | # -c option allows the download to resume | ||||||
| mkdir busybox | wget -c $DOWNLOAD_URL | ||||||
| tar -xvf $ARCHIVE_FILE -C busybox | 
 | ||||||
|  | # Delete folder with previously extracted busybox | ||||||
|  | rm -rf ../work/busybox | ||||||
|  | mkdir ../work/busybox | ||||||
|  | 
 | ||||||
|  | # Extract kernel to folder 'busybox' | ||||||
|  | # Full path will be something like, busybox\busybox-1.22.1 | ||||||
|  | tar -xvf $ARCHIVE_FILE -C ../work/busybox | ||||||
| cd .. | cd .. | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,11 +1,25 @@ | |||||||
| #/bin/sh | #!/bin/sh | ||||||
| 
 | 
 | ||||||
| cd work/busybox | cd work/busybox | ||||||
| cd $(ls -d *) |  | ||||||
| make clean |  | ||||||
| make defconfig |  | ||||||
| sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config |  | ||||||
| make busybox |  | ||||||
| make install |  | ||||||
| cd ../../.. |  | ||||||
| 
 | 
 | ||||||
|  | # Change to the first directory ls finds, e.g/ busybox-1.22.1 | ||||||
|  | cd $(ls -d *) | ||||||
|  | 
 | ||||||
|  | # Clean's the source? | ||||||
|  | make clean | ||||||
|  | 
 | ||||||
|  | # Create a default configuration file | ||||||
|  | make defconfig | ||||||
|  | 
 | ||||||
|  | # Change the configuration, so that busybox is statically compiled | ||||||
|  | # You could do this manually with 'make menuconfig' | ||||||
|  | sed -i "s/.*CONFIG_STATIC.*/CONFIG_STATIC=y/" .config | ||||||
|  | 
 | ||||||
|  | # Compile busybox | ||||||
|  | make busybox | ||||||
|  | 
 | ||||||
|  | # Create the symlinks for busybox | ||||||
|  | # It uses the file busybox.links for this | ||||||
|  | make install | ||||||
|  | 
 | ||||||
|  | cd ../../.. | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user