制作iso

If you wanna create a customized ubuntu ISO, it will be useful for you.

Overall ISO bundle related
Get an original ubuntu iso
sudo mount -o loop xxx.iso /mnt/iso
sudo cp /mnt/iso
unsquashfs -no-progress -d workspace/rootfs workspace/orig_iso/casper/filesystem.squashfs
rsync -a --exclude=’/casper/filesystem.squashfs’ workspace/orig_iso/ workspace/new_iso
<Do your change in workspace/rootfs>
sudo mksquashfs workspace/rootfs workspace/new_iso/casper/filesystem.squashfs
sudo genisoimage -r -V “Install CD” -cache-inodes -J -l -b isolinux/isolinux.bin -quiet -no-emul-boot -boot-load-size 4 -boot-info-table -o ./test.iso workspace/new_iso

Init related
lzma -dc -S .lz ./initrd.lz | cpio -id
find . | cpio --create --‘format=newc’ | lzma > …/initrd.lz

gunzip -dc …/initrd.gz | cpio -imvd --no-absolute-filenames

$ file initrd.lz
initrd.lz: gzip compressed data, from Unix, last modified: Sun Feb 8 22:26:04 2015
gunzip initrd.lz

Enable EFI
https://www.youtube.com/watch?v=94Qvh-xDLa8

进入efi shell之后需要加一些配置

  1. Enter fs0 in efi shell

  2. edit startup.nsh

  3. Type words: \EFI\ubuntu\grubx64.efi

  4. 保存快捷键 F2,退出编辑 F3

  5. reset

Files that need to be added to fit v2xrscu.iso
cp initrdfs49/bin/chroot ./bin
cp initrdfs49/bin/rsync
cp initrdfs49/lib/libparted.so.0
cp initrdfs49/lib/libparted.so.0.0.1
initrdfs49/sbin: mke2fs
initrdfs49/sbin: mkfs.vfat
initrdfs49/sbin: parted
initrdfs49/sbin: sfdisk
cp initrdfs49/lib/x86_64-linux-gnu/libreadline.so.6*
cp initrdfs49/lib/x86_64-linux-gnu/libpopt.so.0*

sudo cp ~/iso/kinglong/squashfs/etc/fstabA etc/
sudo cp root/* etc/
sudo cp bin/efibootmgr
sudo cp ~/squashfs/boot/grub/grub.cfg
genisoimage
unsquashfs

ISO skeleton
grub
start into xwindow:

26 menuentry 'Major Security ’ --class ubuntu --class gnu-linux --class gnu --class os ‘gnulinux-simple-3f821c98-5a9f-497f-86bc-6c2ad9a19c41’ --unrestricted {
27 linux /sda1-kernel root=UUID=1d8442af-e86f-452e-8e18-6dd807664810 ro quiet splash
28 initrd /sda1-initrd
29 }
30
31 menuentry 'of Minor Security ’ --class ubuntu --class gnu-linux --class gnu --class os ‘gnulinux-simple-3f821c98-5a9f-497f-86bc-6c2ad9a19c41’ --unrestricted {
32 linux /sda2-kernel root=UUID=27461f75-523a-41a2-ae19-b1d9058f496f ro quiet splash
33 initrd /sda2-initrd
34 }

Start into command line:

linux /sda2-kernel root=UUID=27461f75-523a-41a2-ae19-b1d9058f496f ro text

Sometimes you wanna enter xwindows, please do

service lightdm status

service lightdm start

Compile new kernel

  1. tar xvf linux-4.19.xxx
  2. make -j
  3. make modules_install INSTALL_MOD_PATH=/home/v2x/baidu/adu/v2xrscu/kernel/lib #INSTALL_MOD_STRIP=1 without symbol and the lib will be small
  4. make install INSTALL_PATH=/home/v2x/baidu/adu/v2xrscu/kernel/ /This command will generate a zip kernel name vmlinuz to /boot, also some other files/

To compile kernel, you must install these packages:

libncurses-dev bison flex libelf-dev

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值