[Comprehensive explanation of Linux commands] 127. Detailed explanation of Linux CD production tools mkinitrd and mkisofs

mkinitrd

Create an image file to be loaded into the ramdisk

Additional information

mkinitrdThe command is used to create an image file to be loaded into the ramdisk so that the ramdisk can be loaded when Linux boots.

This command is used to repackage the core. For example, if you modify the driver of a device yourself, if this driver is to be added to the core level, you need to repackage the core and compile the newly added configuration into the core!

grammar

mkinitrd [选项] [参数]

Options

  • -f: If the specified image file name is the same as an existing file, the existing file will be overwritten;
  • -v: Display detailed information during execution;
  • --omit-scsi-modules: Do not load the SCSI module;
  • --preload=<模块名称>:Specify the module to be loaded;
  • --with=<模块名称>:Specify the module to be loaded;
  • --version: Display version information.

parameter

  • 映像文件:Specify the image file to be created;
  • 内核版本:Specify the kernel version.

Example

[root@localhost tmp]# mkinitrd -v -f myinitrd.img $(uname -r)
Creating initramfs
WARNING: using /tmp for temporary files
Looking for deps of module ide-disk
Looking for deps of module ext3  jbd
Looking for deps of module jbd
Using modules:  ./kernel/fs/jbd/jbd.ko ./kernel/fs/ext3/ext3.ko
/sbin/nash -> /tmp/initrd.Vz3928/bin/nash
/sbin/insmod.static -> /tmp/initrd.Vz3928/bin/insmod
/sbin/udev.static -> /tmp/initrd.Vz3928/sbin/udev
/etc/udev/udev.conf -> /tmp/initrd.Vz3928/etc/udev/udev.conf
copy from /lib/modules/2.6.9-5.EL/./kernel/fs/jbd/jbd.ko(elf32-i386) to /tmp/initrd.Vz3928/lib/jbd.ko(elf32-i386)
copy from /lib/modules/2.6.9-5.EL/./kernel/fs/ext3/ext3.ko(elf32-i386) to /tmp/initrd.Vz3928/lib/ext3.ko(elf32-i386)
Loading module jbd
Loading module ext3

[root@localhost tmp]# file myinitrd.img
myinitrd.img: gzip compressed data, from Unix, max compression

[root@localhost tmp]# mv myinitrd.img  myinitrd.img.gz
[root@localhost tmp]# gzip -d myinitrd.img.gz
[root@localhost tmp]# file myinitrd.img
myinitrd.img: ASCII cpio archive (SVR4 with no CRC)

mkisofs

Create ISO 9660 image file

Additional information

mkisofsThe command is used to create the specified directory and files into an image file in ISO 9660 format for burning a disc.

grammar

mkisofs [选项] [参数]

Options

  • -aOr --all: mkisofsBackup files are not normally processed. Use this parameter to add the backup file to the image file;
  • -A<应用程序id>Or -appid<应用程序ID>: specify the application ID of the disc;
  • -abstract<摘要文件>: Specify the file name of the summary file;
  • -b<开机映像文件>Or -eltorito-boot<开机映像文件>: specify the boot image file required when making a bootable disc;
  • -biblio<ISBN文件>: Specify the file name of the ISBN file. The ISBN file is located in the root directory of the disc and records the ISBN of the disc;
  • -c<开机文件名称>: When making a bootable disc, mkisofsall contents in the boot image file will be treated as one file;
  • -C<盘区编号,盘区编号>: This parameter must be used when combining many sections into one image file;
  • -copyright<版权信息文件>: Specify the file name of the copyright information file;
  • -dOr -omit-period: omit the period after the file;
  • -DOr -disable-deep-relocation: ISO 9660 can only handle directories with up to 8 layers. For those with more than 8 layers, RRIP will automatically set them into an ISO 9660-compatible format. This feature can be turned off using -Dparameters;
  • -for -follow-links: ignore symbolic links;
  • -h: Display help;
  • -hide<目录或文件名>: Make the specified directory or file hidden in ISO 9660 or Rock Ridge Extensions systems;
  • -hide-joliet<目录或文件名>: Make the specified directory or file hidden in the Joliet system;
  • -JOr -joliet: use directory and file names in Joliet format;
  • -lOr -full-iso9660-filenames: use ISO 9660 32-character file name;
  • -LOr -allow-leading-dots: allow the first character of the file name to be a period;
  • -log-file<记录文件>: If there is an error message during execution, it will be displayed on the screen by default;
  • -m<目录或文件名>Or -exclude<目录或文件名>: The specified directory or file name will not be placed in the image file;
  • -M<映像文件>Or -prev-session<映像文件>: merge with the specified image file;
  • -NOr -omit-version-number: Omit the version information in the ISO 9660 file;
  • -o<映像文件>Or -output<映像文件>: specify the name of the image file;
  • -p<数据处理人>or -preparer<数据处理人>: the data processor of the recorded disc;
  • -print-size: Display the estimated file system size;
  • -quiet: No information is displayed during execution;
  • -rOr -rational-rock: Use Rock Ridge Extensions and enable read permissions for all files;
  • -ROr -rock: Use Rock Ridge Extensions;
  • -sysid<系统ID>: Specify the system ID of the disc;
  • -TOr -translation-table: Create a file name conversion table, suitable for systems that do not support Rock Ridge Extensions;
  • -vOr -verbose: display detailed information during execution;
  • -V<光盘ID>Or -volid<光盘ID>: specify the volume set ID of the disc;
  • -volset-size<光盘总数>: Specify the number of discs included in the volume set;
  • -volset-seqno<卷册序号>:Specify the number of the disc in the volume set;
  • -x<目录>: The specified directory will not be placed in the image file;
  • -z: Create a SUSP record for transparent compressed files. This record is currently only valid for Linux on Alpha machines.

parameter

  • 路径: The path that needs to be added to the image file.

Example

mkisofsSteps to use commands to make files into ISO in Linux :

  1. Mount the directory on the NFS server to the local /mnt/nfs/directory:

    mount -t nfs 10.0.2.2:/linuxos/rhel4.0_update3/ /mnt/nfs/

  2. Copy the mounted files to local:

    cp -a /mnt/NFS/* /root/Desktop/rhel4.0/

  3. Find boot.catfiles and delete them:

    find rhel4.0/ -name boot.cat | xargs rm

  4. Find TRANS.TBLfiles and delete them:

    find rhel4.0/ -name TRANS.TBL -exec rm {} \;

  5. Copy the required local files to the specified directory:

    cp /usr/share/comps/i386/.discinfo rhel4.0/

  6. Make all files in the specified directory into ISO files:

    mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 -boot-info-table -V RHEL4ASDVD -b isolinux/isolinux.bin -c isolinux/boot.cat -o /RHEL4AS.iso rhel4.0/

Learn from scratchpython

[Learn python from scratch] 92. Use Python’s requests library to send HTTP requests and process responses
[Learn python from scratch] 91. Use decorators and dictionaries to manage request paths in a simple web application
[Learn python from scratch] 93. Use dictionary management Request path
[Learn python from scratch] 89. Use WSGI to build a simple and efficient Web server
[Learn python from scratch] 88. Detailed explanation of WSGI interface: realize simple and efficient web development
[Learn python from scratch] 87. Manually build an HTTP server in Python Implementation and multi-threaded concurrent processing
[Learn python from scratch] 86. In-depth understanding of the HTTP protocol and its role in browser and server communication
[Learn python from scratch] 85. Application of parallel computing technology in Python process pool
[Learn python from scratch] ] 84. In-depth understanding of threads and processes
[Learn python from scratch] 83. Python multi-process programming and the use of process pools
[Learn python from scratch] 82. Chat program implementation based on multi-threading
[Learn python from scratch] 81. Python more Application of thread communication and queue
[Learn python from scratch] 80. Thread access to global variables and thread safety issues
[Learn python from scratch] 79. Thread access to global variables and thread safety issues
[Learn python from scratch] 78. File download case
[ Learn python from scratch] 77. TCP server programming and precautions
[learn python from scratch] 76. Server and client: key components of network communication
[learn python from scratch] 75. TCP protocol: reliable connection-oriented transmission layer communication protocol
[Learn python from scratch] 74. UDP network program: Detailed explanation of port issues and binding information
[Learn python from scratch] 73. UDP network program - sending data
[Learn python from scratch] 72. In-depth understanding of Socket communication and creation of sockets Method
[Learn python from scratch] 71. Network ports and their functions
[Learn python from scratch] 70. Network communication methods and their applications: from direct communication to routers to connect multiple networks
[Learn python from scratch] 69. Network communication and IP address classification analysis
[Learn python from scratch] 68. Greedy and non-greedy modes in Python regular expressions
[Learn python from scratch] 67. The re module in Python: regular replacement and advanced matching technology
[Learn python from scratch] 66 .In-depth understanding of regular expressions: a powerful tool for pattern matching and text processing
[Learn python from scratch] 65. Detailed explanation of Python regular expression modifiers and their applications
[Learn python from scratch] 64. The re.compile method in Python regular expressions Detailed explanation of usage
[Learn python from scratch] 63. Introduction to the re.Match class and its attributes and methods in regular expressions
[Learn python from scratch] 62. Python regular expressions: a powerful string matching tool
[Learn python from scratch] 61. Detailed explanation and application examples of property attributes in Python
[Learn python from scratch] 60. Exploration generator: a flexible tool for iteration
[Learn python from scratch] 59. Iterator: An efficient tool for optimizing data traversal
[Learn python from scratch] 58. Custom exceptions in Python and methods of raising exceptions
[Learn python from scratch] 57. Use the with keyword in Python to correctly close resources
[Learn python from scratch] 56. The importance and application of exception handling in programming
[Learn python from scratch] 55. Serialization and sum in Python Deserialization, application of JSON and pickle modules
[Learn python from scratch] 54. Writing data in memory
[Learn python from scratch] 53. CSV files and Python’s CSV module
[Learn python from scratch] 52. Reading and writing files - Python file operation guide
[Learn python from scratch] 51. Opening and closing files and their applications in Python
[Learn python from scratch] 49. Object-related built-in functions in Python and their usage
[Learn python from scratch] 48 .Detailed explanation of inheritance and multiple inheritance in Python
[Learn python from scratch] 47. The concept and basic use of inheritance in object-oriented programming
[Learn python from scratch] 46. Analysis of __new__ and __init__ methods and singletons in Python Design Patterns
[Learn python from scratch] 45. Class methods and static methods in Python
[Learn python from scratch] 44. Private properties and methods in object-oriented programming
[Learn python from scratch] 43. Examples in Python object-oriented programming Properties and class attributes
[Learn python from scratch] 42. Built-in properties and methods in Python
[Learn python from scratch] 41. python magic method (2)
[Learn python from scratch] 40. python magic method (1)
[Learn python from scratch] 39. Basic object-oriented syntax and application examples
[Learn python from scratch] 38. How to use and import Python packages
[Learn python from scratch] 37. The use and precautions of Python custom modules
[Learn python from scratch] Learn python] 36. Methods and techniques of using pip for third-party package management in Python
[Learn python from scratch] 35. Python common system modules and their usage
[Learn python from scratch] 34. Detailed explanation of the import and use of Python modules
[ Learn python from scratch] 33. The role of decorators (2)
[Learn python from scratch] 32. The role of decorators (1)
[Learn python from scratch] 31. In-depth understanding of higher-order functions and closures in Python
[From Learn python from scratch】30. In-depth understanding of recursive functions and anonymous functions
【learn python from scratch】29. "Detailed explanation of function parameters" - understand the different uses of Python function parameters
【learn python from scratch】28. Local variables and global variables in Python Variables
[Learn python from scratch] 27. The use of Python functions and nested calls
[Learn python from scratch] 25. Functions: a tool to improve the efficiency of code writing
[Learn python from scratch] 24. String operations and traversal methods in Python
[Learn python from scratch] 23. How to use sets (set) and common operations in Python
[Learn python from scratch] 22. Add, delete, modify, and query dictionary variables in Python
[Learn python from scratch] 21. Python tuples and dictionaries
[Learn python from scratch] 20. Python list operation skills and examples
[Learn python from scratch] 19. Applications of looping through lists and list nesting
[Learn python from scratch] 18. Detailed explanation of the basic operations of Python lists (1)
[From Learning python from scratch】 17. The format method of Python strings (2)
【Learning python from scratch】 16. The format method of Python strings (1)
【Learning python from scratch】 15. In-depth understanding of strings and character set encoding
【From Learning python from scratch】14. Common operations on Python strings (2)
【Learning python from scratch】13. Common operations on Python strings (1)
【Learning python from scratch】12. Python string operations and applications
【Learning python from scratch】 11. Python loop statements and control flow
[Learn python from scratch] 10. Detailed explanation of Python conditional statements and if nesting
[Learn python from scratch] 09. Conditional judgment statements in Python
[Learn python from scratch] 08. Python understands bit operations operator, operator priority
[Learn python from scratch] 07. Detailed explanation of Python operators: assignment, comparison and logical operators
[Learn python from scratch] 06. Use arithmetic operators in Python for calculations and string concatenation
[Learn from scratch] python ] 05. Output and input in Python
[Learn python from scratch] 04. Basics of Python programming: variables, data types and identifiers
[Learn python from scratch] 03. Python interactive programming and detailed explanation of comments
[Learn python from scratch] 02. Introduction to development tools
[Learn python from scratch] 01. Install and configure python

Guess you like

Origin blog.csdn.net/qq_33681891/article/details/132870678