mkdir -p /opt/cd-image
wget http://cdimages.ubuntu.com/lubuntu/releases/trusty/release/lubuntu-14.04.1-alternate-i386.iso
mkdir /mnt/iso mount -o loop lubuntu-14.04.1-alternate-i386.iso /mnt/iso cp -rT /mnt/iso /opt/cd-image umount /mnt/iso
mkdir -p /opt/cd-image/pool/extras
tree -d -L 3 /opt /opt βββ apt-ftparchive βββ build β βββ ubuntu-keyring-2012.05.19 β βββ debian β βββ keyrings βββ cd-image β βββ boot β β βββ grub β βββ dists β β βββ trusty β βββ doc β β βββ install β βββ install β β βββ netboot β βββ isolinux β βββ pics β βββ pool β β βββ extras β β βββ main β β βββ universe β βββ preseed βββ indices
gpg --gen-key gpg (GnuPG) 1.4.16; Copyright (C) 2013 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? 1 RSA keys may be between 1024 and 4096 bits long. What keysize do you want? (2048) Requested keysize is 2048 bits Please specify how long the key should be valid. 0 = key does not expire <n> = key expires in n days <n>w = key expires in n weeks <n>m = key expires in n months <n>y = key expires in n years Key is valid for? (0) Key does not expire at all Is this correct? (y/N) y You need a user ID to identify your key; the software constructs the user ID from the Real Name, Comment and Email Address in this form: "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>" Real name: Alexandr Petrenko Email address: *********@gmail.com Comment: My Signing Key You selected this USER-ID: "Alexandr Petrenko (My Signing Key) <*********@gmail.com>" Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o You need a Passphrase to protect your secret key.
mkdir /opt/build cd /opt/build # apt-get source ubuntu-keyring # cd ubuntu-keyring-2012.05.19/keyrings/ gpg --import < ubuntu-archive-keyring.gpg # , "Signing Key" , gpg --list-keys "Signing Key" pub 1024D/437D05B5 2004-09-12 uid Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com> sub 2048g/79164387 2004-09-12 pub 1024D/FBB75451 2004-12-30 uid Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com> pub 2048R/YOURKEYID 2015-01-28 uid My Signing Key <*********@gmail.com> sub 2048R/KEYID 2015-01-28 # gpg --export FBB75451 437D05B5 YOURKEYID > ubuntu-archive-keyring.gpg # ubuntu-keyring-2012.05.19 cd .. dpkg-buildpackage -rfakeroot -m" <your.email@your.host>" -kYOURKEYID # cd .. cp ubuntu-keyring*deb /opt/cd-image/pool/main/u/ubuntu-keyring
cd /opt/cd-image/pool/main/l/linux/ wget -r -nd --no-parent --accept '*-modules-3.13.0-24*i386.udeb' ftp://security.ubuntu.com/ubuntu/pool/main/l/linux/
#!/bin/bash dpkg --get-selections | while read line do package=`expr "$line" : '\(.*\)install'` echo $package apt-get download $package done for i in *; do mv $i ${i/'1%3a'/''}; done
Dir { ArchiveDir "/opt/cd-image/"; }; TreeDefault { Directory "pool/"; }; BinDirectory "pool/main" { Packages "dists/trusty/main/binary-i386/Packages"; BinOverride "/opt/indices/override.trusty.main"; ExtraOverride "/opt/indices/override.trusty.extra.main"; }; BinDirectory "pool/universe" { Packages "dists/trusty/universe/binary-i386/Packages"; BinOverride "/opt/indices/override.trusty.universe"; }; Default { Packages { Extensions ".deb"; Compress ". gzip"; }; }; Contents { Compress "gzip"; };
Dir { ArchiveDir "/opt/cd-image/"; }; TreeDefault { Directory "pool/"; }; BinDirectory "pool/main" { Packages "dists/trusty/main/debian-installer/binary-i386/Packages"; BinOverride "/opt/indices/override.trusty.main.debian-installer"; }; BinDirectory "pool/universe" { Packages "dists/trusty/universe/debian-installer/binary-i386/Packages"; BinOverride "/opt/indices/override.trusty.universe.debian-installer"; }; Default { Packages { Extensions ".udeb"; Compress ". gzip"; }; }; Contents { Compress "gzip"; };
Dir { ArchiveDir "/opt/cd-image/"; }; TreeDefault { Directory "pool/"; }; BinDirectory "pool/extras" { Packages "dists/trusty/extras/binary-i386/Packages"; }; Default { Packages { Extensions ".deb"; Compress ". gzip"; }; }; Contents { Compress "gzip"; };
APT::FTPArchive::Release::Origin "Ubuntu"; APT::FTPArchive::Release::Label "Ubuntu"; APT::FTPArchive::Release::Suite "trusty"; APT::FTPArchive::Release::Version "14.04"; APT::FTPArchive::Release::Codename "trusty"; APT::FTPArchive::Release::Architectures "i386"; APT::FTPArchive::Release::Components "main restricted extras"; APT::FTPArchive::Release::Description "Ubuntu 14.04 LTS";
#!/bin/bash cd /opt/indices/ DIST=trusty for SUFFIX in extra.main main main.debian-installer universe universe.debian-installer; do wget http://archive.ubuntu.com/ubuntu/indices/override.$DIST.$SUFFIX done
BUILD=/opt/cd-image APTCONF=/opt/apt-ftparchive/release.conf DISTNAME=trusty pushd $BUILD apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-deb.conf apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-udeb.conf apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-extras.conf apt-ftparchive -c $APTCONF release $BUILD/dists/$DISTNAME > $BUILD/dists/$DISTNAME/Release gpg --default-key "YOURKEYID" --output $BUILD/dists/$DISTNAME/Release.gpg -ba $BUILD/dists/$DISTNAME/Release find . -type f -print0 | xargs -0 md5sum > md5sum.txt
IMAGE=custom.iso BUILD=/opt/cd-image/ mkisofs -r -V "Custom Ubuntu Install CD" \ -cache-inodes \ --iso-level 3 -J -l -b isolinux/isolinux.bin \ -c isolinux/boot.cat -no-emul-boot \ -boot-load-size 4 -boot-info-table \ -o $IMAGE $BUILD
sudo grub-install --no-floppy --root-directory=/media/multiboot /dev/sdb
# set timeout=10 # set default=0 # insmod ext2 insmod loopback insmod iso9660 insmod fat insmod part_msdos menuentry "Boot from first hard disk" { set root=(hd1) chainloader +1 } set iso="/custom.iso" menuentry "Custom.iso" { linux /vmlinuz debconf/priority=high shared/ask_device=manual shared/enter_device=/dev/disk/by-label/DISKLABEL iso-scan/filename=$iso auto-install/enable=true debian-installer/language=ru debian-installer/locale=ru_RU.UTF-8 debian-installer/country=RU preseed/file=/cdrom/preseed/custom.seed DEBCONF_DEBUG=5 -- initrd /initrd.gz }
Source: https://habr.com/ru/post/273255/