libdevuansdk

common library for devuan's simple distro kits
git clone https://git.parazyd.org/libdevuansdk
Log | Files | Refs | Submodules | README | LICENSE

commit bee12888270c066091d8b654ea034fc3955ff781
parent bdb94f314fc8062d46c0d4fe767d0cab0989f4c2
Author: Jaromil <jaromil@dyne.org>
Date:   Wed,  8 Jun 2016 22:34:07 +0200

iso also does usr squashfs

Diffstat:
Mzlibs/iso | 64+++++++++++++++++++++++++++++++++++++++++++++-------------------
Mzlibs/sysconf | 189+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 234 insertions(+), 19 deletions(-)

diff --git a/zlibs/iso b/zlibs/iso @@ -46,14 +46,6 @@ iso_prepare() { mkdir -p $isodir/isolinux cp /usr/lib/ISOLINUX/isolinux.bin $isodir/isolinux cp /usr/lib/syslinux/modules/bios/*.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/pwd.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/sysdump.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/meminfo.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/chain.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/ldlinux.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/libcom32.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/libutil.c32 $isodir/isolinux - # cp /usr/lib/syslinux/modules/bios/vesamenu.c32 $isodir/isolinux cat <<EOF > $isodir/isolinux/isolinux.cfg path include menu.cfg @@ -96,8 +88,11 @@ EOF label default menu label ^Boot Devuan $release $version $arch kernel linux - append vga=788 initrd=initrd.img + append vga=788 initrd=initrd.img boot=live EOF +# +# append vga=788 initrd=initrd.img boot=live toram=filesystem.squashfs + } iso_mkinitrd() { @@ -106,13 +101,45 @@ iso_mkinitrd() { freq=($isodir/isolinux/isolinux.bin) ckreq || return 1 - sudo chroot $strapdir update-initramfs -c -k all - cp -v $strapdir/initrd.img $isodir/isolinux/ - cp -v $strapdir/vmlinuz $isodir/isolinux/linux + sudo chroot $strapdir apt-get install -y live-boot live-boot-initramfs-tools extlinux + # sudo chroot $strapdir update-initramfs -u + # sudo chroot $strapdir update-initramfs -c -k all + sudo chroot $strapdir live-update-initramfs -u + + # latest kernel + local kernel="" + for i in ${(f)"$(ls -t $strapdir/boot)"}; do + [[ "$i" =~ "vmlinuz" ]] || continue + kernel=$strapdir/boot/$i + done + # latest ramdisk + local initrd="" + for i in ${(f)"$(ls -t $strapdir/boot)"}; do + [[ "$i" =~ "initrd" ]] || continue + initrd=$strapdir/boot/$i + done + + cp -v $kernel $isodir/isolinux/linux + cp -v $initrd $isodir/isolinux/initrd.img + } iso_mkusr() { - # TODO: mkusr here, Katolaz? + fn iso_mkusr $@ + req=(iso isodir) + ckreq || return 1 + + ztmp + conf_print_usrexcludes > $ztmpfile + + usrdir=$workdir/usr_${os}_${release}_${version}_${arch} + + mkdir -p $usrdir + + rsync -av $strapdir/ $usrdir --exclude-from=$ztmpfile + + mkdir -p $isodir/live + mksquashfs $usrdir/ $isodir/live/filesystem.squashfs } iso_make() { @@ -123,12 +150,11 @@ iso_make() { mkdir -p $outdir - escalate root " -xorriso -as mkisofs -r -J -joliet-long -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin - -partition_offset 16 -V DEVUAN - -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 - -boot-info-table -o $outdir/$iso $isodir -" + sudo xorriso \ + -as mkisofs -r -J -joliet-long -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \ + -partition_offset 16 -V DEVUAN \ + -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \ + -boot-info-table -o $outdir/$iso $isodir notice "$iso ready" ls -lh $outdir/$iso diff --git a/zlibs/sysconf b/zlibs/sysconf @@ -147,3 +147,192 @@ deb-src ${mirror} ${release}-updates ${section} deb-src ${mirror} ${release}-security ${section} EOF } + +conf_print_usrexcludes() { + fn conf_print_usrexcludes +cat <<EOF +# rsync excludes file for refractasnapshot and refractasnapshot-gui +# version 9.2.0 + + +# Exclude some system files. These are required, and you probably +# shouldn't change them. + +- /dev/* +- /cdrom/* +- /media/* +- /swapfile +- /mnt/* +- /sys/* +- /proc/* +- /tmp/* +- /live +- /persistence.conf +- /boot/grub/grub.cfg +- /boot/grub/menu.lst +- /boot/grub/device.map +- /boot/*.bak +- /boot/*.old-dkms +- /etc/udev/rules.d/70-persistent-cd.rules +- /etc/udev/rules.d/70-persistent-net.rules +- /etc/fstab +- /etc/fstab.d/* +- /etc/mtab +- /etc/blkid.tab +- /etc/blkid.tab.old +- /etc/apt/sources.list~ +- /etc/crypttab +- /etc/initramfs-tools/conf.d/resume # see remove-cryptroot and nocrypt.sh +- /etc/initramfs-tools/conf.d/cryptroot # see remove-cryptroot and nocrypt.sh +- /home/snapshot + +# Added for newer version of live-config/live-boot in wheezy +# These are only relevant here if you create a snapshot while +# you're running a live-CD or live-usb. +- /lib/live/overlay +- /lib/live/image +- /lib/live/rootfs +- /lib/live/mount +- /run/* + + +## Entries below are optional. They are included either for privacy +## or to reduce the size of the snapshot. If you have any large +## files or directories, you should exclude them from being copied +## by adding them to this list. +## +## Entries beginning with /home/*/ will affect all users. + + +# Uncomment this to exclude everything in /var/log/ +#- /var/log/* + +# As of version 9.2.0, current log files are truncated, +# and archived log files are excluded. +# +# The next three lines exclude everything in /var/log +# except /var/log/clamav/ (or anything else beginning with "c") and +# /var/log/gdm (or anything beginning with "g"). +# If clamav log files are excluded, freshclam will give errors at boot. +- /var/log/[a-b,A-Z]* +- /var/log/[d-f]* +- /var/log/[h-z]* +- /var/log/*gz + +- /var/cache/apt/archives/*.deb +- /var/cache/apt/pkgcache.bin +- /var/cache/apt/srcpkgcache.bin +- /var/cache/apt/apt-file/* +- /var/cache/debconf/*~old +- /var/lib/apt/lists/* +- /var/lib/apt/*~ +- /var/lib/apt/cdroms.list +- /var/lib/aptitude/*.old +- /var/lib/dhcp/* +- /var/lib/dpkg/*~old +- /var/spool/mail/* +- /var/mail/* +- /var/backups/*.gz +#- /var/backups/*.bak +- /var/lib/dbus/machine-id +- /var/lib/live/config/* + +- /usr/share/icons/*/icon-theme.cache + +- /root/.aptitude +- /root/.bash_history +- /root/.disk-manager.conf +- /root/.fstab.log +- /root/.lesshst +- /root/*/.log +- /root/.local/share/* +- /root/.nano_history +- /root/.synaptic +- /root/.VirtualBox +- /root/.ICEauthority +- /root/.Xauthority +- /root/.links2 + +- /root/.ssh +- /root/[a-zA-Z0-9]* + +- /home/*/.Trash* +- /home/*/.local/share/Trash/* +- /home/*/.mozilla/*/Cache/* +- /home/*/.mozilla/*/urlclassifier3.sqlite +- /home/*/.mozilla/*/places.sqlite +- /home/*/.mozilla/*/cookies.sqlite +- /home/*/.mozilla/*/signons.sqlite +- /home/*/.mozilla/*/formhistory.sqlite +- /home/*/.mozilla/*/downloads.sqlite +- /home/*/.adobe +- /home/*/.aptitude +- /home/*/.bash_history +- /home/*/.cache +- /home/*/.dbus +- /home/*/.gksu* +- /home/*/.gvfs +- /home/*/.lesshst +- /home/*/.log +- /home/*/.macromedia +- /home/*/.nano_history +- /home/*/.pulse* +- /home/*/.recently-used +- /home/*/.recently-used.xbel +- /home/*/.local/share/recently-used.xbel +- /home/*/.thumbnails/large/* +- /home/*/.thumbnails/normal/* +- /home/*/.thumbnails/fail/* +- /home/*/.vbox* +- /home/*/.VirtualBox +- /home/*/VirtualBox\ VMs +#- /home/*/.wine +- /home/*/.xsession-errors* +- /home/*/.ICEauthority +- /home/*/.Xauthority + +# You might want to comment these out if you're making a snapshot for +# your own personal use, not to be shared with others. +- /home/*/.gnupg +- /home/*/.ssh +- /home/*/.xchat2 + +### ignore all non-hidden files in /home/devuan -- KatolaZ -- 2016-05-21 + +- /home/devuan/[a-zA-Z0-9]* + +### +### ignore the symlink /initrd.img -> /boot/initrd.img-`uname -r` +### -- KatolaZ -- 2016-05-21 +### + +- /initrd.img + +# Exclude ssh_host_keys. New ones will be generated upon live boot. +# This fixes a security hole in all versions before 9.0.9-3. +# If you really want to clone your existing ssh host keys +# in your snapshot, comment out these two lines. +#- /etc/ssh/ssh_host_*_key* +#- /etc/ssh/ssh_host_key* + +# Examples of things to exclude in order to keep the image small: +#- /home/fred/Downloads/* +#- /home/*/Music/* +#- /home/user/Pictures/* +#- /home/*/Videos/* + + +# To exclude all hidden files and directories in your home, uncomment +# the next line. You will lose custom desktop configs if you do. +##- /home/*/.[a-z,A-Z,0-9]* + + +#### Exclude the large initramfs -- KatolaZ -- 2016-05-16 + +- /boot/initrd.img* + +#### Exclude inittab backup files -- KatolaZ -- 2016-06-04 + +- /etc/inittab.* +EOF +}