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之后需要加一些配置
-
Enter fs0 in efi shell
-
edit startup.nsh
-
Type words: \EFI\ubuntu\grubx64.efi
-
保存快捷键 F2,退出编辑 F3
-
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
- tar xvf linux-4.19.xxx
- make -j
- 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
- 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