├── .gitignore ├── .travis.yml ├── LICENSE.md ├── README.md ├── TESTING.md ├── boot ├── 42_liveiso ├── EFI │ └── BOOT │ │ └── bootx64.efi ├── bin │ ├── deprecated-generate-appimaged-extension │ ├── detect │ ├── detect_arch.sh │ ├── detect_casper.sh │ ├── detect_debian_live.sh │ ├── detect_dracut.sh │ ├── detect_kiwi.sh │ ├── detect_lmc.sh │ ├── detect_loopbackcfg.sh │ ├── detect_mageia.sh │ ├── detect_tumbleweed.sh │ ├── generate-aill-extension │ ├── generate-appimaged-extension │ ├── generate-b43firmware-extension │ ├── generate-dymo-extension │ ├── generate-flash-extension │ └── generate-java-extension ├── customize │ ├── README.md │ └── init ├── deltadir │ ├── etc │ │ ├── rc.d │ │ │ └── init.d │ │ │ │ └── livesys │ │ └── systemd │ │ │ └── system │ │ │ └── default.target.wants │ │ │ └── livesys.service │ └── usr │ │ └── sbin │ │ └── livesys ├── grub │ ├── device.map │ └── grubenv └── iso │ └── additional-initramfs │ ├── casper-patches │ └── scripts │ │ └── local-bottom │ │ └── 15test │ ├── dracut-deltadir-support │ ├── lib │ │ └── dracut │ │ │ └── hooks │ │ │ └── pre-pivot │ │ │ ├── 30-deltadir.sh │ │ │ └── 31-lang.sh │ └── usr │ │ └── lib │ │ └── dracut │ │ └── hooks │ │ └── pre-pivot │ │ ├── 30-deltadir.sh │ │ └── 31-lang.sh │ ├── dracut-overlayfs-support │ └── usr │ │ └── lib │ │ └── dracut │ │ └── hooks │ │ └── pre-pivot │ │ └── 01-liveoverlayfs.sh │ ├── generate │ ├── kiwi-international │ └── kiwi-hooks │ │ └── postmount.sh │ └── mageia-isofrom │ └── usr │ └── lib │ └── dracut │ └── hooks │ ├── initqueue │ └── settled │ │ └── 01-mageia-liveiso.sh │ └── pre-pivot │ ├── 10-isodevice.sh │ └── 11-disable-finish-install.sh └── install.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.gitignore 2 | # Lines that start with '#' are comments. 3 | *~ 4 | *.iso 5 | .Trash-999 6 | boot/deltadir/lib/firmware 7 | EFI/ 8 | boot/grub/fonts/ 9 | boot/grub/i386-pc/ 10 | boot/grub/locale/ 11 | boot/grub/x86_64-efi/ 12 | boot/deltadir/usr/bin/* 13 | *ExtensionImage 14 | */initramfs 15 | */grub.cfg 16 | .Spotlight-V100/ 17 | .TemporaryItems/ 18 | ._* 19 | .fseventsd/ 20 | initramfs 21 | grub.cfg 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: gcc 3 | sudo: require 4 | dist: trusty 5 | 6 | env: 7 | - ISO="http://us.cdimage.ubuntu.com/xubuntu/releases/19.04/release/xubuntu-19.04-desktop-amd64.iso" 8 | - ISO="" 9 | 10 | install: 11 | - sudo apt-get -y install util-linux dosfstools mtools kpartx grub-pc-bin grub-common grub-efi-amd64-bin parted util-linux # grub-efi-amd64 conflicts grub-pc 12 | 13 | script: 14 | - set -e # Stop on errors, https://github.com/travis-ci/travis-ci/issues/1066 15 | - cd .. 16 | - if [ -z "$ISO" ] ; then dd if=/dev/zero of=boot.img count=64 bs=1M ; fi #### 64 17 | - if [ ! -z "$ISO" ] ; then wget -c -nv "$ISO" ; fi 18 | - if [ ! -z "$ISO" ] ; then SIZE=$(($(ls -lh --block-size=M *.iso | cut -d " " -f 5 | cut -d M -f 1) + 100)) ; fi # 100 MB larger than ISO 19 | - if [ ! -z "$ISO" ] ; then dd if=/dev/zero of=boot.img count=$SIZE bs=1M ; fi 20 | - parted --script boot.img mklabel msdos mkpart p fat32 1 100% set 1 boot on # # Make the partition table, partition and set it bootable 21 | - # http://nairobi-embedded.org/making_a_qemu_disk_image_bootable_with_grub.html#installing-grub-in-the-disk-image 22 | - sudo kpartx -av boot.img 23 | - sudo mkdir mnt 24 | - sudo losetup /dev/loop1 /dev/mapper/loop0p1 25 | - sleep 1 26 | # If you get the message WARNING: Not enough clusters for a 32 bit FAT!, reduce cluster size with mkfs.fat -s2 -F32 ... or -s1; 27 | # otherwise the partition may be unreadable by UEFI. See mkfs.fat(8) for supported cluster sizes. 28 | # https://wiki.archlinux.org/index.php/EFI_system_partition#MBR_partitioned_disks 29 | - sudo mkfs.vfat -s1 -F32 /dev/mapper/loop0p1 30 | - sudo mount /dev/loop1 mnt 31 | - sudo df -h 32 | - sudo cp -r SystemImageKit/* ./mnt/ 33 | - if [ ! -z "$ISO" ] ; then sudo mv *.iso ./mnt/boot/iso/ ; fi 34 | - sudo parted /dev/loop0 set 1 boot on # Set boot flag 35 | - # https://superuser.com/a/200442 36 | - sudo rm -rf ./mnt/boot/grub/device.map # grub-install: warning: the device.map entry `hd0,1' is invalid. Ignoring it. Please correct or delete your device.map. 37 | - sudo grub-install --modules="biosdisk part_msdos configfile normal multiboot" --no-floppy --boot-directory=./mnt/boot /dev/loop0 38 | - sudo mkdir -p ./mnt/boot/efi ./mnt/EFI/ 39 | - sudo grub-install --target=x86_64-efi --boot-directory=./mnt/boot --efi-directory=./mnt/boot/efi /dev/mapper/loop0p1 40 | - sudo mv ./mnt/boot/EFI/BOOT ./mnt/EFI/BOOT 41 | - sudo bash -e ./mnt/boot/iso/additional-initramfs/generate # Generate additional initrd (gets loaded in addition to the one on the ISO) 42 | - sudo find ./mnt/ 43 | - sudo ./mnt/boot/bin/detect # Configure bootloader 44 | - sudo cat ./mnt/boot/grub/grub.cfg 45 | - sudo find ./mnt/boot/bin/generate-appimaged* -exec bash {} \; # Create and install ExtensionImage 46 | - sudo umount ./mnt 47 | - sudo fdisk -l /dev/loop0 48 | - sudo losetup -d /dev/loop1 49 | - sudo kpartx -v -d /dev/loop0 50 | - ls -lh . 51 | - VERSION=$(cd SystemImageKit ; git rev-parse --short HEAD) 52 | # travis_wait 30 xz -0 boot.img 53 | - if [ ! -z "$ISO" ] ; then SUFFIX=$(basename $ISO | cut -d "-" -f 1-2) ; fi 54 | # mv boot.img.xz BootImage-$SUFFIX-$VERSION-x86_64.img.xz # takes time 55 | - mv boot.img BootImage-$SUFFIX-$VERSION-x86_64.img 56 | - ls -lh 57 | 58 | after_success: 59 | - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh 60 | # bash upload.sh ./*.xz 61 | - bash upload.sh ./*.img 62 | 63 | branches: 64 | except: 65 | - # Do not build tags that we create when we upload to GitHub Releases 66 | - /^(?i:continuous)/ 67 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2005-20 Simon Peter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SystemImageKit 2 | 3 | Image-based computing: Operating system complexity reduction by encapsulation. 4 | 5 | ![grub](https://user-images.githubusercontent.com/2480569/32960053-e1b345d4-cbc3-11e7-9f34-c1cc11b5b1c7.png) 6 | 7 | SystemImageKit lets you run Fedora, CentOS, Ubuntu, Debian, and openSUSE (based) live systems, all directly from unchanged live ISOs all stored on the same physical medium (e.g., USB drive). Currently support for the live booting systems of the mentioned distributions is built in, but the system is modular so that detection scripts for other distributions can be added relatively easily. 8 | 9 | SystemImageKit also has means to customize every aspect of the boot process and the booted system, so that you can customize the live systems without having to remaster their live ISOs. It does so by allowing you to overlay files in the initramfs and to overlay files in the booted system. 10 | 11 | ## Installing 12 | 13 | The following steps illustrate how to install an Operating System onto a USB drive using SystemImageKit. 14 | 15 | In order to do this, boot Ubuntu Live system (tested with Ubuntu 14.04 LTS Trusty Tahr) and run the following script. 16 | 17 | __NOTE:__ All data on /dev/sdX will be deleted. 18 | 19 | https://raw.githubusercontent.com/probonopd/SystemImageKit/master/install.sh 20 | 21 | If you format the device manually and run into "error: will not proceed with blocklists", then use gparted to move the start of the first partition up 1MB. This works without having to reformat the device. 22 | 23 | We need to do this only once. 24 | Whenever we add additional ISOs, we just have to re-run (the example is for a running Ubuntu Live system): 25 | 26 | ``` 27 | sudo /isodevice/boot/generate 28 | ``` 29 | 30 | ## The challenge 31 | 32 | Today's operating sytems are hugely complex collections of various files, which are scattered on the mass storage in a way that 33 | makes it hard for end users to understand, maintain, and upgrade. Here, a way of encapsulating - and thus, making more 34 | manageable - this complexity is proposed. 35 | 36 | An earlier paper of the same author, AppImageKit documentation, has been cited frequently, and has even made it into the Wikipedia 37 | article on distributions. However, it has focused solely on the the applications aspect. Here, a more comprehensive, and more 38 | rigorous, plan of systems architecture is described. 39 | 40 | Today's operating systems are organized in a way that is logical for developers but not logical for end users. 41 | 42 | Typical end users think of the contents of their computers as: 43 | * 1 operating system (e.g., RHEL7) 44 | * 1 system extension (e.g., WLAN chip firmware) 45 | * 3 apps (e.g., OpenOffice, Firefox, VLC) 46 | * 1 set of settings 47 | * 300 files being worked on 48 | 49 | Instead, most operating systems are organized in a way that they do not confront the user with 306 files (which the user could 50 | understand) but rather with tens to hundreds of thousands of files (99% of which the user does not understand, and does not want to 51 | manage). 52 | 53 | Some operating sytems have tried to keep the number of files manageable and understandable by the end user (e.g., early versions of 54 | the Macintosh System Software), but with the ever increasing complexity and size of modern operating systems like Unix and Windows, 55 | the number of files grew while no really useful abstractions have been introduced to help the user regain control over all these 56 | files. Instead, installers and uninstallers (Windows) and package managers (Unix) have been created. In this process, the user 57 | became increasingly dependent on these tools. 58 | 59 | On desktop systems, files in the filesystem can broadly be categorized into 60 | * Files installed by the operating system 61 | * Files installed as operating system extensions (e.g., firmware, codecs) 62 | * Files installed by applications 63 | * Files created by the administrator or user to customize the system (e.g., configuration files) 64 | * Files created by the user as work products (e.g., documents) 65 | 66 | On most operating system setups, these are intermingled more or less in the same filesystem, which creates increasing complexity. 67 | Because on most setups these files are distributed througout the filesystem, it is hard to 68 | 69 | * Run a virtually unlimited number of operating systems on the same machine without partitioning 70 | * Run multiple versions of the same operating system while retaining all extensions, settings, applications, and user data 71 | * Try a new operating system version with no danger to the system before deciding whether to keep it 72 | * Delete an old operating system only after having verified for some time that the new version works well 73 | * Run different architectures (e.g., 32-bit and 64-bit) of the same operating system while retaining all settings and user data 74 | * Run different operating systems (e.g., RHEL, CentOS, Fedora, debian, Ubuntu) while retaining all extensions, settings, 75 | applications, and user data 76 | * Reset the operating system into original "factory" state while retaining or selectively removing extensions, settings, 77 | applications, and user data 78 | * Run two different versions of the same app alongside 79 | * Install extensions and apps without the help of installers or package managers 80 | * Completely remove extensions and apps without "leftovers" without the help of uninstaller tools or package managers 81 | * Quickly verify that the system has not been modified and is in a "sane" state, e.g., using a checksum 82 | * Allow for any kind of non-permanent modification in the system, because the system is reset to a "known good" state at each 83 | reboot 84 | * Move installed operating systems, and/or extensions, applications, customizations from one computer to another 85 | 86 | Many of the issues above are caused by the "tight coupling" of operating system, extensions, applications, and customizations by the 87 | way of the file system. The key to resolving the issues described above is encapsulation of the logical units used in a computer 88 | system. 89 | 90 | ## The solution 91 | 92 | System-level virtuaization has been used to address some of the issues above (e.g., running multiple operating systems 93 | easily on the 94 | same system, being able to reset systems by using snapshots) . However, system-level virtualization (e.g., VMware, VirtualBox, qemu) 95 | comes at a performance penalty, and unnecessarily increases complexity by requiring a host 96 | operating system on which a guest operating system is run. Yet, it does not solve some of the issues mentioned above (e.g., 97 | applying a set of customizations to multiple operating systems). 98 | 99 | By setting up the operating system in a way proposed here, it is possible to achieve the above use cases easily. We define 100 | objects for the categories mentioned above as follows: 101 | * A bootloader that is capable of booting image files 102 | * One file per operating system 103 | * One file per operating system extension (e.g., firmware, set of codecs) 104 | * One file per application 105 | * One file to customize the system 106 | * Files created by the user as work products (e.g., documents) 107 | 108 | In the implementation described here, we use: 109 | * grub2 with custom helper scripts 110 | * ISO files, containing one live operating system each 111 | * ExtensionImage files, the contents of which are symlinked into the / upon boot 112 | * AppImage files, the contents of which are mounted when the app is executed 113 | * An init file that does local configuration and is run when the system boots (and an auxiliary initrd that helps loading this 114 | configuration) 115 | * Files in $HOME which is mounted from a persistent location 116 | 117 | In the following paragraphs, each of these components is discussed. 118 | 119 | ### Bootloader 120 | 121 | We use grub2, a bootloader that is capable of booting operating systems contained in ISO image files. grub2 can loop-mount an ISO 122 | file and load the kernel and the initrd from the ISO. What happens once the kernel has control is up to the operating system. 123 | Luckily, many common operating systems (such as CentOS, Fedora, debian, Ubuntu and openSUSE) nowadays are capable of loop-mounting 124 | ISO files and continue the boot process from there (at least with a little help in the form of an additional, secondary initrd image 125 | that patches the functionality if required, e.g., for openSUSE). We use a helper script to generate the secondary initrd 126 | image. The contents of this image are loaded in addition to the contents of the original initrd image supplied on the operating system ISO. 127 | 128 | The advantage of using the bootloader in the way described is that virtually unlimited operating systems can be booted on a computer without having to partition the mass storage. 129 | 130 | ### Operating system ISO files 131 | 132 | Many common operating systems (such as CentOS, Fedora, debian, Ubuntu and openSUSE) nowadays provide readymade Live systems 133 | (originally intended to run from CD-ROM and/or DVD) which are ideal for our purpose, because they provide defined baseline sets of 134 | software that we can expect to be installed in each system. For example, if we use the CentOS 7 live ISO we know exactly the set of 135 | software included therein, and can assume this to be present on any computer running the CentOS 7 live ISO. This is important, as it 136 | allows us to simplify dependency management substantially. Also, live systems are non-persistent by default, which means that 137 | changes can be made to all aspects of the system but after a reboot, the system is back to its original condition ("stateless"). As mentioned above, some live ISOs are not designed to be booted without being burnt to a CD-ROM and/or DVD (e.g., openSUSE), but by adding a secondary initrd image we can patch the required functionality in without having to remaster the ISO. 138 | 139 | The advantage of using live system ISO files in the way described is that operating systems can be added and removed very easily, 140 | and at each reboot the system is back to its original condition. 141 | 142 | ### ExtensionImage files 143 | 144 | Some software deeply integrates with the operating system and is not an app. For example, some wireless network cards require binary 145 | firmware blobs to be loaded into the hardware upon boot. These firmware blobs are installed into the operating system, so that they 146 | can be loaded by the system at the appropriate time. An ExtensionImage is a file which contains one such operating system extension, 147 | no matter how many files it consists of. The files contained in the ExtensionImage are linked into the appropriate positions in the 148 | operating system at an early stage at boot, so that the operating system can pick them up from there. 149 | 150 | The advantage of using ExtensionsImage files is that every extension is one file and can therefore be intuitively managed by the 151 | user (e.g., installed, upgraded, removed, and moved to another machine). 152 | 153 | ### AppImage files 154 | 155 | An app often consists of a hundred files in addition to the main binary, e.g., icons, graphics, language files, and other 156 | auxiliary files. Frequently, an app also requires libraries which are not normally part of the operating system. In this case, the 157 | corresponding libraries have to be installed into the system prior to running the app. By using AppImages, all of this is abstracted by encapsulating each app with all the auxiliary files and libraries that it needs to run which are not part of the operating system. 158 | 159 | The advantage of using AppImage files is that every app is one file and can therefore be intuitively managed by the user (e.g., 160 | installed, upgraded, removed, and moved to another machine). Also, by bundling the dependencies which are not part of the operating 161 | systems, several versions of the same app can be installed alongside, even if they require incompatible versions of dependencies. 162 | 163 | ### Files in $HOME 164 | 165 | Since the operating system is run from a live system, changes to the running system are non-persistent by default, which means that 166 | user data in $HOME is deleted whenever the machine is shut down. Hence, it is advisable to mount the $HOME directory from a 167 | persistent location, e.g., a data partition or data loopback file, or from a network share. 168 | 169 | The advantage of using $HOME in this way is that user data is preserved between boots, while the rest of the system is in a clean 170 | state after every boot. 171 | 172 | ## The result 173 | 174 | In the system proposed here, what does the typical end user see? 175 | 176 | ``` 177 | /boot 178 | /boot/iso 179 | /boot/iso/fedora.iso 180 | /boot/customize/init 181 | /boot/grub 182 | /boot/grub/grub.cfg 183 | /boot/bin/detect 184 | /boot/extensions/b43firmware.ExtensionImage 185 | /apps/ 186 | /apps/Firefox.AppImage 187 | /apps/OpenOffice.AppImage 188 | /apps/VLC.AppImage 189 | ``` 190 | 191 | Some additional bootloader and helper files are left out here for brevity, but the total set of files to be managed is much more 192 | concise than on a traditional operating system, and in the hundreds rather than in the hundreds of thousands. 193 | 194 | Also, "regular users" get the freedom to do things never imagined before: 195 | 196 | ``` 197 | /boot/iso/fedora.iso 198 | /boot/iso/ubuntu_32bit.iso 199 | /boot/iso/ubuntu_64bit.iso 200 | /apps/Firefox_20.AppImage 201 | /apps/Firefox_24.AppImage 202 | /apps/Firefox_25_nightly.AppImage 203 | ``` 204 | 205 | The system proposed here allows not only for substantial complexity reduction by a factor of thousand, but also allows normal end 206 | users to try out operating systems and apps more easily, without having to "commit" to them (in the form of "installing"). This is 207 | done by removing the tight coupling between and by encapsulating operating systems, operating system extensions, applications, customizations, and user data. 208 | Unlike with system-level virtualization, the performace overhead involved is relatively minor. 209 | 210 | ## References 211 | 212 | https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Workstation_live_medium GRUB2 loopback examples for many types of Live ISOs 213 | -------------------------------------------------------------------------------- /TESTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | Flash BootImage.img to a USB stick, `/dev/sdc` in the example below. 4 | 5 | ## Mac 6 | 7 | ### BIOS emulation ("Windows") on Mac 8 | 9 | ``` 10 | This is not a bootable disk. Please insert a bootable floppy and 11 | press any key to try again ... 12 | ``` 13 | 14 | Reason unknown. 15 | 16 | ### EFI on Mac 17 | 18 | Works. 19 | 20 | ## QEMU 21 | 22 | ### BIOS on QEMU 23 | 24 | Works. 25 | 26 | ``` 27 | sudo apt -y install qemu-system-x86 28 | sudo qemu-system-x86_64 -enable-kvm -localtime -m 2G -vga std -drive file=/dev/sdc,readonly,cache=none,format=raw,if=virtio 29 | ``` 30 | 31 | Note: Without `-m 1G` it boots, but hangs in the emergency busybox shell. 32 | 33 | ### EFI on QEMU 34 | 35 | Works. 36 | 37 | ``` 38 | sudo apt -y install qemu-system-x86 ovmf 39 | sudo qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -enable-kvm -localtime -m 2G -vga std -drive file=/dev/sdc,readonly,cache=none,format=raw,if=virtio 40 | ``` 41 | 42 | Note: As part of the BootImage generation process, need to have copied 43 | 44 | ``` 45 | me@host:~$ ls /cdrom/EFI/BOOT/ 46 | BOOTx64.EFI grubx64.efi 47 | 48 | me@host:~$ find /cdrom/EFI/ 49 | /cdrom/EFI/ 50 | /cdrom/EFI/BOOT 51 | /cdrom/EFI/BOOT/BOOTx64.EFI 52 | /cdrom/EFI/BOOT/grubx64.efi 53 | ``` 54 | 55 | If we have not done this, 56 | 57 | then, at the `grub>` prompt, enter (using tab completion): 58 | 59 | ``` 60 | grub> configfile (hd0,msdos1)/boot/grub/grub.cfg 61 | ``` 62 | 63 | Note: But then we get: 64 | 65 | ``` 66 | error: can't find command 'loopback'. 67 | error: can't find command 'linux'. 68 | error: can't find command 'initrd'. 69 | 70 | Press any key to continue... 71 | ``` 72 | 73 | Why? 74 | -------------------------------------------------------------------------------- /boot/42_liveiso: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Filename: 42_live-iso 3 | # Purpose: grub-mkconfig helper script for many different Live ISO systems 4 | # Working: 5 | # * ubuntu-12.04.2-desktop-i386.iso and other Casper-based systems 6 | # * binary.hybrid.iso and other debian-live 3.x based systems 7 | # * kali-linux-1.0.3-i386.iso 8 | # * Fedora-Live-Desktop-i686-19-1.iso and other Dracut 029 based systems 9 | # * debian-live-7.5.0-i386-gnome-desktop.iso 10 | # * debian-live-7.5-i386-gnome-desktop+nonfree.iso 11 | # * Fedora-Live-Desktop-i686-20-1.iso 12 | # * Fedora-Live-Xfce-i686-20-1.iso 13 | # * kali-linux-1.0.7-i386.iso 14 | # * netrunner-13.12-dvd-32bit.iso 15 | # * openSUSE-13.1-GNOME-Live-i686.iso 16 | # * redobackup-livecd-1.0.4.iso 17 | # * ubuntu-14.04-desktop-i386.iso 18 | # Not working yet (FIXME): 19 | # * webc-20.0.iso 20 | # * clonezilla-live-2.1.1-25-i686-pae.iso 21 | # * tails-i386-0.19.iso and other debian-live 2.x based systems 22 | # * live-2.2.1.iso 23 | # Authors: probono (c) 2013-14 24 | # based on previous work by the Grml team (grml.org), 25 | # (c) Andreas Gredler , Michael Prokop 26 | # License: This file is licensed under the GPL v2+. 27 | # Changelog: 28 | # 2014-05-25 29 | # * Allow for generate script to be run from live USB system 30 | # * Redirect generate script output to 1>&2 31 | # * insmod part_msdos 32 | # 2014-08-11 33 | # * Use iso/ location relative to this script 34 | ######################################################################################## 35 | 36 | # Test with 37 | # sudo qemu -hda /dev/sdX -snapshot 38 | 39 | # Temporarily disable GNOME automount 40 | # also for Unity in Ubuntu 11.04 and later 41 | gsettings set org.gnome.desktop.media-handling automount 'false' 42 | 43 | # Exit on errors 44 | set -e 45 | 46 | echo "insmod part_msdos" 47 | 48 | 49 | prefix=/usr 50 | exec_prefix=${prefix} 51 | bindir=${exec_prefix}/bin 52 | libdir=${exec_prefix}/lib 53 | 54 | if [ -e "/usr/lib/grub/grub-mkconfig_lib" ] ; then 55 | . /usr/lib/grub/grub-mkconfig_lib # Ubuntu 56 | fi 57 | 58 | if [ -e "/usr/share/grub/grub-mkconfig_lib" ] ; then 59 | . /usr/share/grub/grub-mkconfig_lib # Fedora 60 | fi 61 | 62 | if [ -e "/usr/share/grub2/grub-mkconfig_lib" ] ; then 63 | . /usr/share/grub2/grub-mkconfig_lib # openSUSE 64 | fi 65 | 66 | 67 | # default unless configured otherwise: 68 | # Casper 69 | if [ -e "/isodevice/boot/iso" ] ; then 70 | BOOT_MOUNTPOINT="/isodevice/boot" 71 | fi 72 | 73 | # Dracut 74 | if [ -e "/run/initramfs/isoscan/boot" ] ; then 75 | BOOT_MOUNTPOINT="/run/initramfs/isoscan/boot" 76 | fi 77 | 78 | # debian-live 79 | if [ -e "/lib/live/mount/findiso/boot" ] ; then 80 | BOOT_MOUNTPOINT="/lib/live/mount/findiso/boot" 81 | fi 82 | 83 | # KIWI 84 | if [ -e "/isofrom/boot" ] ; then 85 | BOOT_MOUNTPOINT="/isofrom/boot" 86 | fi 87 | 88 | # Relative to this script 89 | HERE=$(dirname $(readlink -f "${0}")) 90 | if [ -e "${HERE}/iso" ] ; then 91 | BOOT_MOUNTPOINT="${HERE}" 92 | fi 93 | 94 | ISO_LOCATION=$BOOT_MOUNTPOINT"/iso" 95 | ADDITIONAL_INITRAMFS=$BOOT_MOUNTPOINT"/iso/additional-initramfs/initramfs" 96 | ADDITIONAL_GENERATE=$BOOT_MOUNTPOINT"/iso/additional-initramfs/generate" 97 | rel_additional_initramfs="$(make_system_path_relative_to_its_root $ADDITIONAL_INITRAMFS)" 98 | 99 | # Default 100 | # XKBLAYOUT=de 101 | # 102 | # if [ -e "/etc/default/keyboard" ] ; then 103 | # . /etc/default/keyboard 104 | # fi 105 | # 106 | # KEYBOARD=$XKBLAYOUT # "de" 107 | KEYBOARD=de 108 | 109 | # LANGUAGE=$LANG # "de_DE.UTF-8" 110 | LANGUAGE=de_DE.UTF-8 111 | 112 | # TIMEZONE=$(cat /etc/timezone) # "Europe/Berlin" 113 | TIMEZONE="Europe/Berlin" 114 | 115 | USER="me" 116 | HOST="host" 117 | 118 | if [ -r /etc/default/live-iso-boot ] ; then 119 | . /etc/default/live-iso-boot 120 | fi 121 | 122 | ROOTDEV=$(mount | grep "on / type" | cut -d " " -f 1) 123 | 124 | # http://live.debian.net/manpages/3.x/en/txt/live-config.7.txt 125 | DEBIAN_LIVE_3_ARGS="for-debian-live-3 --> findiso=\${iso_path} live-config.keyboard-layouts=$KEYBOARD live-config.locales=$LANGUAGE live-config.timezone=$TIMEZONE live-config.username=$USER live-config.hostname=$HOST" # debian-live systems 126 | 127 | # http://live.debian.net/manpages/2.x/en/txt/live-boot.7.txt 128 | # $ROOTDEV = /dev/sdX 129 | # Currently not working yet, gives 130 | # losetup /dev/loop0: No such file or directory 131 | # mkdir: can't create directory '/isofrom': File exists 132 | # mount: mounting /dev/sda1 on /isofrom failed: No such file or directory 133 | # or 134 | # Warning: device for bootoption fromiso= (/boot/iso/tails-i386-0.19.iso) not found 135 | DEBIAN_LIVE_2_ARGS="for-debian-live-2 --> fromiso=$ROOTDEV/\${iso_path} live-config.keyboard-layouts=$KEYBOARD live-config.locales=$LANGUAGE live-config.timezone=$TIMEZONE live-config.username=$USER live-config.hostname=$HOST" 136 | 137 | # Which distros use this? 138 | # fromhd=$ROOTDEV fromiso=\${iso_path} 139 | 140 | # http://manpages.ubuntu.com/manpages/precise/man7/casper.7.html 141 | CASPER_ARGS="for-casper --> iso-scan/filename=\${iso_path} console-setup/layoutcode=$KEYBOARD locale=$LANGUAGE timezone=$TIMEZONE username=$USER hostname=$HOST noprompt init=/isodevice/boot/customize/init" # casper-based systems besides Ubuntu (which has loopback.cfg) 142 | 143 | # http://people.redhat.com/harald/dracut.html 144 | # Dracut seems to be changing the required args frequently 145 | # In F19 it expects something like 146 | # iso-scan/filename=/boot/iso/Fedora-Live-Desktop-i686-19-1.iso root=live:CDLABEL=Fedora-Live-Desktop-i686-19-1 147 | # rootfstype=auto ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0 148 | # To pass in language and keyboard, still need to patch files as of Fedora 19 149 | DRACUT_F19_ARGS="for-dracut --> iso-scan/filename=\${iso_path} selinux=0 rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir vconsole.keymap=$KEYBOARD locale.LANG=$LANGUAGE" 150 | # the rest will be parsed from the ISO itself 151 | 152 | #cat << EOF 153 | # 154 | # args="$DEBIAN_LIVE_ARGS $CASPER_ARGS custom--> $CUSTOM_BOOTOPTIONS additional--> $additional_param parsed_from_iso-->" 155 | # export args 156 | # 157 | #EOF 158 | 159 | # openSUSE uses KIWI 160 | # https://bugzilla.novell.com/show_bug.cgi?id=805771#c4 161 | # https://github.com/openSUSE/kiwi/commit/98369480629c54e1e2610fae7d9e21d93aae23a3 162 | KIWI_ARGS="for-kiwi --> isofrom_device=/dev/sda1 isofrom_system=\${iso_path} lang=$LANGUAGE" 163 | 164 | resolve_dm_name() { 165 | retval="$1" 166 | base=${1##*/} 167 | for block in /sys/block /sys/class/block ; do 168 | [ ! -d ${block}/${base}/dm ] && continue 169 | retval="/dev/mapper/$(cat ${block}/${base}/dm/name)" 170 | break 171 | done 172 | case "$retval" in 173 | /dev/dm-*) 174 | minor=${retval##*-} 175 | retval="/dev/mapper/$(dmsetup info -C --noheadings -o name -j 253 -m $minor)" 176 | ;; 177 | esac 178 | 179 | echo "$retval" 180 | } 181 | 182 | get_dependencies() { 183 | device=${1} 184 | if [ -z ${device} ] ; then 185 | return 186 | fi 187 | device=$(readlink -f ${device}) 188 | case "$device" in 189 | /dev/mapper/*) 190 | device="/dev/dm-$(dmsetup info -C --noheadings -o minor "$device")" 191 | ;; 192 | esac 193 | 194 | base=${device##*/} 195 | dependencies="" 196 | additional_dependencies="" 197 | for block in /sys/block /sys/class/block ; do 198 | [ ! -d ${block}/${base}/slaves ] && continue 199 | for file in ${block}/${base}/slaves/* ; do 200 | dep_name="/dev/${file##*/}" 201 | dep_name=$(resolve_dm_name ${dep_name}) 202 | 203 | # resolve recursively all dependencies 204 | additional_dependencies=$(get_dependencies ${dep_name}) 205 | 206 | dependencies="$dependencies $additional_dependencies $dep_name" 207 | done 208 | break 209 | done 210 | echo $dependencies 211 | 212 | } 213 | 214 | iso_list="" 215 | for file in "${ISO_LOCATION}"/*.iso ; do 216 | if grub_file_is_not_garbage "$file" ; then 217 | iso_list="$iso_list $file " 218 | fi 219 | done 220 | 221 | sh $ADDITIONAL_GENERATE 1>&2 222 | 223 | for the_iso in $iso_list ; do 224 | 225 | rel_dirname="$(make_system_path_relative_to_its_root $(dirname $the_iso))" 226 | iso_name="$(basename $the_iso)" 227 | device="$(${grub_probe} -t device ${the_iso})" 228 | 229 | additional_param="" 230 | 231 | case "$device" in 232 | /dev/mapper*|/dev/md*) 233 | dependencies=$(get_dependencies ${device}) 234 | dep_string="" 235 | for dep in $dependencies $device ; do 236 | dep_string="$dep_string,$dep" 237 | done 238 | dep_string=${dep_string#,} 239 | additional_param="live-media=$dep_string" 240 | ;; 241 | esac 242 | 243 | title="$iso_name" 244 | M=/tmp/.__mount/ 245 | mkdir $M 246 | mount -o ro "$the_iso" $M 247 | #ls $M >&2 248 | 249 | # Ubuntu has loopback.cfg, debian-live systems have live.cfg, Fedora 19 has isolinux.cfg, some have EFI/grub.cfg 250 | unset CONFIG 251 | CONFIG=$(find $M -name loopback.cfg | head -n 1 | sed -e "s|$M|/|g") 252 | if [ -z "$CONFIG" ] ; then 253 | CONFIG=$(find $M -name live.cfg | head -n 1 | sed -e "s|$M|/|g") 254 | fi 255 | if [ -z "$CONFIG" ] ; then 256 | CONFIG=$(find $M -name isolinux.cfg | head -n 1 | sed -e "s|$M|/|g") 257 | fi 258 | if [ -z "$CONFIG" ] ; then 259 | CONFIG=$(find $M -name grub.cfg | head -n 1 | sed -e "s|$M|/|g") 260 | fi 261 | 262 | if [ ! -f $M/$CONFIG ] ; then 263 | echo " .cfg not found, skipping" >&2 264 | umount $M 265 | rm -r $M 266 | continue 267 | fi 268 | 269 | # Everyone is welcome to improve the regex; be sure to test on a *lot* of different live ISOs 270 | unset INITRD 271 | unset KERNEL 272 | unset ARGS 273 | KERNEL=$(grep "vmlinu" $M/$CONFIG | head -n 1 | grep -o -e '/[[:alnum:]\/\.\-\_]*' | head -n 1 ) 274 | INITRD=$(grep "initrd" $M/$CONFIG | head -n 1 | grep -o -e '/[[:alnum:]\/\.\-\_]*' | head -n 1 ) 275 | ARGS=$(grep "boot=" $M/$CONFIG | sed -e "s|linux\t||" | head -n 1 | sed -e "s|append ||" \ 276 | -e "s|initrd=||" -e "s|$KERNEL||" -e "s|linux ||" -e "s|\t||" -e 's/^ *//g' -e 's/ *$//g' -e "s|$INITRD ||") 277 | echo $ARGS >&2 278 | if [ -z "$ARGS" ] ; then 279 | # Fedora 19 uses isolinux.cfg 280 | KERNELNAME=$(grep "kernel" $M/$CONFIG | head -n 1 | awk '{ print $2; }') 281 | echo "KERNELNAME $KERNELNAME from $M/$CONFIG" >&2 282 | KERNEL=$(find $M -name $KERNELNAME | head -n 1 | sed -e "s|$M|/|g") 283 | INITRDNAME=$(grep "append" $M/$CONFIG | head -n 1 | awk '{ print $2; }' | sed -e 's|initrd=||g' ) 284 | echo $INITRDNAME >&2 285 | INITRD=$(find $M -name $INITRDNAME | head -n 1 | sed -e "s|$M|/|g") 286 | ARGS=$(grep "root=live" $M/$CONFIG | sed -e "s|linux\t||" | head -n 1 | sed -e "s|append ||" \ 287 | -e "s|initrd=||" -e "s|$KERNELNAME||" -e "s|linux ||" -e "s|\t||" -e 's/^ *//g' \ 288 | -e 's/ *$//g' -e "s|$INITRDNAME ||" ) # For KIWI, I do this specifically below (easier) 289 | fi 290 | 291 | # Find a human-readable name for the ISO 292 | unset NAME 293 | # if [ -e $M/.disk/info ] ; then 294 | # NAME=$(cat $M/.disk/info | head -n 1 | sed -e 's|\"||g') 295 | # fi 296 | 297 | # If we did not find a name, we use the ISO filename 298 | if [ -z "$NAME" ] ; then 299 | NAME=$title 300 | fi 301 | 302 | # Find out the type and version of the live ISO 303 | unset CASPER_VERSION 304 | unset DEBIAN_LIVE_VERSION 305 | unset DRACUT_VERSION 306 | unset KIWI_VERSION 307 | unset ANDROIDX86_VERSION 308 | if [ -e $M/casper/filesystem.manifest ] ; then 309 | CASPER_VERSION=$(grep -e "^casper" $M/casper/filesystem.manifest | head -n 1 | awk '{ print $2; }') 310 | fi 311 | if [ -e $M/live/filesystem.packages ] ; then 312 | DEBIAN_LIVE_VERSION=$(grep -e "^live-boot" $M/live/filesystem.packages | head -n 1 | awk '{ print $2; }') 313 | fi 314 | if [ -e $M/LiveOS/squashfs.img ] ; then 315 | mount $M/LiveOS/squashfs.img $M -o loop 316 | if [ -e $M/LiveOS/ext3fs.img ] ; then 317 | mount $M/LiveOS/ext3fs.img $M -o loop 318 | DRACUT_VERSION=$(find $M/var/lib/yum/yumdb/ -name *dracut-0* | grep -o -e dracut.*$ | sed -e 's|dracut-||g') 319 | # . $M/lib/dracut/dracut-version.sh # conveniently sets DRACUT_VERSION but does not exist in CentOS 6.4 320 | NAME=$(cat $M/etc/redhat-release) 321 | umount $M 322 | fi 323 | umount $M 324 | fi 325 | if [ -e $M/live/filesystem.git/objects/pack ] ; then 326 | echo " Type of live ISO detected (uses GIT pack), but don't know how to loop-boot these" >&2 327 | fi 328 | if [ -e $M/config.isoclient ] ; then 329 | IMAGE=$(find $M/ -type f -size +150M | head -n 1) # Find file larger than 150 MB 330 | mount $IMAGE $M -o loop 331 | KIWI_VERSION=$(cat $M/image/.profile | grep kiwi_iversion | cut -d "'" -f 2) 332 | NAME=$(cat $M/image/.profile | grep kiwi_displayname | cut -d "'" -f 2) 333 | umount $M 334 | fi 335 | if [ -e $M/isolinux/android-x86.png ] ; then 336 | ANDROIDX86_VERSION=1 337 | fi 338 | 339 | # Depending on the type of the live ISO, give it the corresponding args 340 | unset VERSION 341 | unset MAJOR 342 | unset LIVE_ARGS 343 | if [ -n "$CASPER_VERSION" ] ; then 344 | VERSION="Casper $CASPER_VERSION" 345 | MAJOR=$(echo $CASPER_VERSION | cut -d "." -f 1) 346 | LIVE_ARGS="$CASPER_ARGS" 347 | fi 348 | if [ -n "$DEBIAN_LIVE_VERSION" ] ; then 349 | VERSION="debian-live $DEBIAN_LIVE_VERSION" 350 | MAJOR=$(echo $DEBIAN_LIVE_VERSION | cut -d "." -f 1) 351 | if [ $MAJOR -eq 3 ] ; then 352 | LIVE_ARGS="$DEBIAN_LIVE_3_ARGS" 353 | elif [ $MAJOR -eq 2 ] ; then 354 | LIVE_ARGS="$DEBIAN_LIVE_2_ARGS" 355 | else 356 | echo " Unhandled debian-live version found, skipping" >&2 357 | umount $M 358 | rm -r $M 359 | continue 360 | fi 361 | fi 362 | if [ -n "$DRACUT_VERSION" ] ; then 363 | VERSION="Dracut $DRACUT_VERSION" 364 | MAJOR=$(echo $DRACUT_VERSION | cut -d "-" -f 1) 365 | LIVE_ARGS="$DRACUT_F19_ARGS" 366 | # patch-dracut-initrd "${the_iso}" >&2 367 | if [ $MAJOR -lt 29 ] ; then 368 | echo " Dracut versions below 029 do not support ISO booting, need additional initramfs!" >&2 369 | # Patch the initrd to make it happen... 370 | # umount $M 371 | # rm -r $M 372 | # continue 373 | fi 374 | fi 375 | if [ -n "$KIWI_VERSION" ] ; then 376 | VERSION="KIWI $KIWI_VERSION" 377 | LIVE_ARGS="$KIWI_ARGS" 378 | ARGS=$(grep "append" $M/$CONFIG | head -n 1 | sed -e 's|append initrd=initrd ||g') 379 | fi 380 | if [ -n "$ANDROIDX86_VERSION" ] ; then 381 | VERSION="ANDROIDX86 $ANDROIDX86_VERSION" 382 | LIVE_ARGS="" 383 | KERNEL="/kernel" 384 | INITRD="/initrd.img" 385 | ARGS=$(grep "append" $M/isolinux/isolinux.cfg | head -n 1 | sed -e 's| append initrd=/initrd.img ||g') 386 | fi 387 | 388 | echo " CONFIG=$CONFIG" >&2 389 | echo " NAME=$NAME" >&2 390 | echo " INITRD=$INITRD" >&2 391 | echo " KERNEL=$KERNEL" >&2 392 | echo " ARGS=$ARGS" >&2 393 | echo " CASPER_VERSION=$CASPER_VERSION" >&2 394 | echo " DEBIAN_LIVE_VERSION=$DEBIAN_LIVE_VERSION" >&2 395 | echo " DRACUT_VERSION=$DRACUT_VERSION" >&2 396 | echo " KIWI_VERSION=$KIWI_VERSION" >&2 397 | echo " ANDROIDX86_VERSION=$ANDROIDX86_VERSION" >&2 398 | 399 | # Check whether we have KERNEL, INITRD and they are files on the ISO, and whether we have ARGS 400 | if [ ! -f $M/$KERNEL ] ; then 401 | echo " Kernel not found, skipping" >&2 402 | umount $M 403 | rm -r $M 404 | continue 405 | fi 406 | if [ ! -f $M/$INITRD ] ; then 407 | echo " Initrd not found, skipping" >&2 408 | umount $M 409 | rm -r $M 410 | continue 411 | fi 412 | if [ -z "$ARGS" ] ; then 413 | echo " Boot arguments not found, skipping" >&2 414 | umount $M 415 | rm -r $M 416 | continue 417 | fi 418 | 419 | umount $M 420 | rm -r $M 421 | 422 | if [ -z "$VERSION" ] ; then 423 | echo " Type of live ISO not detected, skipping" >&2 424 | continue 425 | fi 426 | 427 | # Check if there is a initrd file next to the ISO that has the same name as the ISO + ".addon" 428 | # if that is the case, then assume that we want to ise that file as the initrd in addition to 429 | # the one contained inside the ISO. This allows for easy customization of the early (and thus, late) 430 | # boot process of the Live ISO. 431 | # If there is a file ending in ".override", we don't load the original initramfs but only the override. 432 | # This is beneficial e.g., for backporting later initramfs to legacy version systems. 433 | 434 | if [ -f "${rel_dirname}/${iso_name}.override" ] ; then 435 | INITRD_STRING="$rel_additional_initramfs ${rel_dirname}/${iso_name}.override" 436 | elif [ -f "${rel_dirname}/${iso_name}.addon" ] ; then 437 | INITRD_STRING="(loop)$INITRD $rel_additional_initramfs ${rel_dirname}/${iso_name}.addon" # Look Ma, multiple initramfs images 438 | else 439 | INITRD_STRING="(loop)$INITRD $rel_additional_initramfs" 440 | fi 441 | 442 | cat << EOF 443 | menuentry "${iso_name} - ${VERSION}" { 444 | iso_path="${rel_dirname}/${iso_name}" 445 | search --no-floppy --file \${iso_path} --set 446 | live_args="$LIVE_ARGS" 447 | custom_args="$CUSTOM_BOOTOPTIONS" 448 | iso_args="$ARGS" 449 | loopback loop \${iso_path} 450 | linux (loop)$KERNEL \${live_args} \${custom_args} \${iso_args} 451 | initrd $INITRD_STRING 452 | } 453 | EOF 454 | # The following line adds a lot of complicated looking 455 | # stuff to grub.conf which I don't really need 456 | # but it's probably there for a reason... 457 | # $( prepare_grub_to_access_device "$device" | sed -e "s/^/ /") 458 | 459 | done 460 | 461 | # Do not exit on errors anymore 462 | set +e 463 | 464 | # Enable GNOME automount again 465 | gsettings set org.gnome.desktop.media-handling automount 'true' 466 | 467 | ## END OF FILE ################################################################# 468 | -------------------------------------------------------------------------------- /boot/EFI/BOOT/bootx64.efi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/probonopd/SystemImageKit/eb88063786a3c28758fc7d0317e481589578a91b/boot/EFI/BOOT/bootx64.efi -------------------------------------------------------------------------------- /boot/bin/deprecated-generate-appimaged-extension: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # To test: 4 | # systemctl --user status appimaged 5 | # systemctl --user enable appimaged 6 | # systemctl --user start appimaged 7 | 8 | set -e 9 | 10 | HERE="$(dirname "$(readlink -f "${0}")")" 11 | 12 | if [ -e /usr/bin/apt-get ] ; then 13 | which mksquashfs || apt-get -y install squashfs-tools 14 | which wget || apt-get -y install wget 15 | # which dpkg || apt-get -y install dpkg 16 | fi 17 | 18 | if [ -e /usr/bin/yum ] ; then 19 | which mksquashfs || yum -y install squashfs-tools 20 | which wget || yum -y install wget 21 | # which dpkg || yum -y install dpkg 22 | fi 23 | 24 | mkdir -p /tmp/appimaged_x86_64 25 | cd /tmp/appimaged_x86_64 26 | 27 | # wget -c http://ftp.us.debian.org/debian/pool/main/i/inotify-tools/libinotifytools0_3.14-1_amd64.deb 28 | # dpkg -x libinotifytools*.deb . 29 | # rm *.deb 30 | 31 | # The following directories must exist when the session starts, otherwise the user must log out and in 32 | # for appimaged to work properly. This is NOT an appimaged bug. Send a pull request if you can fix this. 33 | # It looks like it is too late here to populate skel, hence this DOES NOT WORK 34 | mkdir -p etc/skel/.local/share/icons/hicolor/{16x16,22x22,24x24,32x32,36x36,48x48,64x64,72x72,96x96,128x128,192x192,256x256,512x512}/apps/ 35 | mkdir -p etc/skel/.local/share/icons/hicolor/scalable/apps/ 36 | find etc/skel/.local/share/icons -type d -name apps -exec echo echo \"This directory must exist before the session starts in order to work\" \> {}/.note \; > commands 37 | bash -x commands 38 | rm commands 39 | mkdir -p etc/skel/.local/share/applications/appimagekit 40 | echo "This directory must exist before the session starts in order to work" >> etc/skel/.local/share/applications/appimagekit/.note 41 | mkdir -p etc/skel/.local/share/mime/packages/ 42 | echo "This directory must exist before the session starts in order to work" >> etc/skel/.local/share/mime/packages/.note 43 | 44 | mkdir -p usr/bin 45 | 46 | # Get the ID of the last successful build on Travis CI 47 | # DLD=$(wget -q https://github.com/AppImage/appimaged/releases -O - | grep "appimaged_.*64*.deb" | head -n 1 | cut -d '"' -f 2) 48 | # wget -c "https://github.com/$DLD" 49 | 50 | # artifactory for libappimage-0.2 based appimaged builds 51 | LINK=$(wget -q "https://artifacts.assassinate-you.net/artifactory/appimaged/" -O - | grep "travis-" | cut -d '"' -f 2 | sort -Vr | head -n 1) 52 | URL=$(wget -q "https://artifacts.assassinate-you.net/artifactory/appimaged/$LINK/" -O - | grep "amd64.deb" | cut -d '"' -f 2 | head -n 1) 53 | wget -c "https://artifacts.assassinate-you.net/artifactory/appimaged/$LINK/$URL" 54 | 55 | dpkg -x appimaged_*.deb . && rm appimaged_*.deb 56 | # Without those, the service doesn't automatically launch on boot 57 | cat > ExtensionRun <<\EOF 58 | #!/bin/sh 59 | 60 | mkdir -p /usr/lib/systemd/user/ 61 | cat > /usr/lib/systemd/user/appimaged.service<<\EOxxF 62 | [Unit] 63 | Description=AppImage daemon 64 | After=basic.target 65 | 66 | [Service] 67 | ExecStart=/usr/bin/appimaged 68 | Restart=always 69 | RestartSec=5s 70 | StartLimitInterval=0 71 | 72 | [Install] 73 | WantedBy=graphical.target 74 | EOxxF 75 | 76 | # Enable per-user launchd unit for all users in a way that users can disable it 77 | systemctl --global enable appimaged # does not seem to work 78 | 79 | # Enable per-user launchd unit for all users, does not seem to work either 80 | mkdir -p /usr/lib/systemd/user/graphical.target.wants/ 81 | ( cd /usr/lib/systemd/user/graphical.target.wants/ ; ln -s ../appimaged.service . ) 82 | 83 | # Really desperate now 84 | mkdir -p /home/me/.config/systemd/user/graphical.target.wants/ 85 | ln -s /usr/lib/systemd/user/appimaged.service /home/me/.config/systemd/user/graphical.target.wants/appimaged.service 86 | chown -R me /home/me/ 87 | EOF 88 | 89 | chmod a+x ExtensionRun 90 | 91 | # Since all of the above does not work, I am using an autostart file 92 | # but it would nice if systemd could do this on its own 93 | mkdir -p etc/xdg/autostart/ 94 | cat > etc/xdg/autostart/appimaged.desktop <&1 27 | exit 1 28 | fi 29 | 30 | function finish { 31 | umount /opt 2>/dev/null 32 | gsettings set org.gnome.desktop.media-handling automount 'true' 2>/dev/null 33 | } 34 | trap finish EXIT 35 | 36 | # Temporarily disable GNOME automount 37 | # also for Unity in Ubuntu 11.04 and later 38 | gsettings set org.gnome.desktop.media-handling automount 'false' 2>/dev/null 39 | 40 | cat > /tmp/grub.cfg </dev/null 68 | detect_debian_live "/opt" >/dev/null 69 | detect_arch "/opt" >/dev/null 70 | detect_casper "/opt" >/dev/null 71 | detect_dracut "/opt" >/dev/null 72 | detect_lmc "/opt" >/dev/null 73 | detect_kiwi "/opt" >/dev/null 74 | detect_mageia "/opt" >/dev/null 75 | 76 | sleep 0.1 77 | umount /opt 78 | 79 | echo "" 80 | 81 | echo ISONAME="$ISONAME" 82 | echo LIVETOOL="$LIVETOOL" 83 | echo LIVETOOLVERSION="$LIVETOOLVERSION" 84 | echo LINUX="$LINUX" 85 | echo INITRD="$INITRD" 86 | echo APPEND="$APPEND" 87 | # echo "$GRUBENTRY" 88 | [[ -z $LIVETOOL || -z $LIVETOOLVERSION || -z $LINUX || -z $INITRD || -z $APPEND || -z $GRUBENTRY ]] && continue 89 | ISONAME=$(basename "$ISO") 90 | echo "Writing boot entry" 91 | echo "$GRUBENTRY" >> /tmp/grub.cfg 92 | echo "" >> /tmp/grub.cfg 93 | done 94 | 95 | # For Ubuntu 96 | which grub-script-check && grub-script-check /tmp/grub.cfg && ( 97 | # Backup the previous version 98 | cp "$LIVEMNT"/boot/grub/grub.cfg "$LIVEMNT"/boot/grub/grub.cfg.old 99 | cp /tmp/grub.cfg "$LIVEMNT"/boot/grub/grub.cfg 100 | echo "Successfully updated bootloader configuration" 101 | ) && exit 0 102 | 103 | # For openSUSE 104 | which grub2-script-check && grub2-script-check /tmp/grub.cfg && ( 105 | # Backup the previous version 106 | cp "$LIVEMNT"/boot/grub/grub.cfg "$LIVEMNT"/boot/grub/grub.cfg.old 107 | cp /tmp/grub.cfg "$LIVEMNT"/boot/grub/grub.cfg 108 | echo "Successfully updated bootloader configuration" 109 | ) && exit 0 110 | -------------------------------------------------------------------------------- /boot/bin/detect_arch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Set hostname etc. 5 | 6 | # Successfully detects 7 | # antergos-2014.08.07-x86_64.iso 8 | # antergos-2015.11.14-x86_64.iso 9 | # (BROKEN?) archlinux-2015.06.01-dual.iso 10 | # (BROKEN?) bbqlinux-2015.05.16-x86_64-xfce4.iso 11 | 12 | 13 | detect_arch() { 14 | 15 | HERE=$(dirname $(readlink -f $0)) 16 | 17 | MOUNTPOINT="$1" 18 | 19 | # 20 | # Make sure this ISO is one that this script understands - otherwise return asap 21 | # 22 | 23 | ls "$MOUNTPOINT"/arch 2>/dev/null || return 24 | 25 | echo "$ISONAME" assumed to be ARCH 26 | 27 | # 28 | # Parse the required information out of the ISO 29 | # 30 | 31 | LIVETOOL=archiso 32 | LIVETOOLVERSION=0 33 | 34 | CFG=$(find "$MOUNTPOINT"/loader/entries/archiso-*.conf | head -n 1) 35 | 36 | LINUX=$(cat $CFG | grep "linux " | head -n 1 | sed -e 's|linux ||g' | xargs) 37 | echo "* LINUX $LINUX" 38 | 39 | INITRD=$(cat $CFG | grep "archiso.img" | head -n 1 | sed -e 's|initrd ||g' | xargs) 40 | echo "* INITRD $INITRD" 41 | 42 | APPEND=$(cat $CFG | grep "options " | head -n 1 | sed -e 's|options ||g' | xargs) 43 | echo "* APPEND $APPEND" 44 | 45 | # 46 | # Put together a grub entry 47 | # 48 | 49 | read -r -d '' GRUBENTRY << EOM 50 | 51 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class arch { 52 | iso_path="/boot/iso/$ISONAME" 53 | search --no-floppy --file \${iso_path} --set 54 | live_args="for-arch --> img_loop=\${iso_path} img_dev=/dev/disk/by-uuid/$UUID layout=$KEYBOARD keytable=$KEYBOARD lang=$LOCALE_NODOT max_loop=256" 55 | custom_args="" 56 | iso_args="$APPEND" 57 | loopback loop \${iso_path} 58 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 59 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 60 | } 61 | EOM 62 | 63 | } 64 | -------------------------------------------------------------------------------- /boot/bin/detect_casper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Successfully detects 4 | # ubuntu-14.04.1-desktop-amd64.iso 5 | # ubuntu-gnome-15.04-desktop-amd64.iso 6 | # xubuntu-15.10-core-amd64.i 7 | 8 | detect_casper() { 9 | 10 | HERE=$(dirname $(readlink -f $0)) 11 | 12 | MOUNTPOINT="$1" 13 | 14 | # 15 | # Make sure this ISO is one that this script understands - otherwise return asap 16 | # 17 | 18 | find "$MOUNTPOINT"/casper 2>/dev/null || return 19 | ls "$MOUNTPOINT"/boot/grub/loopback.cfg 2>/dev/null && CFG="$MOUNTPOINT"/boot/grub/loopback.cfg # Hopefully all newer casper ISOs 20 | ls "$MOUNTPOINT"/boot/grub/grub.cfg 2>/dev/null && CFG="$MOUNTPOINT"/boot/grub/grub.cfg # pop-os_19.04_amd64_nvidia_7.iso 21 | # In elementary OS 5.1 /boot/grub/loopback.cfg contains just "source /boot/grub/grub.cfg" hence that one must be last 22 | if [ -z $CFG ] ; then return ; fi 23 | 24 | # 25 | # Parse the required information out of the ISO 26 | # 27 | 28 | LIVETOOL="casper" 29 | LIVETOOLVERSION=$(grep -e "^casper" "$MOUNTPOINT"/casper/filesystem.manifest | head -n 1 | awk '{ print $2; }') 30 | 31 | # The following is needed for xubuntu-15.10-core-amd64.iso 32 | if [ "x$LIVETOOLVERSION" == "x" ] ; then 33 | LIVETOOLVERSION=0 34 | fi 35 | 36 | LINUX=$(cat $CFG | grep "linux" | head -n 1 | sed -e 's|linux\t||g' | sed -e 's|linux ||g' | xargs | sed -e 's|.efi||g') 37 | echo "* LINUX $LINUX" 38 | 39 | INITRD=$(cat $CFG | grep "initrd" | head -n 1 | sed -e 's|initrd\t||g' | sed -e 's|initrd ||g' | xargs) 40 | echo "* INITRD $INITRD" 41 | 42 | APPEND=" " # Don't use this because it's already in the LINUX line 43 | 44 | # 45 | # Put together a grub entry 46 | # 47 | 48 | read -r -d '' GRUBENTRY << EOM 49 | 50 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class ubuntu { 51 | iso_path="/boot/iso/$ISONAME" 52 | search --no-floppy --file \${iso_path} --set 53 | live_args="for-casper --> iso-scan/filename=\${iso_path} console-setup/layoutcode=$KEYBOARD locale=$LANGUAGE timezone=$TIMEZONE username=$USERNAME hostname=$HOSTNAME noprompt init=/isodevice/boot/customize/init max_loop=256" 54 | custom_args="" 55 | iso_args="$APPEND" 56 | loopback loop \${iso_path} 57 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 58 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 59 | } 60 | EOM 61 | 62 | } 63 | -------------------------------------------------------------------------------- /boot/bin/detect_debian_live.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Use grub class to show debian icon 5 | 6 | # Successfully detects 7 | # kali-linux-1.0.7-i386.iso - live-boot 3.0.1-1kali1 8 | # kali-linux-2.0-amd64.iso - live-boot 4.0.2-1 9 | # debian-live-7.5.0-i386-gnome-desktop.iso - live-boot 3.0.1-1 10 | # debian-live-7.5-i386-gnome-desktop+nonfree.iso - live-boot 3.0.1-1 11 | # debian-live-9.6.0-amd64-mate+nonfree.iso 12 | # debian_7.0.0_wheezy_i386_20130705_binary.hybrid.iso - live-boot 3.0.1-1 13 | # debian-live-8.0.0-amd64-xfce-desktop+nonfree.iso - live-boot 4.0.2-1 14 | # tails-i386-1.5.iso 15 | # tanglu-3.0-gnome-live-amd64.hybrid.iso 16 | # deepin-15.4-amd64.iso 17 | 18 | detect_debian_live() { 19 | 20 | HERE=$(dirname $(readlink -f $0)) 21 | 22 | MOUNTPOINT="$1" 23 | 24 | # 25 | # Make sure this ISO is one that this script understands - otherwise return asap 26 | # 27 | 28 | find "$MOUNTPOINT"/live/filesystem.squashfs 2>/dev/null || return 29 | find "$MOUNTPOINT"/.disk/cd_type 2>/dev/null || return 30 | 31 | # 32 | # Parse the required information out of the ISO 33 | # 34 | 35 | mount "$MOUNTPOINT"/live/filesystem.squashfs "$MOUNTPOINT" -o loop,ro 36 | 37 | if [ -f "$MOUNTPOINT"/usr/share/doc/live-boot/changelog.Debian.gz ] ; then 38 | LIVETOOL=$(zcat "$MOUNTPOINT"/usr/share/doc/live-boot/changelog.Debian.gz | head -n 1 | cut -d ";" -f 1 | xargs | cut -d " " -f 1) 39 | echo "* LIVETOOL $LIVETOOL" 40 | LIVETOOLVERSION=$(zcat "$MOUNTPOINT"/usr/share/doc/live-boot/changelog.Debian.gz | head -n 1 | cut -d "(" -f 2 | cut -d ")" -f 1) 41 | echo "* LIVETOOLVERSION $LIVETOOLVERSION" 42 | else 43 | LIVETOOL="debian-live" 44 | echo "* LIVETOOL $LIVETOOL" 45 | LIVETOOLVERSION=0 46 | echo "* LIVETOOLVERSION $LIVETOOLVERSION" 47 | fi 48 | 49 | umount "$MOUNTPOINT" 50 | 51 | CFG=$(find "$MOUNTPOINT" -name live.cfg | head -n 1) 52 | 53 | # Needed for debian-live-9.6.0-amd64-mate+nonfree.iso 54 | if [ -z "$CFG" ] ; then 55 | CFG=$(find "$MOUNTPOINT" -name grub.cfg | head -n 1) 56 | fi 57 | 58 | LINUX=$(cat $CFG | grep "linux " | head -n 1 | sed -e 's|linux ||g' | xargs) 59 | if [ "$LINUX" == "" ] ; then 60 | LINUX=$(cat $CFG | grep "kernel " | head -n 1 | sed -e 's|kernel ||g' | xargs) # tails-i386-1.5.iso 61 | fi 62 | echo "* LINUX $LINUX" 63 | 64 | INITRD=$(cat $CFG | grep "initrd " | head -n 1 | sed -e 's|initrd ||g' | xargs) 65 | if [ "$INITRD" == "" ] ; then 66 | INITRD=$(cat $CFG | grep "initrd=" | head -n 1 | cut -d = -f 2 | cut -d " " -f 1) # tails-i386-1.5.iso 67 | fi 68 | echo "* INITRD $INITRD" 69 | 70 | APPEND=$(cat $CFG | grep "append " | head -n 1 | sed -e 's|append ||g' | xargs | sed -e 's|initrd='$INITRD' ||g') # sed is for tails-i386-1.5.iso 71 | APPEND=$(echo $APPEND | sed -e 's| locales=zh_CN.UTF-8||g') # Deepin 72 | APPEND=$(echo $APPEND | sed -e 's| livecd-installer||g') # Deepin 73 | echo "* APPEND $APPEND" 74 | 75 | # 76 | # Put together a grub entry 77 | # 78 | 79 | read -r -d '' GRUBENTRY << EOM 80 | 81 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class debian { 82 | iso_path="/boot/iso/$ISONAME" 83 | search --no-floppy --file \${iso_path} --set 84 | live_args="for-debian-live-3 --> findiso=\${iso_path} live-config.keyboard-layouts=$KEYBOARD live-config.locales=$LOCALE live-config.timezone=$TIMEZONE live-config.username=$USERNAME live-config.hostname=$HOSTNAME init=/lib/live/mount/findiso/boot/customize/init max_loop=256" 85 | custom_args="" 86 | iso_args="$APPEND" 87 | loopback loop \${iso_path} 88 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 89 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 90 | } 91 | EOM 92 | 93 | } 94 | -------------------------------------------------------------------------------- /boot/bin/detect_dracut.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # ... 5 | 6 | # Successfully detects 7 | # Fedora-Live-Desktop-i686-20-1.iso 8 | # Fedora-Live-Xfce-i686-20-1.iso 9 | # Fedora-Live-Workstation-i686-rawhide-20140531.iso 10 | # CentOS-6.5-i386-LiveCD.iso 11 | # Fedora-Live-Security-i686-20-1.iso 12 | # Fedora-Live-Design-suite-i686-20-1.iso 13 | # Fedora-Live-Scientific-KDE-i686-20-1.iso 14 | # CentOS-6.4-i386-LiveDVD.iso 15 | # Fedora-Live-Desktop-i686-19-1.iso 16 | # CentOS-7.0-1406-x86_64-GnomeLive.iso 17 | # Solus-RC1.iso 18 | 19 | detect_dracut() { 20 | 21 | HERE=$(dirname $(readlink -f $0)) 22 | 23 | MOUNTPOINT="$1" 24 | 25 | # 26 | # Make sure this ISO is one that this script understands - otherwise return asap 27 | # 28 | 29 | find "$MOUNTPOINT"/LiveOS/squashfs.img 2>/dev/null || return 30 | 31 | # 32 | # Parse the required information out of the ISO 33 | # 34 | 35 | mount "$MOUNTPOINT"/LiveOS/squashfs.img "$MOUNTPOINT" -o loop 36 | if [ -e "$MOUNTPOINT"/LiveOS/ext3fs.img ] ; then 37 | LIVETOOL="dracut" 38 | LIVETOOLVERSION=1 39 | mount "$MOUNTPOINT"/LiveOS/ext3fs.img "$MOUNTPOINT" -o loop 40 | if [ -e "$MOUNTPOINT"/lib/dracut/dracut-version.sh ] ; then 41 | . "$MOUNTPOINT"/lib/dracut/dracut-version.sh # conveniently sets DRACUT_VERSION but does not exist in CentOS 6.4 42 | LIVETOOLVERSION=$DRACUT_VERSION # For Fedora 23 43 | else 44 | LIVETOOLVERSION=$(find "$MOUNTPOINT"/var/lib/yum/yumdb/ -name *dracut-0* | grep -o -e dracut.*$ | sed -e 's|dracut-||g') 45 | # yumdb is no longer there in Fedora 23 46 | fi 47 | umount "$MOUNTPOINT" 48 | else 49 | umount "$MOUNTPOINT" 50 | return 51 | fi 52 | umount "$MOUNTPOINT" 53 | 54 | CFG=$(find "$MOUNTPOINT" -name isolinux.cfg | head -n 1) 55 | 56 | LINUX=$(cat $CFG | grep "kernel " | head -n 1 | sed -e 's|kernel ||g' | xargs) 57 | if [[ $LINUX != *"/"* ]] ; then 58 | LINUX=$(find "$MOUNTPOINT" -name "$LINUX" | head -n 1 | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 59 | fi 60 | echo "* LINUX $LINUX" 61 | 62 | INITRD=$(cat $CFG | grep "append " | head -n 1 | cut -d = -f 2 | cut -d " " -f 1 | xargs) 63 | if [[ $INITRD != *"/"* ]] ; then 64 | INITRD=$(find "$MOUNTPOINT" -name "$INITRD" | head -n 1 | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 65 | fi 66 | echo "* INITRD $INITRD" 67 | 68 | APPEND=$(cat $CFG | grep "append " | head -n 1 | sed -e 's|append ||g' | sed -e 's|initrd=initrd0.img ||g' | xargs) 69 | echo "* APPEND $APPEND" 70 | 71 | # 72 | # Put together a grub entry 73 | # 74 | 75 | read -r -d '' GRUBENTRY << EOM 76 | 77 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class fedora { 78 | iso_path="/boot/iso/$ISONAME" 79 | search --no-floppy --file \${iso_path} --set 80 | live_args="for-dracut --> iso-scan/filename=\${iso_path} selinux=0 max_loop=256 rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir rd.live.user=$USERNAME rd.live.host=$HOSTNAME vconsole.keymap=$KEYBOARD locale.LANG=$LOCALE" 81 | custom_args="" 82 | iso_args="$APPEND" 83 | loopback loop \${iso_path} 84 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 85 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 86 | } 87 | EOM 88 | 89 | } 90 | -------------------------------------------------------------------------------- /boot/bin/detect_kiwi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Language, keyboard 5 | 6 | # Successfully detects 7 | # openSUSE-Tumbleweed-GNOME-Live-x86_64-Snapshot20150728-Media.iso 8 | 9 | detect_kiwi() { 10 | 11 | HERE=$(dirname $(readlink -f $0)) 12 | 13 | MOUNTPOINT="$1" 14 | 15 | # 16 | # Make sure this ISO is one that this script understands - otherwise return asap 17 | # 18 | 19 | find "$MOUNTPOINT"/config.isoclient 2>/dev/null || return 20 | find "$MOUNTPOINT"/boot/grub2/grub.cfg 2>/dev/null || return 21 | 22 | # 23 | # Parse the required information out of the ISO 24 | # 25 | 26 | LIVETOOL="kiwi" 27 | LIVETOOLVERSION=1 28 | 29 | CFG="$MOUNTPOINT"/boot/grub2/grub.cfg 30 | 31 | LINUX=$(cat $CFG | grep "\$linux" | head -n 1 | sed -e 's|\$linux ||g' | sed -e 's|($root)||g' | xargs) 32 | echo "* LINUX $LINUX" 33 | 34 | INITRD=$(cat $CFG | grep "\$initrd" | head -n 1 | sed -e 's|\$initrd ||g' | sed -e 's|($root)||g' | xargs) 35 | echo "* INITRD $INITRD" 36 | 37 | APPEND="ramdisk_size=512000 ramdisk_blocksize=4096 quiet splash" # FIXME: Parse out of the file on the ISO 38 | echo "* APPEND $APPEND" # TODO: Remove extraneous initrd (first argument) 39 | 40 | # 41 | # Put together a grub entry 42 | # 43 | 44 | read -r -d '' GRUBENTRY << EOM 45 | 46 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class opensuse --class os { 47 | iso_path="/boot/iso/$ISONAME" 48 | search --no-floppy --file \${iso_path} --set 49 | live_args="for-kiwi --> isofrom_device=/dev/disk/by-uuid/$UUID isofrom_system=\${iso_path} lang=$LOCALE max_loop=256" 50 | custom_args="init=/isofrom/boot/customize/init" 51 | iso_args="$APPEND" 52 | loopback loop \${iso_path} 53 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 54 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 55 | } 56 | EOM 57 | 58 | } 59 | -------------------------------------------------------------------------------- /boot/bin/detect_lmc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # ... 5 | 6 | # Successfully detects 7 | # Fedora-Workstation-Live-x86_64-24-1.2.iso 8 | # Solus-1.1.iso 9 | # openSUSE-Tumbleweed-Rescue-CD-x86_64-Current.iso as of 5/2018 10 | 11 | detect_lmc() { 12 | 13 | HERE=$(dirname $(readlink -f $0)) 14 | 15 | MOUNTPOINT="$1" 16 | 17 | # 18 | # Make sure this ISO is one that this script understands - otherwise return asap 19 | # 20 | 21 | find "$MOUNTPOINT"/LiveOS/squashfs.img 2>/dev/null || return 22 | 23 | # 24 | # Parse the required information out of the ISO 25 | # 26 | 27 | mount "$MOUNTPOINT"/LiveOS/squashfs.img "$MOUNTPOINT" -o loop 28 | if [ -e "$MOUNTPOINT"/LiveOS/rootfs.img ] ; then 29 | # F24+ 30 | LIVETOOL="livemedia-creator" 31 | LIVETOOLVERSION=1 32 | mount "$MOUNTPOINT"/LiveOS/rootfs.img "$MOUNTPOINT" -o loop 33 | if [ -e /var/lib/dnf/yumdb/ ] ; then 34 | LIVETOOLVERSION2=$(find /var/lib/dnf/yumdb/ -name "*dracut-live*" | cut -d "-" -f 4-5) 35 | fi 36 | if [ ! -z $LIVETOOLVERSION2 ] ; then 37 | LIVETOOLVERSION=$LIVETOOLVERSION2 38 | fi 39 | umount "$MOUNTPOINT" 40 | else 41 | umount "$MOUNTPOINT" 42 | return 43 | fi 44 | umount "$MOUNTPOINT" 45 | 46 | CFG=$(find "$MOUNTPOINT" -name isolinux.cfg | head -n 1) 47 | 48 | LINUX=$(cat $CFG | grep "kernel " | head -n 1 | sed -e 's|kernel ||g' | xargs) 49 | if [[ $LINUX != *"/"* ]] ; then 50 | LINUX=$(find "$MOUNTPOINT" -name "$LINUX" | head -n 1 | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 51 | fi 52 | echo "* LINUX $LINUX" 53 | 54 | INITRD=$(cat $CFG | grep "append " | head -n 1 | cut -d = -f 2 | cut -d " " -f 1 | xargs) 55 | if [[ $INITRD != *"/"* ]] ; then 56 | INITRD=$(find "$MOUNTPOINT" -name "$INITRD" | head -n 1 | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 57 | fi 58 | echo "* INITRD $INITRD" 59 | 60 | APPEND=$(cat $CFG | grep "append " | head -n 1 | sed -e 's|append ||g' | sed -e 's|initrd=initrd0.img ||g' | sed -e 's| rd.live.overlay.persistent rd.live.overlay.cowfs=ext4||g' | xargs) 61 | echo "* APPEND $APPEND" 62 | 63 | # 64 | # Put together a grub entry 65 | # 66 | 67 | read -r -d '' GRUBENTRY << EOM 68 | 69 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class fedora { 70 | iso_path="/boot/iso/$ISONAME" 71 | search --no-floppy --file \${iso_path} --set 72 | live_args="for-dracut --> iso-scan/filename=\${iso_path} selinux=0 max_loop=256 rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir rd.live.user=$USERNAME rd.live.host=$HOSTNAME vconsole.keymap=$KEYBOARD locale.LANG=$LOCALE workaround-for-suse-> lang=de_DE" 73 | custom_args="" 74 | iso_args="$APPEND" 75 | loopback loop \${iso_path} 76 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 77 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 78 | } 79 | EOM 80 | 81 | } 82 | -------------------------------------------------------------------------------- /boot/bin/detect_loopbackcfg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Known to work with 4 | # manjaro-xfce-17.1.1-stable-x86_64.iso 5 | 6 | detect_loopbackcfg() { 7 | 8 | HERE=$(dirname $(readlink -f $0)) 9 | 10 | MOUNTPOINT="$1" 11 | 12 | # 13 | # Make sure this ISO is one that this script understands - otherwise return asap 14 | # 15 | 16 | ls "$MOUNTPOINT"/boot/grub/loopback.cfg 2>/dev/null || return 17 | 18 | echo "loopback.cfg found" 19 | 20 | # 21 | # Parse the required information out of the ISO 22 | # 23 | 24 | LIVETOOL=loopback.cfg 25 | LIVETOOLVERSION=0 26 | LINUX="loopback!" 27 | INITRD="loopback!" 28 | APPEND="loopback!" 29 | 30 | # 31 | # Put together a grub entry 32 | # 33 | 34 | read -r -d '' GRUBENTRY << EOM 35 | 36 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" { 37 | iso_path="/boot/iso/$ISONAME" 38 | export iso_path 39 | search --set=root --file \$iso_path 40 | probe -u -s rootuuid \$root 41 | export rootuuid 42 | loopback loop \$iso_path 43 | root=(loop) 44 | configfile /boot/grub/loopback.cfg 45 | loopback --delete loop 46 | } 47 | EOM 48 | 49 | } 50 | -------------------------------------------------------------------------------- /boot/bin/detect_mageia.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Don't show the finish-install nag screen, set language and keyboard, run customize/init 5 | 6 | # Successfully detects 7 | # Mageia-5-LiveDVD-GNOME-x86_64-DVD.iso 8 | 9 | detect_mageia() { 10 | 11 | HERE=$(dirname $(readlink -f $0)) 12 | 13 | MOUNTPOINT="$1" 14 | 15 | # 16 | # Make sure this ISO is one that this script understands - otherwise return asap 17 | # 18 | 19 | find "$MOUNTPOINT"/loopbacks/distrib-lzma.sqfs 2>/dev/null || return 20 | 21 | # 22 | # Parse the required information out of the ISO 23 | # 24 | 25 | LIVETOOL="mgalive" 26 | LIVETOOLVERSION=1 27 | 28 | CFG=$(find "$MOUNTPOINT" -name isolinux.cfg | head -n 1) 29 | 30 | LINUX=$(cat $CFG | grep "kernel " | head -n 1 | sed -e 's|kernel ||g' | xargs) 31 | if [[ $LINUX != *"/"* ]] ; then 32 | LINUX=$(find "$MOUNTPOINT" -name "$LINUX" | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 33 | fi 34 | echo "* LINUX $LINUX" 35 | 36 | INITRD=$(cat $CFG | grep "append " | head -n 1 | cut -d = -f 2 | cut -d " " -f 1 | xargs) 37 | if [[ $INITRD != *"/"* ]] ; then 38 | INITRD=$(find "$MOUNTPOINT" -name "$INITRD" | sed -e "s|$MOUNTPOINT||g" ) # Need to get full path 39 | fi 40 | echo "* INITRD $INITRD" 41 | 42 | APPEND=$(cat $CFG | grep "append " | head -n 1 | sed -e 's|append ||g' | sed -e 's|initrd=/boot/cdrom/initrd.gz ||g' | xargs) 43 | echo "* APPEND $APPEND" 44 | 45 | # 46 | # Put together a grub entry 47 | # 48 | 49 | read -r -d '' GRUBENTRY << EOM 50 | 51 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class mageia { 52 | iso_path="/boot/iso/$ISONAME" 53 | search --no-floppy --file \${iso_path} --set 54 | live_args="for-dracut --> isofrom=/dev/disk/by-uuid/$UUID:\${iso_path} selinux=0 rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir rd.live.user=$USERNAME rd.live.host=$HOSTNAME lang=$KEYBOARD" 55 | custom_args="" 56 | iso_args="$APPEND" 57 | loopback loop \${iso_path} 58 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 59 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 60 | } 61 | EOM 62 | 63 | } 64 | -------------------------------------------------------------------------------- /boot/bin/detect_tumbleweed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # TODO 4 | # Language, keyboard 5 | 6 | # Successfully detects 7 | # openSUSE-Tumbleweed-GNOME-Live-i686-Snapshot20151012-Media.iso 8 | 9 | detect_kiwi() { 10 | 11 | HERE=$(dirname $(readlink -f $0)) 12 | 13 | MOUNTPOINT="$1" 14 | 15 | # 16 | # Make sure this ISO is one that this script understands - otherwise return asap 17 | # 18 | 19 | find "$MOUNTPOINT"/config.isoclient 2>/dev/null || return 20 | find "$MOUNTPOINT"/syslinux.cfg 2>/dev/null || return 21 | 22 | # 23 | # Parse the required information out of the ISO 24 | # 25 | 26 | LIVETOOL="kiwi-ng" 27 | # LIVETOOLVERSION=1 28 | LIVETOOLVERSION=$(ls "$MOUNTPOINT"/*read-only* | rev | cut -d - -f 1 | rev ) 29 | 30 | CFG="$MOUNTPOINT"/syslinux.cfg 31 | 32 | LINUX=$(cat $CFG | grep "kernel" | head -n 1 | sed -e 's|kernel ||g' | sed -e 's|($root)||g' | xargs) 33 | LINUX="/"$LINUX 34 | echo "* LINUX $LINUX" 35 | 36 | INITRD=$(cat $CFG | grep -o "initrd=.*initrd" | head -n 1 | sed -e 's|initrd=|/|g' | sed -e 's|($root)||g') 37 | echo "* INITRD $INITRD" 38 | 39 | APPEND=$(cat $CFG | grep "append" | head -n 1 | sed -e 's|append ||g' | xargs) 40 | SEARCH=$(echo $INITRD | cut -c 2-) 41 | APPEND=$(echo $APPEND | sed -e 's|initrd=||g') 42 | APPEND=$(echo $APPEND | sed -e 's|'$SEARCH' ||g') 43 | echo "* APPEND $APPEND" # TODO: Remove extraneous initrd (first argument) 44 | 45 | # 46 | # Put together a grub entry 47 | # 48 | 49 | read -r -d '' GRUBENTRY << EOM 50 | 51 | menuentry "$ISONAME - $LIVETOOL $LIVETOOLVERSION" --class opensuse --class os { 52 | iso_path="/boot/iso/$ISONAME" 53 | search --no-floppy --file \${iso_path} --set 54 | live_args="for-kiwi --> isofrom_device=/dev/disk/by-uuid/$UUID isofrom_system=\${iso_path} lang=$LOCALE max_loop=256" 55 | custom_args="init=/isofrom/boot/customize/init" 56 | iso_args="$APPEND" 57 | loopback loop \${iso_path} 58 | linux (loop)$LINUX \${live_args} \${custom_args} \${iso_args} 59 | initrd (loop)$INITRD /boot/iso/additional-initramfs/initramfs 60 | } 61 | EOM 62 | 63 | } 64 | -------------------------------------------------------------------------------- /boot/bin/generate-aill-extension: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # To test: 4 | # 5 | # systemctl --user enable appimagelauncherd 6 | # systemctl --user start appimagelauncherd 7 | 8 | set -e 9 | 10 | HERE="$(dirname "$(readlink -f "${0}")")" 11 | 12 | if [ -e /usr/bin/apt-get ] ; then 13 | which mksquashfs || apt-get -y install squashfs-tools 14 | which wget || apt-get -y install wget 15 | # which dpkg || apt-get -y install dpkg 16 | fi 17 | 18 | if [ -e /usr/bin/yum ] ; then 19 | which mksquashfs || yum -y install squashfs-tools 20 | which wget || yum -y install wget 21 | # which dpkg || yum -y install dpkg 22 | fi 23 | 24 | mkdir -p /tmp/appimagelauncherd_x86_64 25 | cd /tmp/appimagelauncherd_x86_64 26 | 27 | mkdir -p etc/skel/.config 28 | ISOMOUNTPOINT=$(mount | grep fat | head -n 1 | cut -d " " -f 3) 29 | cat > etc/skel/.config/appimagelauncher.cfg < {}/.note \; > commands 42 | bash -x commands 43 | rm commands 44 | mkdir -p etc/skel/.local/share/applications/appimagekit 45 | echo "This directory must exist before the session starts in order to work" >> etc/skel/.local/share/applications/appimagekit/.note 46 | mkdir -p etc/skel/.local/share/mime/packages/ 47 | echo "This directory must exist before the session starts in order to work" >> etc/skel/.local/share/mime/packages/.note 48 | 49 | # FIXME in appimagelauncher-lite.AppImage 50 | mkdir -p etc/skel/.config/systemd/user/ 51 | echo "This directory must exist before the session starts in order to work" >> etc/skel/.config/systemd/user/.note 52 | 53 | mkdir -p usr/bin 54 | 55 | # Get the last successful build on Travis CI 56 | DLD=$(wget -q https://github.com/TheAssassin/AppImageLauncher/releases/ -O - | grep "appimagelauncher-lite-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) 57 | wget -c "https://github.com/$DLD" 58 | 59 | chmod +x appimagelauncher-lite-*.AppImage 60 | ls -lh 61 | mkdir -p usr/lib/ 62 | mv ./appimagelauncher-lite-*.AppImage usr/lib/appimagelauncher-lite.AppImage 63 | 64 | cat > ExtensionRun <<\EOF 65 | #!/bin/sh 66 | EOF 67 | chmod a+x ExtensionRun 68 | 69 | # Since all of the above does not work, I am using an autostart file 70 | # but it would nice if systemd could do this on its own 71 | mkdir -p etc/xdg/autostart/ 72 | cat > etc/xdg/autostart/appimagelauncher-lite.desktop < ./usr/bin/appimagedlauncher <<\EOF 11 | #!/bin/bash 12 | 13 | # Launch the most recent (as per modification time) 14 | # appimaged AppImage from the Applications directory 15 | # of the first mounted vfat partition (which is where 16 | # Live ISOs are usually mounted from by SystemImageKit) 17 | 18 | "$(mount | grep fat | head -n 1 | cut -d " " -f 3)/Applications/$(ls -at /$(mount | grep fat | head -n 1 | cut -d " " -f 3)/Applications/ | grep -e "^appimaged-.*.AppImage" | head -n 1)" "$@" 19 | EOF 20 | chmod +x ./usr/bin/appimagedlauncher 21 | 22 | mkdir -p etc/systemd/user/ 23 | cat > etc/systemd/user/appimaged.service <<\EOF 24 | [Unit] 25 | Description=AppImage system integration daemon 26 | After=syslog.target network.target 27 | 28 | [Service] 29 | Type=simple 30 | ExecStart=/usr/bin/appimagedlauncher 31 | 32 | RestartSec=3 33 | Restart=always 34 | 35 | StandardOutput=syslog 36 | StandardError=syslog 37 | 38 | SyslogIdentifier=appimaged 39 | 40 | Environment=LAUNCHED_BY_SYSTEMD=1 41 | 42 | [Install] 43 | WantedBy=default.target 44 | EOF 45 | 46 | # Not sure whether this works... 47 | mkdir -p etc/systemd/user/default.target.wants 48 | ( cd etc/systemd/user/ ; ln -s appimaged.service default.target.wants/ ) 49 | 50 | mksquashfs . "${HERE}/../customize/x86_64/appimaged.ExtensionImage" -noappend 51 | cd - 52 | -------------------------------------------------------------------------------- /boot/bin/generate-b43firmware-extension: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Install firmware for Broadcom BCM43xx based wireless network card 5 | # into ExtensionImage 6 | # 7 | 8 | HERE="$(dirname "$(readlink -f "${0}")")" 9 | 10 | if [ -e /usr/bin/apt-get ] ; then 11 | which mksquashfs || apt-get -y install squashfs-tools 12 | which b43-fwcutter || apt-get -y install b43-fwcutter 13 | which wget || apt-get -y install wget 14 | fi 15 | 16 | if [ -e /usr/bin/yum ] ; then 17 | which mksquashfs || yum -y install squashfs-tools 18 | which b43-fwcutter || yum -y install b43-fwcutter 19 | which wget || yum -y install wget 20 | fi 21 | 22 | rm -f "${HERE}/../customize/x86_64/b43firmware.ExtensionImage" 23 | 24 | mkdir -p /tmp/firmware/lib/firmware 25 | cd /tmp/firmware/ 26 | wget -c "http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2" 27 | tar xfvj *.tar.bz2 28 | b43-fwcutter ./broadcom-wl-5.100.138/linux/wl_apsta.o -w . 29 | mv b43 lib/firmware/ 30 | rm -rf broadcom-* 31 | cat > ExtensionRun < /etc/skel/.config/deepin/deepin-terminal/config.conf < /usr/share/glib-2.0/schemas/60_site_deepin.gschema.override <> /usr/share/xfwm4/defaults < /sys/class/leds/smc::kbd_backlight/brightness 106 | echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs' 107 | echo 'min_power' > '/sys/class/scsi_host/host0/link_power_management_policy' 108 | echo '1' > '/sys/module/snd_hda_intel/parameters/power_save' 109 | echo '0' > '/proc/sys/kernel/nmi_watchdog' 110 | for DEVICE in $(find /sys/bus/pci/devices/*) ; do 111 | echo "auto" > $DEVICE/power/control 112 | done 113 | fi 114 | 115 | # Configure dconf 116 | # Obtained with dconf watch / 117 | # It seems to need [org.gnome.desktop.peripherals.touchpad] for Ubuntu 18.04 whereas 118 | # it seems to need [org.gnome.settings-daemon.peripherals.touchpad] for earlier versions 119 | # why do they keep changing stuff around like that; annoying! 120 | 121 | echo "3" 122 | cat > /usr/share/glib-2.0/schemas/60_site.gschema.override < /usr/share/glib-2.0/schemas/60_site_deepin.gschema.override < /etc/profile.d/customize.sh <<\EOF 176 | #!/bin/bash 177 | if [ $(which dconf) ] ; then 178 | CUSTOMLANG=$(echo $LANG | cut -d _ -f 1) 179 | dconf write /org/gnome/settings-daemon/peripherals/touchpad/disable-while-typing true # Ubuntu 180 | dconf write /org/gnome/settings-daemon/peripherals/touchpad/motion-acceleration 10.0 # Ubuntu 181 | dconf write /org/gnome/settings-daemon/peripherals/touchpad/motion-threshold 1 # Ubuntu 182 | dconf write /org/gnome/desktop/peripherals/touchpad/speed 1.0 # Fedora 183 | dconf write /org/gnome/desktop/peripherals/touchpad/tap-to-click true # Fedora 184 | # dconf write /org/gnome/desktop/input-sources/sources "[('xkb', '$CUSTOMLANG')]" 185 | dconf write /org/gnome/shell/favorite-apps "['firefox.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.gedit.desktop', 'org.gnome.Terminal.desktop']" 186 | # Enable certain GNOME Extensions 187 | # dconf write /org/gnome/shell/enabled-extensions "['places-menu@gnome-shell-extensions.gcampax.github.com', 'launch-new-instance@gnome-shell-extensions.gcampax.github.com', 'dash-to-dock@micxgx.gmail.com', 'apps-menu@gnome-shell-extensions.gcampax.github.com', 'alternate-tab@gnome-shell-extensions.gcampax.github.com']" 188 | # dconf write /org/gnome/shell/extensions/dash-to-dock/dock-position "'BOTTOM'" 189 | # Fix Ubuntu multiscreen stupidity (sticky edges, multiple docks) 190 | dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-capture-mouse false 191 | dconf write /org/compiz/profiles/unity/plugins/unityshell/num-launchers 1 192 | fi 193 | HISTTIMEFORMAT="$(echo -e '\r\e[K')" 194 | EOF 195 | chmod a+x /etc/profile.d/customize.sh 196 | 197 | # Fix Retina display (works on Ubuntu), TODO: Make this run only on Retina devices, and convert to the format above 198 | # dconf write /org/gnome/desktop/interface/cursor-size 36 199 | # dconf write /org/gnome/desktop/interface/text-scaling-factor 1.5 200 | # dconf write /org/compiz/profiles/unity/plugins/expo/x-offset 97 201 | # dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-capture-mouse false 202 | # dconf write /org/compiz/profiles/unity/plugins/unityshell/num-launchers 1 203 | # Alternatively, could set the resolution to non-Retina 204 | # dconf write /org/compiz/profiles/unity/plugins/core/outputs ['1440x900+0+0'] 205 | 206 | echo "4" 207 | # Disable crash reporter 208 | if [ -e /etc/default/apport ] ; then 209 | sed -i -e 's|enabled=1|enabled=0|g' /etc/default/apport 210 | fi 211 | 212 | # No restricted driver nagging in Ubuntu 213 | if [ -e /etc/xdg/autostart/jockey-gtk.desktop ] ; then 214 | echo "Hidden=true" >> /etc/xdg/autostart/jockey-gtk.desktop 215 | fi 216 | 217 | # Remove dist-upgrade nag screen 218 | if [ -e /usr/lib/update-manager/check-new-release-gtk ] ; then 219 | mv /usr/lib/update-manager/check-new-release-gtk /usr/lib/update-manager/check-new-release-gtk.disabled 220 | fi 221 | 222 | # Disable GNOME Login Sound 223 | if [ -e /usr/share/gnome/autostart/libcanberra-login-sound.desktop ] ; then 224 | echo "X-GNOME-Autostart-enabled=false" > /usr/share/gnome/autostart/libcanberra-login-sound.desktop 225 | fi 226 | 227 | # Disable SUSEgreeter 228 | if [ -e /etc/xdg/autostart/SUSEgreeter.desktop ] ; then 229 | rm /etc/xdg/autostart/SUSEgreeter.desktop 230 | fi 231 | 232 | # Deepin; is copied into $HOME by 233 | # https://github.com/linuxdeepin/deepin-installer/blob/master/live-config/1070deepin-installer 234 | rm /usr/share/applications/deepin-installer.desktop || true 235 | rm /usr/share/dbus-1/services/com.deepin.dde.welcome.service || true 236 | 237 | # Disable autostarts, e.g., Antergos cnchi and Ubuntu MATE ubuntu-mate-welcome 238 | rm /etc/skel/.config/autostart/*.desktop 2>/dev/null || true 239 | 240 | # Remove gnome-getting-started 241 | apt-get -y remove --auto-remove gnome-getting-started-docs || true 242 | 243 | # Remove crap from desktop 244 | find /home/ -wholename "*Desktop/*.desktop" -exec rm {} \; 245 | 246 | # FN keys on Apple keyboard 247 | cat > /etc/modprobe.d/hid_apple.conf </dev/null && modprobe hid_apple 251 | 252 | # Dualhead on, works for NVidia on Ubuntu 11.04 at least - no longer needed in 14.04 253 | # cat > /etc/X11/Xsession.d/80dualhead <<\EOF 254 | # xrandr --output VGA-1 --right-of DVI-I-1 255 | # EOF 256 | 257 | echo "5" 258 | # Add universe 259 | if [ -e /etc/apt/sources.list ] ; then 260 | sed -i -e 's|main restricted|main universe multiverse restricted|g' /etc/apt/sources.list 261 | fi 262 | 263 | # Disable apt translations 264 | rm /var/lib/apt/lists/*_i18n_* 265 | cat >> /etc/apt/apt.conf </dev/null && ( 279 | # Proper K menu 280 | sed -i -e 's|launcher|simplelauncher|g' "${KDE4EVILFILE}" 281 | # Proper icons on desktop 282 | sed -i -e 's|new Activity(\"desktop\")|new Activity(\"folderview\")|g' "${KDE4EVILFILE}" 283 | # No more box around the desktop icons 284 | sed -i -e 's|folderview = activity.addWidget(\"folderview\");||g' "${KDE4EVILFILE}" 285 | sed -i -e 's|folderview.writeConfig(\"url\", \"desktop:/\");||g' "${KDE4EVILFILE}" 286 | # No more crap 287 | sed -i -e 's|activity.addWidget("twitter");||g' "${KDE4EVILFILE}" 288 | # No more sounds 289 | mkdir -p "/etc/skel/.kde/share/config/" 290 | cat > "/etc/skel/.kde/share/config/knotifyrc" <<\EOF 291 | [Sounds] 292 | No sound=true 293 | Use external player=false 294 | Volume=100 295 | EOF 296 | ) 297 | 298 | # Configure Xfce desktop 299 | mkdir -p /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/ 300 | cat > /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml <<\EOF 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | EOF 345 | 346 | # Do not ask about securing the keyring with a password; does this work? 347 | cat > /etc/skel/.local/share/keyrings/Default_keyring.keyring <<\EOF 348 | [keyring] 349 | display-name=Default keyring 350 | ctime=1526038479 351 | mtime=0 352 | lock-on-idle=false 353 | lock-after=false 354 | EOF 355 | 356 | echo "7" 357 | # Revert stupidity that prevents running executable files from FAT disks 358 | # https://forum.kde.org/viewtopic.php?f=225&t=108693 359 | # https://cgit.freedesktop.org/udisks/commit/?id=7e7ec1abca069e9443f8eed49acec4ea32589d0c 360 | # https://bugzilla.redhat.com/show_bug.cgi?id=646673 361 | # https://ubuntuforums.org/showthread.php?t=1665289 362 | # https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/663815 363 | # https://github.com/storaged-project/udisks/pull/708 364 | # https://github.com/storaged-project/udisks/issues/707 365 | if [ -e /usr/lib/udisks/udisks-daemon ] ; then 366 | sed -i -e 's|showexec|\x00\x00\x00\x00\x00\x00\x00\x00|g' /usr/lib/udisks/udisks-daemon 367 | fi 368 | if [ -e /usr/lib/udisks2/udisksd ] ; then 369 | sed -i -e 's|showexec|\x00\x00\x00\x00\x00\x00\x00\x00|g' /usr/lib/udisks2/udisksd # Ubuntu 12.10 370 | fi 371 | if [ -e /usr/libexec/udisks2/udisksd ] ; then 372 | sed -i -e 's|showexec|\x00\x00\x00\x00\x00\x00\x00\x00|g' /usr/libexec/udisks2/udisksd # Fedora 23 373 | fi 374 | 375 | # Set the correct timezone; TODO: Move this to the localization and make it dependent on cmdline 376 | if [ -e /usr/share/zoneinfo/Europe/Berlin ] ; then 377 | ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime 378 | fi 379 | 380 | # Do not use UTC on Ubuntu 381 | if [ -e /etc/default/rcS ] ; then 382 | sed -i -e 's|UTC=yes|UTC=no|g' /etc/default/rcS 383 | fi 384 | 385 | # Mount, link, and run .ExtensionImage files 386 | ARCH=$(uname -p) 387 | ARCH=$(arch) # for Debian 388 | EXTENSIONS=$(find $HERE/$ARCH/ -type f -name *ExtensionImage) 389 | EXTDIR=/var/run/Extensions 390 | mkdir -p "${EXTDIR}" 391 | for EXTENSION in $EXTENSIONS ; do 392 | SHORT=$(basename "${EXTENSION}") 393 | mkdir -p "${EXTDIR}"/"${SHORT}" 394 | mount -o loop,ro "${EXTENSION}" "${EXTDIR}"/"${SHORT}" 395 | cp -rsf "${EXTDIR}"/"${SHORT}"/* / 396 | cp -rsf "${EXTDIR}"/"${SHORT}"/lib/* /lib ### FIXME: Workaround for Fedora where lib is a link 397 | if [ -x "${EXTDIR}"/"${SHORT}"/ExtensionRun ] ; then 398 | "${EXTDIR}"/"${SHORT}"/ExtensionRun 399 | fi 400 | done 401 | 402 | echo "8" 403 | # Configure dual head setup 404 | mkdir -p /etc/gnome-settings-daemon/xrandr/ 405 | cat > /etc/gnome-settings-daemon/xrandr/monitors.xml <<\EOF 406 | cat ./.config/monitors.xml 407 | 408 | 409 | no 410 | 411 | BNQ 412 | BenQ GW2260 413 | X3D02624019 414 | 1080 415 | 1920 416 | 60 417 | 0 418 | 0 419 | right 420 | no 421 | no 422 | yes 423 | no 424 | 425 | 426 | BNQ 427 | BenQ GW2260 428 | X3D03548019 429 | 1920 430 | 1080 431 | 60 432 | 1080 433 | 496 434 | normal 435 | no 436 | no 437 | no 438 | no 439 | 440 | 441 | 442 | EOF 443 | 444 | echo "9" 445 | # Continue as usual 446 | tput sgr0 447 | if [ -s /usr/lib/systemd/systemd ] ; then 448 | if [ -s /etc/SuSE-release ] ; then 449 | # for OpenSUSE, works. CentOS 7 does not like this (stalls boot) 450 | exec /usr/lib/systemd/systemd 451 | fi 452 | fi 453 | 454 | echo "10" 455 | cat > /.hidden </dev/null # No fedora logo in the bottom right corner 485 | 486 | # Downloading debs without asking? On a live system? Give me a break! 487 | # xubuntu-16.04.1-desktop-amd64.iso has this 488 | rm -f /usr/bin/unattended-upgrade 2>/dev/null 489 | rm -f /etc/apt/apt.conf.d/20auto-upgrades 2>/dev/null 490 | 491 | # KDE Wallet is only annoying on a Live system 492 | rm -rf /usr/bin/kwallet* 2>/dev/null || true 493 | 494 | # Package ubuntu-web-launchers 495 | rm -rf /usr/share/applications/com.canonical.launcher.amazon.desktop 2>/dev/null || true 496 | rm -rf /usr/share/applications/ubuntu-amazon-default.desktop 2>/dev/null || true 497 | rm -rf /usr/share/ubuntu-web-launchers 2>/dev/null || true 498 | 499 | ############################################# 500 | # 501 | # Firefox 502 | # 503 | ############################################# 504 | 505 | # Remove system-provided Firefox. We bring our own AppImage 506 | rm /usr/share/applications/firefox.desktop || true 507 | rm /usr/share/applications/exo-web-browser.desktop || true 508 | 509 | # /usr/lib/firefox/defaults/pref/vendor-gre.js is the location on Ubuntu 510 | # Check user's settings in: 511 | # ./.mozilla/firefox/*.default/prefs.js 512 | 513 | mkdir -p /usr/lib/firefox/defaults/pref # Should not hurt 514 | 515 | cat > /usr/lib/firefox/defaults/pref/00_admin-prefs.js <<\EOF 516 | // Any comment. You must start the file with a single-line comment! 517 | // https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment_before_60 518 | pref("general.config.filename", "mozilla.cfg"); 519 | pref("general.config.obscure_value", 0); 520 | EOF 521 | 522 | cat >> /usr/lib/firefox/mozilla.cfg <<\EOF 523 | // Any comment. You must start the file with a comment! 524 | // https://developer.mozilla.org/en-US/Firefox/Enterprise_deployment_before_60 525 | 526 | // Disable updater 527 | lockPref("app.update.enabled", false); 528 | // make absolutely sure it is really off 529 | lockPref("app.update.auto", false); 530 | lockPref("app.update.mode", 0); 531 | lockPref("app.update.service.enabled", false); 532 | 533 | // Disable Add-ons compatibility checking 534 | clearPref("extensions.lastAppVersion"); 535 | 536 | // Don't show 'know your rights' on first run 537 | pref("browser.rights.3.shown", true); 538 | 539 | // Don't show WhatsNew on first run after every update 540 | pref("browser.startup.homepage_override.mstone","ignore"); 541 | 542 | // Set default homepage - users can change 543 | // Requires a complex preference 544 | defaultPref("browser.startup.homepage","data:text/plain,browser.startup.homepage=about:blank"); 545 | 546 | // Disable the internal PDF viewer 547 | pref("pdfjs.disabled", true); 548 | 549 | // Disable the flash to javascript converter 550 | pref("shumway.disabled", true); 551 | 552 | // Don't ask to install the Flash plugin 553 | pref("plugins.notifyMissingFlash", false); 554 | 555 | //Disable plugin checking 556 | lockPref("plugins.hide_infobar_for_outdated_plugin", true); 557 | clearPref("plugins.update.url"); 558 | 559 | // Disable health reporter 560 | lockPref("datareporting.healthreport.service.enabled", false); 561 | 562 | // Disable all data upload (Telemetry and FHR) 563 | lockPref("datareporting.policy.dataSubmissionEnabled", false); 564 | 565 | // Disable crash reporter 566 | lockPref("toolkit.crashreporter.enabled", false); 567 | Components.classes["@mozilla.org/toolkit/crash-reporter;1"].getService(Components.interfaces.nsICrashReporter).submitReports = false; 568 | 569 | // Other 570 | pref("browser.laterrun.enabled", false); 571 | pref("browser.onboarding.enabled", false); 572 | pref("browser.startup.firstrunSkipsHomepage", false); 573 | pref("browser.startup.homepage", "about:blank"); 574 | pref("datareporting.healthreport.uploadEnabled", false); 575 | pref("privacy.donottrackheader.enabled", true); 576 | pref("privacy.resistFingerprinting", true); 577 | pref("privacy.trackingprotection.enabled", true); 578 | pref("privacy.trackingprotection.introCount", 50); 579 | pref("signon.rememberSignons", false); 580 | pref("toolkit.telemetry.newProfilePing.enabled", false); 581 | pref("toolkit.telemetry.updatePing.enabled", false); 582 | EOF 583 | 584 | # openSUSE has it in /usr/lib64/firefox/ 585 | 586 | if [ -e /usr/lib64/firefox/ ] ; then 587 | cp -Rsf /usr/lib/firefox/* /usr/lib64/firefox/ 588 | fi 589 | 590 | ############################################# 591 | # 592 | # Font customization 593 | # 594 | ############################################# 595 | 596 | # Remove "font spam" 597 | 598 | rm -rf /usr/share/fonts/{open,true}type /usr/share/fonts/X11/Type1 || true 599 | mkdir -p /usr/share/fonts/{open,true}type /usr/share/fonts/X11/Type1/ 600 | 601 | # Use URW fonts 602 | 603 | cat > /etc/fonts/local.conf <<\EOF 604 | 605 | 606 | 607 | 608 | Liberation Sans 609 | Nimbus Sans L 610 | 611 | 612 | 613 | DejaVu Sans 614 | Nimbus Sans L 615 | 616 | 617 | 618 | 619 | 620 | 621 | Liberation Sans 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | DejaVu Sans 632 | 633 | 634 | 635 | 636 | 637 | 638 | Liberation Serif 639 | Nimbus Roman No9 L 640 | 641 | 642 | 643 | DejaVu Serif 644 | Nimbus Roman No9 L 645 | 646 | 647 | 648 | 649 | 650 | 651 | Liberation Serif 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | DejaVu Serif 662 | 663 | 664 | 665 | 666 | 667 | 668 | Monospace 669 | Nimbus Mono L 670 | 671 | 672 | 673 | 674 | 675 | 676 | Monospace 677 | 678 | 679 | 680 | 681 | 682 | 683 | EOF 684 | 685 | 686 | ############################################# 687 | # 688 | # Drop shadow cosmetics 689 | # 690 | ############################################# 691 | 692 | if [ -e /usr/share/themes/Greybird/xfwm4/themerc ] ; then 693 | sed -i -e 's|^shadow_delta_height=.*|shadow_delta_height=25|g' /usr/share/themes/Greybird/xfwm4/themerc 694 | sed -i -e 's|^shadow_delta_width=.*|shadow_delta_width=25|g' /usr/share/themes/Greybird/xfwm4/themerc 695 | sed -i -e 's|^shadow_delta_x=.*|shadow_delta_x=20|g' /usr/share/themes/Greybird/xfwm4/themerc 696 | sed -i -e 's|^shadow_delta_y=.*|shadow_delta_y=20|g' /usr/share/themes/Greybird/xfwm4/themerc 697 | sed -i -e 's|^shadow_opacity=.*|shadow_opacity=20|g' /usr/share/themes/Greybird/xfwm4/themerc 698 | fi 699 | 700 | ############################################# 701 | # 702 | # Terminal cosmetics 703 | # 704 | ############################################# 705 | 706 | # Black text on white background for XFCE Terminal 707 | mkdir -p /etc/skel/.config/xfce4/terminal/ 708 | cat > /etc/skel/.config/xfce4/terminal/terminalrc <<\EOF 709 | [Configuration] 710 | ColorForeground=#000000 711 | ColorBackground=#ffffff 712 | FontUseSystem=TRUE 713 | MiscAlwaysShowTabs=FALSE 714 | MiscBell=FALSE 715 | MiscBellUrgent=FALSE 716 | MiscBordersDefault=TRUE 717 | MiscCursorBlinks=FALSE 718 | MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK 719 | MiscDefaultGeometry=80x24 720 | MiscInheritGeometry=FALSE 721 | MiscMenubarDefault=TRUE 722 | MiscMouseAutohide=FALSE 723 | MiscMouseWheelZoom=TRUE 724 | MiscToolbarDefault=FALSE 725 | MiscConfirmClose=TRUE 726 | MiscCycleTabs=TRUE 727 | MiscTabCloseButtons=TRUE 728 | MiscTabCloseMiddleClick=TRUE 729 | MiscTabPosition=GTK_POS_TOP 730 | MiscHighlightUrls=TRUE 731 | MiscMiddleClickOpensUri=FALSE 732 | MiscCopyOnSelect=FALSE 733 | MiscShowRelaunchDialog=TRUE 734 | MiscRewrapOnResize=TRUE 735 | MiscUseShiftArrowsToScroll=FALSE 736 | MiscSlimTabs=FALSE 737 | MiscNewTabAdjacent=FALSE 738 | ColorBoldIsBright=FALSE 739 | EOF 740 | 741 | ############################################# 742 | # 743 | # AppImage handling 744 | # 745 | ############################################# 746 | 747 | cat > /tmp/executable.desktop <<\EOF 748 | [Desktop Entry] 749 | Version=1.0 750 | Name=executable 751 | Exec=bash -c "FILE=%f;chmod a+x \\$FILE;exec \\$FILE" 752 | Icon=utilities-terminal 753 | Terminal=false 754 | Type=Application 755 | Categories=Application; 756 | MimeType=application/x-executable; 757 | NoDisplay=true 758 | EOF 759 | sudo desktop-file-install /tmp/executable.desktop 760 | rm /tmp/executable.desktop 761 | 762 | sudo update-desktop-database /usr/share/applications/ 763 | 764 | ############################################# 765 | 766 | # Copy in skel 767 | # Apparently we are too late for skel being used, so copying it in by hand 768 | USERNAMES=$(cd /home && ls) 769 | for USERNAME in $USERNAMES; do 770 | # sudo -u $USERNAME ... 771 | mkdir -p /home/$USERNAME/ 772 | cp -Rf /etc/skel/. /home/$USERNAME # Note the . 773 | chown -R $USERNAME /home/$USERNAME/ 774 | done 775 | 776 | grep -r init= /proc/cmdline && exec /sbin/init 777 | -------------------------------------------------------------------------------- /boot/deltadir/etc/rc.d/init.d/livesys: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # live: Init script for live image 4 | # 5 | # chkconfig: 345 00 99 6 | # description: Init script for live image. 7 | ### BEGIN INIT INFO 8 | # X-Start-Before: display-manager 9 | ### END INIT INFO 10 | 11 | . /etc/init.d/functions 12 | 13 | if ! strstr "`cat /proc/cmdline`" rd.live.image || [ "$1" != "start" ]; then 14 | exit 0 15 | fi 16 | 17 | /usr/sbin/livesys 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /boot/deltadir/etc/systemd/system/default.target.wants/livesys.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Live Image 3 | Before=accounts-daemon.service 4 | 5 | [Service] 6 | #EnvironmentFile=/etc/sysconfig/crond 7 | ExecStart=/usr/sbin/livesys 8 | Type=oneshot 9 | 10 | [Install] 11 | WantedBy=default.target 12 | 13 | -------------------------------------------------------------------------------- /boot/deltadir/usr/sbin/livesys: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Based on former Fedora Init script for live image 4 | # 5 | 6 | grep -r rd.live /proc/cmdline || exit 0 7 | 8 | exists() { 9 | which $1 >/dev/null 2>&1 || return 10 | $* 11 | } 12 | 13 | touch /.liveimg-configured 14 | 15 | # Set username 16 | USERNAME="liveuser" 17 | USER=$(grep -o "rd.live.user=[a-zA-Z]*" /proc/cmdline | cut -d "=" -f 2) 18 | if [ -n $USER ]; then 19 | USERNAME=$USER 20 | fi 21 | 22 | # Make sure we don't mangle the hardware clock on shutdown 23 | ln -sf /dev/null /etc/systemd/system/hwclock-save.service 24 | 25 | livedir="LiveOS" 26 | for arg in `cat /proc/cmdline` ; do 27 | if [ "${arg##rd.live.dir=}" != "${arg}" ]; then 28 | livedir=${arg##rd.live.dir=} 29 | return 30 | fi 31 | if [ "${arg##live_dir=}" != "${arg}" ]; then 32 | livedir=${arg##live_dir=} 33 | return 34 | fi 35 | done 36 | 37 | # enable swaps unless requested otherwise 38 | swaps=`blkid -t TYPE=swap -o device` 39 | if ! strstr "`cat /proc/cmdline`" noswap && [ -n "$swaps" ] ; then 40 | for s in $swaps ; do 41 | action "Enabling swap partition $s" swapon $s 42 | done 43 | fi 44 | if ! strstr "`cat /proc/cmdline`" noswap && [ -f /run/initramfs/live/${livedir}/swap.img ] ; then 45 | action "Enabling swap file" swapon /run/initramfs/live/${livedir}/swap.img 46 | fi 47 | 48 | mountPersistentHome() { 49 | # support label/uuid 50 | if [ "${homedev##LABEL=}" != "${homedev}" -o "${homedev##UUID=}" != "${homedev}" ]; then 51 | homedev=`/sbin/blkid -o device -t "$homedev"` 52 | fi 53 | 54 | # if we're given a file rather than a blockdev, loopback it 55 | if [ "${homedev##mtd}" != "${homedev}" ]; then 56 | # mtd devs don't have a block device but get magic-mounted with -t jffs2 57 | mountopts="-t jffs2" 58 | elif [ ! -b "$homedev" ]; then 59 | loopdev=`losetup -f` 60 | if [ "${homedev##/run/initramfs/live}" != "${homedev}" ]; then 61 | action "Remounting live store r/w" mount -o remount,rw /run/initramfs/live 62 | fi 63 | losetup $loopdev $homedev 64 | homedev=$loopdev 65 | fi 66 | 67 | # if it's encrypted, we need to unlock it 68 | if [ "$(/sbin/blkid -s TYPE -o value $homedev 2>/dev/null)" = "crypto_LUKS" ]; then 69 | echo 70 | echo "Setting up encrypted /home device" 71 | plymouth ask-for-password --command="cryptsetup luksOpen $homedev EncHome" 72 | homedev=/dev/mapper/EncHome 73 | fi 74 | 75 | # and finally do the mount 76 | mount $mountopts $homedev /home 77 | # if we have /home under what's passed for persistent home, then 78 | # we should make that the real /home. useful for mtd device on olpc 79 | if [ -d /home/home ]; then mount --bind /home/home /home ; fi 80 | [ -x /sbin/restorecon ] && /sbin/restorecon /home 81 | mkdir -p /home/$USERNAME ##### 82 | if [ -d /home/$USERNAME ]; then USERADDARGS="-M" ; fi 83 | } 84 | 85 | findPersistentHome() { 86 | for arg in `cat /proc/cmdline` ; do 87 | if [ "${arg##persistenthome=}" != "${arg}" ]; then 88 | homedev=${arg##persistenthome=} 89 | return 90 | fi 91 | done 92 | } 93 | 94 | if strstr "`cat /proc/cmdline`" persistenthome= ; then 95 | findPersistentHome 96 | elif [ -e /run/initramfs/live/${livedir}/home.img ]; then 97 | homedev=/run/initramfs/live/${livedir}/home.img 98 | fi 99 | 100 | # if we have a persistent /home, then we want to go ahead and mount it 101 | if ! strstr "`cat /proc/cmdline`" nopersistenthome && [ -n "$homedev" ] ; then 102 | action "Mounting persistent /home" mountPersistentHome 103 | fi 104 | 105 | # make it so that we don't do writing to the overlay for things which 106 | # are just tmpdirs/caches 107 | mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum 108 | mount -t tmpfs vartmp /var/tmp 109 | [ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /var/tmp >/dev/null 2>&1 110 | 111 | if [ -n "$configdone" ]; then 112 | exit 0 113 | fi 114 | 115 | # add fedora user with no passwd 116 | action "Adding live user" useradd $USERADDARGS -c "Live System User" $USERNAME 117 | passwd -d $USERNAME > /dev/null 118 | usermod -aG wheel $USERNAME > /dev/null 119 | 120 | # Remove root password lock 121 | passwd -d root > /dev/null 122 | 123 | # don't use prelink on a running live image 124 | sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || : 125 | 126 | # turn off mdmonitor by default 127 | systemctl --no-reload disable mdmonitor.service 2> /dev/null || : 128 | systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || : 129 | systemctl stop mdmonitor.service 2> /dev/null || : 130 | systemctl stop mdmonitor-takeover.service 2> /dev/null || : 131 | 132 | # don't enable the gnome-settings-daemon packagekit plugin 133 | gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || : 134 | 135 | # don't enable automatic download of updates 136 | gsettings set org.gnome.software download-updates 'false' || : 137 | chmod a-x /usr/libexec/packagekitd 138 | 139 | # don't start cron/at as they tend to spawn things which are 140 | # disk intensive that are painful on a live image 141 | systemctl --no-reload disable crond.service 2> /dev/null || : 142 | systemctl --no-reload disable atd.service 2> /dev/null || : 143 | systemctl stop crond.service 2> /dev/null || : 144 | systemctl stop atd.service 2> /dev/null || : 145 | 146 | # add static hostname to work around xauth bug 147 | # https://bugzilla.redhat.com/show_bug.cgi?id=679486 148 | echo "localhost" > /etc/hostname 149 | 150 | # Set hostname 151 | HOST=$(grep -o "rd.live.host=[a-zA-Z]*" /proc/cmdline | cut -d "=" -f 2) 152 | if [ -n $HOST ]; then 153 | echo "$HOST" > /etc/hostname 154 | fi 155 | 156 | # disable updates plugin 157 | cat >> /usr/share/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.override << FOE 158 | [org.gnome.settings-daemon.plugins.updates] 159 | active=false 160 | FOE 161 | 162 | # don't run gnome-initial-setup 163 | mkdir /home/$USERNAME/.config 164 | touch /home/$USERNAME/.config/gnome-initial-setup-done 165 | 166 | # rebuild schema cache with any overrides we installed 167 | glib-compile-schemas /usr/share/glib-2.0/schemas 168 | 169 | # set up auto-login 170 | cat > /etc/gdm/custom.conf << FOE 171 | [daemon] 172 | AutomaticLoginEnable=True 173 | AutomaticLogin=$USERNAME 174 | FOE 175 | 176 | # make sure to set the right permissions and selinux contexts 177 | chown -R $USERNAME:$USERNAME /home/$USERNAME/ 178 | restorecon -R /home/$USERNAME/ 179 | 180 | # Set keyboard language 181 | # Example: boot with keymap=de or vconsole.keymap=de-latin1-nodeadkeys 182 | # (the latter also sets the keymap inside the initramfs) 183 | # Certainly not the way to do this but it works, unlike 184 | # vconsole.conf which is apparently ignored by Xorg 185 | MAP=$(grep -o "keymap=[a-zA-Z]*" /proc/cmdline | cut -d "=" -f 2) 186 | if [ -n $MAP ]; then 187 | echo "setxkbmap $MAP" >> /etc/bashrc 188 | fi 189 | 190 | RW=$(grep -o " rw " /proc/cmdline) 191 | if [ -n $RW ]; then 192 | mount /run/initramfs/isoscan/ -o remount,rw 193 | fi 194 | 195 | /run/initramfs/isoscan/boot/customize/init 196 | 197 | exit 0 198 | -------------------------------------------------------------------------------- /boot/grub/device.map: -------------------------------------------------------------------------------- 1 | (hd0) /dev/loop0 2 | (hd0,1) /dev/loop1 3 | -------------------------------------------------------------------------------- /boot/grub/grubenv: -------------------------------------------------------------------------------- 1 | # GRUB Environment Block 2 | ####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/casper-patches/scripts/local-bottom/15test: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | PREREQ="" 4 | DESCRIPTION="Touch LOCAL-BOTTOM..." 5 | 6 | prereqs() 7 | { 8 | echo "$PREREQ" 9 | } 10 | 11 | case $1 in 12 | # get pre-requisites 13 | prereqs) 14 | prereqs 15 | exit 0 16 | ;; 17 | esac 18 | 19 | . /scripts/casper-functions 20 | 21 | log_begin_msg "$DESCRIPTION" 22 | 23 | touch /root/LOCAL-BOTTOM 24 | -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/dracut-deltadir-support/lib/dracut/hooks/pre-pivot/30-deltadir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Newer Dracut (e.g., on openSUSE Tubmbleweed as of 5/2018 4 | # expects this in lib/dracut/hooks rather than 5 | # usr/lib/dracut/hooks 6 | 7 | # Recursively link files into to the root of the live system 8 | # Example: 9 | # rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir 10 | # would recursively symlink the contents of /boot/deltadir 11 | # on the partition on which the ISO is located 12 | # into / of the live system 13 | # (also known as /sysroot or $NEWROOT at runtime) 14 | 15 | DELTADIR=$(getarg rd.live.deltadir=) 16 | 17 | if [ "$DELTADIR" == "" ] ; then 18 | echo "No deltadir specified" 19 | echo "Example: rd.live.deltadir=/run/initramfs/isoscan/boot/deltadir" 20 | else 21 | cp -rsf "${DELTADIR}"/* "${NEWROOT}"/ 22 | fi 23 | -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/dracut-deltadir-support/lib/dracut/hooks/pre-pivot/31-lang.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Newer Dracut (e.g., on openSUSE Tubmbleweed as of 5/2018 4 | # expects this in lib/dracut/hooks rather than 5 | # usr/lib/dracut/hooks 6 | 7 | LOCALE=$(getarg locale.LANG) 8 | 9 | if [ "$LOCALE" == "" ] ; then 10 | echo "No locale specified" 11 | echo "Example: locale.LANG=de_DE.UTF-8" 12 | else 13 | # Set the language 14 | cat > "${NEWROOT}"/etc/locale.conf < "${NEWROOT}"/etc/locale.conf < "${HERE}/initramfs" 31 | 32 | cd - >/dev/null 33 | 34 | rm -r "${TEMP}" 35 | -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/kiwi-international/kiwi-hooks/postmount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | touch /mnt/.kiwiPostmountRan 4 | 5 | # Set keyboard and language according to 6 | # https://github.com/openSUSE/kiwi/issues/355 7 | 8 | sed -i -e 's|RC_LANG=\"\"|RC_LANG=\"de_DE.UTF-8\"|g' \ 9 | /mnt/etc/sysconfig/language 10 | 11 | sed -i -e 's|ROOT_USES_LANG=\"ctype\"|ROOT_USES_LANG=\"yes\"|g' \ 12 | /mnt/etc/sysconfig/language 13 | 14 | sed -i -e 's|KEYTABLE=\"us.map.gz\"|KEYTABLE=\"de-latin1-nodeadkeys\"|g' \ 15 | /mnt/etc/sysconfig/keyboard 16 | 17 | # http://www.freedesktop.org/software/systemd/man/locale.conf.html 18 | # The /etc/locale.conf file configures system-wide locale settings. 19 | # It is read at early-boot by systemd(1). 20 | # But seemingly this does not impact GNOME on openSUSE. 21 | # cat > /mnt/etc/locale.conf </dev/null 2>&1 || . /lib/dracut-lib.sh 11 | 12 | # isofrom="/dev/sda1:/m4.iso" 13 | if [ -n "$isofrom" ]; then 14 | isomount="/live/isomount" 15 | isodev=$(echo "$isofrom" | sed 's,:.*$,,g') 16 | isofile=$(echo "$isofrom" | sed 's,^.*:,,g') 17 | if [ ! -z "$isodev" -a ! -z "$isofile" ]; then 18 | mkdir -m 0755 -p "$isomount" 19 | else 20 | emergency_shell -n isofrom "Break in liveiso, check isodev and isofrom " 21 | fi 22 | 23 | echo 01-mageia-liveiso-2 24 | sleep 1 # Needed on my system; FIXME 25 | 26 | isodevfs=$(blkid -s TYPE -o value "$isodev") 27 | grep -q "$isomount" /proc/mounts || mount -n -r -t "$isodevfs" "$isodev" "$isomount" || emergency_shell -n isofrom "Break in liveiso, mounting failed" 28 | 29 | if [ -e "${isomount}${isofile}" ]; then 30 | 31 | losetup -a | grep -q "${isomount}${isofile}" 32 | if [ $? -ne 0 ]; then 33 | losetup $(losetup -f) "${isomount}${isofile}" || emergency_shell -n isofrom "Break in liveiso, losetup failed" 34 | fi 35 | else 36 | emergency_shell -n isofrom "Break in liveiso, isofile does not exist" 37 | fi 38 | fi 39 | -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/mageia-isofrom/usr/lib/dracut/hooks/pre-pivot/10-isodevice.sh: -------------------------------------------------------------------------------- 1 | # For Mageia 5 2 | # We want to be able to access the device on which the ISO resides 3 | # from the booted system 4 | if [ -e /live/isomount ] ; then 5 | mkdir -p $NEWROOT/isodevice 6 | mount --move /live/isomount $NEWROOT/isodevice 7 | fi 8 | -------------------------------------------------------------------------------- /boot/iso/additional-initramfs/mageia-isofrom/usr/lib/dracut/hooks/pre-pivot/11-disable-finish-install.sh: -------------------------------------------------------------------------------- 1 | # For Mageia 5 2 | # Boot straight into the Live system without showing a nag screen 3 | # The below does work, but as Mageia does not pick up the correct language yet 4 | # it is temporarily disabled 5 | 6 | # if [ -e $NEWROOT/etc/mageia-release ] ; then 7 | # mkdir -p $NEWROOT/etc/sysconfig/ 8 | # cat > $NEWROOT/etc/sysconfig/finish-install <