Created
February 17, 2014 20:42
-
-
Save klang/9058685 to your computer and use it in GitHub Desktop.
script taken here: http://forum.tinycorelinux.net/index.php?topic=12300.0
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
#!/bin/sh | |
# a quick & dirty script to create a TinyCore initrd (for Core >= 4.2) | |
H=$( pwd ) | |
M=$( mount | grep iso9660 | head -1 | awk '{print $3}' ) | |
[ -z "$M" ] && echo "can not find mounted CD-ROM" && exit 1 | |
D=$( mktemp -d ) | |
cd $D | |
[ ! -f ${M}/boot/core.gz ] && "can not find initrd file" && exit 2 | |
zcat ${M}/boot/core.gz | sudo cpio -idum | |
[ ! -f ${M}/cde/copy2fs.lst ] && "can not find copy2fs.lst file" && exit 3 | |
T=$( mktemp -d ) | |
cat ${M}/cde/copy2fs.lst | while read F ; do | |
sudo mount ${M}/cde/optional/${F} $T || ! echo "can not mount $F" || exit 4 | |
sudo cp -a $T/* . | |
umount -d $T || ! echo "can not umount $F" || exit 5 | |
done | |
sudo rm -rf $T | |
sed -i '$i for F in /usr/local/tce.installed/* ; do sudo $F ; done' \ | |
opt/bootsync.sh | |
sudo find . | sudo cpio -odum -H newc \ | |
| gzip > "${H}/tinycore_$( cat /usr/share/doc/tc/release.txt ).gz" | |
cd "$H" | |
sudo rm -rf $D |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment