📄 mkttyiso
字号:
#!/bin/sh########################### CONFIGURATION SETTINGS ############################ where to find ttylinux files and create iso imageTTYLINUX="/home/pharao90/ttylinux"# kernel image file to useVMLINUZ="bzImage"# name of root filesystem imageFILESYS="filesys"# location of isolinux.bin boot loader binaryISOLINUX="/usr/share/syslinux/isolinux.bin"# stuff to append to kernel command lineAPPEND=""# temporary directory where to put ISO directoriesISODIR="iso"# name for the iso image to createISOFILE="bootcd.iso"######################### END OF CONFIGURATION #########################echo "mkttyiso (C) 2002,2006 Pascal Schmidt"echoif [ ! -r "$ISOLINUX" ]; then echo "Error: isolinux binary '$ISOLINUX' does not exist." exit 1fiif [ "$TTYLINUX" = "" ]; then TTYLINUX="."fiif [ ! -d "$TTYLINUX" ]; then echo "Error: base directory '$TTYLINUX' does not exist." exit 1fiecho "Base directory: $TTYLINUX"if [ "$ISODIR" = "" ]; then ISODIR=$TTYLINUX/isofiif [ -d "$ISODIR" ]; then echo "Error: ISO directory '$ISODIR' already exists." exit 1fiecho "ISO directory name: $ISODIR"if [ "$ISOFILE" = "" ]; then ISOFILE="$TTYLINUX/bootcd.iso"fiif [ -e "$ISOFILE" ]; then echo "Error: ISO file '$ISOFILE' already exists." exit 1fiecho "ISO filename: $ISOFILE"if [ "$VMLINUZ" = "" ]; then VMLINUZ="vmlinuz"fiif [ ! -r "$VMLINUZ" ]; then echo "Error: kernel image '$VMLINUZ' unreadable or missing." exit 1fiecho "Kernel filename: $VMLINUZ"APPEND="$APPEND"echo "Kernel append line: $APPEND"cleanup() { rm -rf $ISODIR exit 1}check() { if [ $? -eq 0 ]; then echo "done" else echo "failed" cleanup fi}CHECK_FILES="user_guide.html user_guide.tex AUTHORS COPYING ChangeLog"echocd $TTYLINUXfor i in $CHECK_FILES; do if [ ! -r "$i" ]; then echo "Error: file '$i' is not readable or does not exist." exit 1 fidoneecho -n "Creating ISO image directory structure: "mkdir -p $ISODIR/isolinuxcheckecho -n "Copying boot loader binary: "cp "$ISOLINUX" $ISODIR/isolinuxcheckecho -n "Copying kernel image: "cp "$VMLINUZ" $ISODIR/isolinux/bzImagecheckecho -n "Copying filesystem image: "cp "$FILESYS" $ISODIR/isolinux/filesyscheckecho -n "Creating boot loader configuration: "cat > $ISODIR/isolinux/isolinux.cfg <<EOFdefault linux initrd=filesys load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=4096 ro root=/dev/ram0PROMPT 0LABEL linuxKERNEL bzImageEOFcheckecho -n "Copying documentation files to ISO directory: "cp AUTHORS user_guide.html user_guide.tex COPYING ChangeLog $ISODIRcheckecho -n "Creating ISO image: "mkisofs -r -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table -o $ISOFILE $ISODIR &> /dev/nullcheckecho -n "Removing ISO directories: "rm -rf $ISODIRcheckechoecho "ISO image file '$ISOFILE' is ready."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -