Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Headers are reused rom the downloaded kernel. ISO image is generated …
…in custom shell script. This commit is prerequisite for major switch from glibc to musl.
- Loading branch information
1 parent
8b96da4
commit 1ca057e
Showing
4 changed files
with
57 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,53 @@ | ||
#!/bin/sh | ||
|
||
rm -f minimal_linux_live.iso | ||
|
||
cd work/kernel | ||
cd $(ls -d *) | ||
WORK_KERNEL_DIR=$(pwd) | ||
cd ../../.. | ||
|
||
# Edit Makefile to look for genisoimage instead of mkisofs. This was added as a | ||
# workaround for some "Debian" and "Arch Linux" distributions. In general this | ||
# fix should be harmless. | ||
sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile | ||
rm -f minimal_linux_live.iso | ||
rm -rf work/isoimage | ||
|
||
# Generate the ISO image with optimization for "parallel jobs" = "number of processors" | ||
make isoimage FDINITRD=../../rootfs.cpio.gz -j $(grep ^processor /proc/cpuinfo | wc -l) | ||
# This is the root folder of the ISO image | ||
mkdir work/isoimage | ||
cd work/isoimage | ||
|
||
cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso | ||
# Search and copy the files 'isolinux.bin' and 'ldlinux.c32' | ||
for i in lib lib64 share end ; do | ||
if [ -f /usr/$i/syslinux/isolinux.bin ]; then | ||
cp /usr/$i/syslinux/isolinux.bin . | ||
if [ -f /usr/$i/syslinux/ldlinux.c32 ]; then | ||
cp /usr/$i/syslinux/ldlinux.c32 . | ||
fi; | ||
break; | ||
fi; | ||
if [ $i = end ]; then exit 1; fi; | ||
done | ||
|
||
cd ../../.. | ||
# Now we copy the kernel | ||
cp $WORK_KERNEL_DIR/arch/x86/boot/bzImage ./kernel.bz | ||
|
||
# Now we copy the root file system | ||
cp ../rootfs.cpio.gz ./rootfs.gz | ||
|
||
# Copy all source files to "/src". Note that the scripts won't work there. | ||
mkdir src | ||
cp ../../*.sh src | ||
cp ../../.config src | ||
chmod +rx src/*.sh | ||
chmod +r src/.config | ||
|
||
# Create ISOLINUX configuration file | ||
echo 'default kernel.bz initrd=rootfs.gz' > ./isolinux.cfg | ||
|
||
# Now we generate the ISO image file | ||
genisoimage -J -r -o ../minimal_linux_live.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ./ | ||
|
||
# This allows the ISO image to be bootable if it is burned on USB flash drive | ||
isohybrid ../minimal_linux_live.iso 2>/dev/null || true | ||
|
||
# Copy the ISO image to the root project folder | ||
cp ../minimal_linux_live.iso ../../ | ||
|
||
cd ../.. | ||
|