├── .bochsrc ├── .gitignore ├── COPYING ├── Makefile ├── NEWS ├── README ├── TODO ├── conf ├── config.in ├── modules.bootstrap ├── modules.exclude ├── modules.exclude.x86_64 ├── modules.iso ├── modules.kernel ├── modules.stage1 ├── modules.stage2 └── modules.toolchain ├── efiboot └── loader │ ├── entries │ ├── lunariso-x86_64-cd.conf │ └── lunariso-x86_64-usb.conf │ └── loader.conf ├── isolinux ├── README ├── f1.txt.i686 ├── f1.txt.x86_64 ├── f2.txt.i686 ├── f2.txt.x86_64 ├── f3.txt.i686 ├── f3.txt.x86_64 ├── generate-iso.sh ├── isolinux.cfg.i686 └── isolinux.cfg.x86_64 ├── kernels ├── README └── conf │ ├── generic.i686 │ └── generic.x86_64 ├── livecd └── template │ └── etc │ ├── fstab │ ├── issue │ ├── issue.net │ ├── lsb-release │ ├── motd │ ├── os-release │ └── systemd │ └── system │ ├── autovt@.service │ ├── default.target │ ├── getty.target.wants │ ├── getty@tty1.service │ ├── getty@tty2.service │ ├── getty@tty3.service │ ├── getty@tty4.service │ ├── getty@tty5.service │ └── getty@tty6.service │ ├── getty@.service │ ├── installer.target │ ├── installer.target.wants │ ├── installer@tty1.service │ └── installer@ttyS0.service │ └── installer@.service ├── lunar-install ├── .gitignore ├── Makefile ├── etc │ └── config.sh ├── lib │ ├── block_devices.lunar │ ├── bootloader.lunar │ ├── chroot.lunar │ ├── consolefont.lunar │ ├── dialogs.lunar │ ├── discs.lunar │ ├── editors.lunar │ ├── express_mkpart.lunar │ ├── filesystems.lunar │ ├── fstab.lunar │ ├── grub.lunar │ ├── grub2.lunar │ ├── installer.lunar │ ├── kernel.lunar │ ├── kernel_mods.lunar │ ├── keymaps.lunar │ ├── languages.lunar │ ├── lilo.lunar │ ├── packages.lunar │ ├── partitions.lunar │ ├── password.lunar │ ├── proxy.lunar │ ├── shell.lunar │ ├── timezones.lunar │ └── transfer.lunar └── sbin │ ├── lish │ └── lunar-install.sh ├── mkfiles ├── bootstrap.mk ├── download.mk ├── installer.mk ├── iso.mk ├── kernel.mk ├── pack.mk ├── stage1.mk └── stage2.mk ├── scripts ├── bootstrap-lunar-cache ├── chroot-build ├── create-efi-image ├── download-lunar-spool ├── make-squashfs └── pack-moonbase-git └── template ├── README ├── etc ├── dracut.conf.d │ └── 02-lunar-live.conf ├── fstab ├── group ├── host.conf ├── hosts ├── ld.so.conf ├── lunar │ └── local │ │ ├── .config.current │ │ ├── config │ │ ├── depends │ │ ├── glibc │ │ ├── lilo │ │ ├── net-tools │ │ └── systemd │ │ ├── net-tools.config.h │ │ ├── optimizations.CCACHE │ │ ├── optimizations.GCC │ │ ├── optimizations.GNU_LD │ │ ├── optimizations.GNU_MAKE │ │ └── optimizations.WRAPPERS ├── modules ├── modules.conf ├── nsswitch.conf ├── passwd ├── protocols ├── securetty ├── services ├── shadow └── shells ├── motd └── var └── state └── lunar └── depends /.bochsrc: -------------------------------------------------------------------------------- 1 | # 2 | # generic bochsrc to test the lunar iso's in emulation mode 3 | # 4 | 5 | # this script is setup to work with a hda image file in sparse mode, 6 | # you will have to create it by issueing the following command: 7 | # `bximage -hd -mode=sparse -size=2048 -q hda` 8 | 9 | romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xf0000 10 | vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest 11 | 12 | # the following enables bochs to run without X11, you will have to 13 | # compile bochs with terminal support like this: 14 | # `lin -rc boch --opts '--without-x11 --with-term'` 15 | config_interface: textconfig 16 | display_library: term 17 | 18 | megs: 128 19 | ips: 10000000 20 | 21 | ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14 22 | ata1: enabled=0, ioaddr1=0x170, ioaddr2=0x370, irq=15 23 | ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e0, irq=11 24 | ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x360, irq=9 25 | 26 | ata0-master: type=disk, path="hda", mode=sparse, cylinders=4063, heads=16, spt=63 27 | ata0-slave: type=cdrom, path=lunar.iso, status=inserted 28 | 29 | boot: cdrom,disk 30 | 31 | log: .bochs.log 32 | 33 | mouse: enabled=0, type=imps2 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | /*.iso 3 | /BUILD/ 4 | /spool/ 5 | /cache/ 6 | /conf/config 7 | /conf/modules.all 8 | /moonbase-git/ 9 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile to make ISO's 3 | # 4 | 5 | # Default target 6 | all: iso 7 | 8 | # 9 | # all user configurable options are in conf/config 10 | # 11 | 12 | # need to make this defined during run-time 13 | ISO_SOURCE:=$(shell bash -c "pwd -P") 14 | 15 | # define the kernel arch name 16 | ###ISO_KARCH=$(shell arch | grep -qw i.86 && echo i386 || arch) 17 | # and the general arch (i386/i686) 18 | ISO_ARCH:=$(shell arch) 19 | 20 | include $(ISO_SOURCE)/conf/config 21 | 22 | $(ISO_SOURCE)/conf/config: 23 | @echo First copy conf/config.in to conf/config and change the base 24 | @echo parameters. Afterwards run make again. 25 | 26 | ###ISO_KSUFFIX = $(shell if echo $(ISO_KVER) | grep -q "^2\.6\." ; then echo 2.6 ; else echo 2.4 ; fi ;) 27 | 28 | ifeq ($(ISO_GCCARCH),x86-64) 29 | ISO_LD_LINUX = ld-linux-$(ISO_GCCARCH).so.2 30 | else 31 | ISO_LD_LINUX = ld-linux.so.2 32 | endif 33 | 34 | # define the location where the ISO will be generated 35 | ISO_TARGET = $(ISO_SOURCE)/BUILD 36 | 37 | ###export ISO_SOURCE ISO_TARGET ISO_MAJOR ISO_MINOR ISO_VERSION ISO_CODENAME \ 38 | ### ISO_DATE ISO_CNAME ISO_KVER ISO_PVER ISO_GRSVER ISO_LUNAR_MODULE \ 39 | ### ISO_KSUFFIX ISO_MAKES ISO_REDUCE ISO_BUILD ISO_KARCH ISO_GCCARCH 40 | 41 | export ISO_SOURCE ISO_TARGET ISO_BUILD ISO_VERSION ISO_CODENAME ISO_DATE ISO_LABEL ISO_MAJOR 42 | 43 | .SUFFIXES: 44 | 45 | include mkfiles/bootstrap.mk 46 | include mkfiles/download.mk 47 | include mkfiles/stage1.mk 48 | include mkfiles/stage2.mk 49 | include mkfiles/pack.mk 50 | include mkfiles/kernel.mk 51 | include mkfiles/installer.mk 52 | include mkfiles/iso.mk 53 | 54 | clean: 55 | rm -rf $(ISO_TARGET) $(ISO_SOURCE)/{spool,cache} 56 | 57 | # Convenient target for development 58 | chroot: 59 | $(ISO_SOURCE)/scripts/chroot-build /bin/bash 60 | 61 | dist: 62 | @sha1sum lunar-$(ISO_VERSION).iso > lunar-$(ISO_VERSION).iso.sha1 63 | @xz lunar-$(ISO_VERSION).iso 64 | @sha1sum lunar-$(ISO_VERSION).iso.xz > lunar-$(ISO_VERSION).iso.xz.sha1 65 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | 20100823 1.6.5 ratler 2 | * 1.6.5 final release 3 | 4 | * Modules 5 | - Kernel config bumped to 2.6.35.3 6 | - Wireless firmware now also available on the LiveCD 7 | 8 | * Installer 9 | - EXT4 is now default 10 | 11 | * Script changes 12 | - isofs 13 | - Enable hybrid ISO support 14 | - initrd 15 | - Cosmetic change of boot banner 16 | - kernels 17 | - Prevent the kernel source from thinking it's inside a git repository when building 18 | 19 | 20100709 1.6.5-rc1 ratler 20 | * 1.6.5 rc 1 release 21 | 22 | * Modules 23 | - Kernel config bumped to 2.6.34.1 24 | - Added screen 25 | 26 | * Installer 27 | - Added template files for openssh on the liveCD 28 | - Added USE_CLEAR option for the function chroot_run() to clear screen before executing commands 29 | - Create missing directory /var/log/lunar/queue 30 | - Check for kernel sources in $TARGET 31 | - Fixed a bug in install and md5sum logs generation for precompiled kernels 32 | 33 | * Script changes 34 | - initrd 35 | - Autodectect correct glibc library version to install 36 | - Updated list of udev helpers to copy 37 | - Makefile 38 | - dist: Changed md5sum to sha1sum 39 | 40 | 20100315 1.6.5-beta2 ratler 41 | * 1.6.5 beta 2 release 42 | 43 | * Modules 44 | - Kernel config bumped to 2.6.32.9 45 | - openssh now part of the liveCD 46 | - Added a few dependencies needed by udev 47 | - Added grub2 to sources 48 | 49 | * Installer 50 | - Generate md5sum and install logs for pre-compiled kernels 51 | - Added support to change preferred fstab style; UUID, LABEL or device name 52 | - Bumped isolinux.bin version 53 | 54 | * Script changes 55 | - initrd 56 | - Updated list of needed udev files 57 | - etc 58 | - Create default devices needed by udev 59 | 60 | 20100212 1.6.5-beta1 ratler 61 | * 1.6.5 beta 1 release 62 | 63 | * Modules 64 | - Kernel config bumped to 2.6.32.7 65 | - Added yasm, gperf, libusb-compat, xz, gmp, mpfr, cron-common, 66 | logrotate, rsyslog, iwlwifi-3945-ucode, iwlwifi-4965-ucode, 67 | iwlwifi-5000-ucode and mc 68 | - Removed mktemp, device-mapper and lard 69 | 70 | * Installer 71 | - Added support for EXT4 filesystem 72 | - Updated template files for gcc optimizations 73 | 74 | * Script changes 75 | - initrd 76 | - udev changes 77 | - Updated files to be included 78 | - Copy only needed kernel modules 79 | - aaa_base 80 | - Fixed issue rmdir non directories 81 | - Copy the correct lunar/local/optimization.* files 82 | - rebuild 83 | - sysvinit need to be rebuilt last, after removing inittab or it won't get tracked 84 | - Changed GCC_4_2 -> GCC_4_4 85 | 86 | 20081224 1.6.4 ratler 87 | * Final release of 1.6.4 'Lacus Autumni' for both i686 and x86-64 88 | 89 | * Modules 90 | - Kernel bumped to 2.6.27.10 91 | - Removed USB modem modules from the precompiled kernels 92 | - All packages refreshed 93 | - lsb-release added 94 | 95 | * Installer 96 | - The installer will now skip 'swap file' step if a swap partition 97 | was added 98 | - Bumped isolinux.bin version 99 | 100 | 20081012 1.6.4-beta1 ratler 101 | * Beta 1 release! 102 | 103 | * Modules 104 | - Kernel bumped to 2.6.27 105 | - All packages refreshed 106 | - freetype2 removed 107 | 108 | * Installer 109 | - Fixed issue with swap partitions showing up twice in fstab 110 | if you add more than one 111 | - Fixed issue with block device list, Bash 3.2 changed behavior 112 | in =~ operator, the regex can no longer be quoted 113 | - Modified a small problem in transfer() where some variables got 114 | assigned with the wrong values. Also added a feature to list 115 | what filesystem type you choosed for the assigned partition 116 | - Disabled the dialog that tell the user to rebuild the kernel for 117 | xfs, jfs and reiserfs since the kernel now includes them by default 118 | - More software raid fixes from ElAngelo 119 | - We now disable /tmp on tmpfs if the user add a /tmp partition 120 | - Precompiled kernels will now get registered as installed 121 | - Simplified the language menu. This time the iso process will 122 | create a file on the iso that contain a language list 123 | - perl moved from extended.list -> base.list, needed for vim to work 124 | on the iso 125 | - As mentioned the default kernel config now compile xfs, jfs and reiserfs 126 | as builtin 127 | 128 | * Script changes 129 | - isofs 130 | - Disable memtest on x86_64 (doesn't build or work anyway) 131 | - New isolinux templates for x86_64, needed since memtest is gone 132 | - rebuild 133 | - Make sure we copy the kernel config for the correct arch to the ISO 134 | - initrd 135 | - Fixed lib64 symlink issue, could cause issues with the running system 136 | - memtest 137 | - exit 0 if x86_64 138 | - gen_locale_list 139 | - New script to generate a language list from the locale-archive in $ISO_TARGET 140 | 141 | 142 | 20080914 1.6.4-alpha3 ratler 143 | * Alpha release 3 144 | 145 | - Fixed issue with packages showing up twice in state/lunar/packages 146 | - udev should now install fine inside the BUILD chroot 147 | - Remove bits/syscall.h before lin -c glibc since glibc does a file 148 | and compare check during make install that decide it's unchanged 149 | and not installing it 150 | - scripts/aaa_base: Removed explicit kernel-headers-X.X from packages 151 | file generation, kernel-headers are already listed in base.list-X.X 152 | - Auto-generate copyright year for isolinux files 153 | - Added rootdelay=10 to kernel options for isolinux, let usb settle 154 | before probing for devices containing the installation 155 | - Kernel config bumped to 2.6.26.5 156 | - Initrd: 157 | - Support booting installation from any media. For example you can 158 | put syslinux on a usb stick and copy initrd and kernel from the 159 | iso, and then put the iso it self on the usb-stick and boot away. 160 | It's also possible to put the .iso in the root of any mountable 161 | partition (a script will be available later to bootstrap this) 162 | - No more udev/rules.d template, instead take rules.d from the installed 163 | udev and wash them to make them work properly with the initrd 164 | - Installer: 165 | - Disable staticly defined mount point in fstab that match a user 166 | defined mount point during partition selection (currently only /tmp) 167 | - Further improvements to the language menu to also include territory 168 | for each encoding 169 | - Detect protected device (won't show up in the partition selection), 170 | this is the device where the .iso reside for the alternative installation 171 | method 172 | - Added initd.disable.list file in conf/ that contain services that should 173 | be disabled by default 174 | - Added grub and md fixes from ElAngelo 175 | 176 | 20080909 1.6.4-alpha2 ratler 177 | * Alpha 1 & 2 release 178 | 179 | - Updated initrd to support new udev 180 | - Added udev rules.d files to template (Will automate this later) 181 | - Updated font selection code in the installer 182 | - Rewrote language menu in the installer, gather locales 183 | from the current glibc install 184 | - Module changes: 185 | - vixie-cron -> cronie 186 | - links2 -> links 187 | 188 | Unreleased moe 189 | * Testing ISO 190 | 191 | - Added make target precheck (to download all required sources) 192 | - Added make target prebuild (to generate all build caches) 193 | - Removed a couple of outdated packages 194 | - Replaced iputils with inetutils (no docbook on the ISO) 195 | - scripts/rebuild: Use mount --bind 196 | - scripts/rebuild: Removed makedev 197 | - scripts/rebuild: Added dependency cache generation 198 | 199 | 20070210 1.6.1 sofar 200 | * Final release of 1.6.1 for both i686 and x86_64 201 | 202 | - kernel src unpack bugfixes 203 | - extra ldconfig step 204 | - Updated memtest version to 1.70 205 | - Fixed f4 display to show uhci-hcd instead of uhci_hcd etc. 206 | - made bootloader code optional based on availability 207 | - all packages refreshed 208 | 209 | 210 | 20070110 1.6.1-rc2 sofar 211 | * update release - release candidate 2 212 | 213 | - all packages refreshed 214 | 215 | 216 | 20061110 1.6.1rc1 sofar 217 | * update release - release candidate 1 218 | 219 | - Enable EFI boot support 220 | - remove -mm -prepatch -grsec kernel sources alltogether 221 | - update all packages to moonbase-20061110: kernel 2.6.18.2 222 | 223 | 224 | 20060405 1.6.0-i686 sofar 225 | * Feature release - First 2.6-based -final release 226 | 227 | - Allow the user to pass a module on the boot prompt so it gets loaded 228 | even if discover doesn't find it (e.g.: linux uhci-hcd) 229 | - separate motd on the ISO 230 | - upgraded isolinux to 3.11 - hopefully fixes some boot issues I've had 231 | - upgraded kernels to 2.6.16. Added older grsec and -mm4 kernels 232 | precompiled only 233 | - full vim on the rescue part 234 | - new packages: foremost, irqbalance, lftp 235 | - better kernel configs with smp, 4gb mem by default 236 | - fix overwriting of grub/lilo confs 237 | - a kernel source is now extracted and configured on the target so that 238 | packages which require kernel sources to be present in /usr/src/linux 239 | will compile OOTB (XOrg etc) 240 | 241 | 242 | 20060206 1.6.0-i686-rc3 sofar 243 | * bugfix/feature release 244 | 245 | - Added software RAID creation tool, fixed some md-device 246 | recognition problems 247 | - integrated normal vc shells 248 | - Fixed all known grub installation issues 249 | - rewrite block device code completely 250 | - added irqbalance package 251 | - Incorporated more progress into the progress bar display 252 | 253 | 254 | 20060126 1.6.0-i686-rc2 sofar 255 | * development/bugfix release 256 | 257 | - implemented copying of cache tarballs to installed system 258 | - added dmidecode (hints for hw detection) 259 | - added ethtool (NIC link type debugging) 260 | - kept dialog at downgraded 20050306 261 | - fixed fdisc/partition miscount only seeing 1 disc 262 | - added LSI/Megaraid drivers as module 263 | - fixed grsec kernels not being built 264 | - added 'server' type kernel config for performance to bigmem 265 | kernels and tweaked IO performance 266 | 267 | 268 | 20060105 1.6.0-i686-rc1 sofar 269 | * development release 270 | 271 | - fixed SATA and SCSI disc detection 272 | - added "wipe" utility, moved setserial to source-only 273 | - enabled nptl threads in glibc 274 | - added auto-boot after 1 minute timeout 275 | - enabled nfs as root device for netbooting 276 | - fixed root device detect code loop 277 | - added grsecurity kernels 278 | - downgraded dialog to 20050306 due to menu bug 279 | 280 | 281 | 20051121 1.6.0-i686-alpha1 sofar 282 | * tentative 2.6-based release (very alpha) 283 | 284 | - fixed 2.6-kernel compilation 285 | - integrated udev, sysfstools, hotplug properly 286 | 287 | 288 | 20051115 1.5.2-i686-rc1 sofar 289 | * update release 290 | 291 | - reworked the kerneel configuration code 292 | - fixed a minor warnign message in the installer 293 | - updated all modules to gcc-3.4.4, glibc-2.3.6 294 | - updated README to better reflect what a user should do 295 | 296 | 297 | 20050818 1.5.1-i686 1.5.1-i386 sofar 298 | * development and bugfix release 299 | 300 | - cleaned up the install menus 301 | - added dosfstools and ntfsprogs 302 | - moved tnftp and dhcpcd to the ISO stage 303 | - added 'make test' target 304 | - added USB and mass storage drivers to the initrd 305 | - add 'luser' back to the installer 306 | - cleaned up navigation in the settings menu 307 | - fixed a partition list bug 308 | - enable swap only when compiling kernels 309 | 310 | 311 | 20050802 1.5.1-i386-rc1 sofar 312 | * development release: new arch (i386) 313 | 314 | - fixed aaa_base tarball generation 315 | - added some portability code 316 | 317 | 318 | 20050731 1.5.1-686-rc1 sofar 319 | * Development and bugfix release 320 | 321 | - replaced firstboot screen by striker 322 | - added lard as replacement of sysklogd 323 | - removed separate discover build code 324 | - fix mkfs.xfs run 325 | - added exit/reboot option at the beginning of the installer 326 | - rewrote device naming completely so you can use normal device 327 | names everywhere 328 | - allow extra device nodes to be added manually (raid, loop) 329 | - removed some debug kernel items 330 | - deleted operator account 331 | - adding default selector to all locale menus 332 | - fix swap type display (was 'none') 333 | - replaced lynx with links2 334 | - replaced BitchX with irssi 335 | - enable serial console for the default kernels 336 | 337 | 338 | 20050523 1.5.0-i686-final sofar 339 | * Final release of 1.5.0-i686 340 | 341 | - rewrote menu-order so language and keymap are first now 342 | - backported some of nestu's portable 2.6 changes 343 | - adding SMP building and new targets, reorganised the 344 | build routine heavily. 345 | - cleaned up editor selection menu 346 | - added a long README which serves as introduction 347 | - removed db 348 | 349 | 350 | 20050517 1.5.0-i686-pre3 sofar 351 | * major bugfix release: 352 | 353 | - fix modprobe failing on stripped modules, wrappers 354 | - bigger initrd size 355 | - fix missing devfsd on initrd 356 | - reverse order of bootloader and kernel install 357 | - added testing grub code 358 | - added several modem/wifi driver sources 359 | 360 | 361 | 20050508 1.5.0-i686-pre2 sofar 362 | * major bugfix release: 363 | 364 | - fix version numbers and release tags 365 | - fix mount problems 366 | - added package install progress bar 367 | - install default kernel headers through aaa_base 368 | - lilo installer fixes 369 | - don't set vga=5 by default 370 | 371 | 372 | 20050408 1.5.0-i686-pre1 sofar 373 | * first release of the new build code: 374 | 375 | - integrated memtest 376 | - added 'discover' hardware detection in the initrd and on 377 | the installed system 378 | - Makefile structure to guide build process 379 | - dependency templates, kernel base configs 380 | - introduced precompiled kernels 381 | - new init stage module loader with nestu's code 382 | - completely new installer code with logical menu structure 383 | and guidance colors, extensive help 384 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | # 2 | # README file for the lunar-iso generation code. 3 | # 4 | 5 | -- Goal 6 | 7 | Most of this code was written to automate the generation of homogeneous 8 | ISO images based on a fixed set of tools. The code should be as self- 9 | sufficient as possible and generate as much of the binaries as possible 10 | so porting to other platforms will be easy. Please keep this in mind if 11 | you change the scripts and want to include binaries. This should be kept 12 | to a minimum. Note that this code doesn't do cross builds and it requires a 13 | Lunar host. 14 | 15 | The ISO has been optimized to minimize the number of alien files. These 16 | should always be as much as possible be provided by modules. The exception 17 | are stored in template, and include several files which need to be filled 18 | with something valid before you can start. Please take care of these files 19 | and try your utter best to make sure you don't add files in the template 20 | that really (really (really)) do not need to be in there. 21 | 22 | 23 | -- Start 24 | 25 | The Makefile should be able to do most of the ISO building automatically, but 26 | there are a few steps that need to be taken: 27 | 28 | o Copy conf/config.in to conf/config 29 | o Configure the base parameters of the ISO in conf/config 30 | 31 | The code tries to pollute the host system as little as it can. It will however 32 | create a build cache for the bootstrap modules if it doesn't exist already. 33 | Also it will download all the sources of core modules. Last it will install 34 | cdrtools if mkisofs isn't found. 35 | 36 | The build cache will be copied to cache/ and the sources of the core modules 37 | will be copied to spool/. 38 | 39 | The cache is used to bootstrap the ISO building. As first stage a few modules 40 | are build. These modules are then copied to cache/. For the second stage 41 | this cache is used to build all the core modules. 42 | 43 | 44 | -- Building it 45 | 46 | Run make to build the ISO. The default target will build the completely ISO. 47 | 48 | Here's a brief explanation of the different make targets: 49 | 50 | target create BUILD/ directory 51 | 52 | boostrap-lunar use Lunar host to get the main modules into BUILD/ 53 | boostrap-base populate BUILD/ directory with generic files 54 | boostrap populate BUILD/ directory 55 | 56 | download-moonbase download the moonbase, can be used for updating 57 | moonbase-git create moonbase package from local git 58 | install-moonbase extract the moonbase to BUILD/ 59 | download-lunar use Lunar host to download all sources 60 | download download all sources 61 | 62 | stage1-spool copy spool/ to BUILD/ 63 | stage1-moonbase fix the moonbase cache files 64 | stage1-toolchain build gcc, glibc and binutils 65 | stage1-build build the main modules 66 | stage1-cache copy stage1 to cache/ 67 | stage1 build stage1 and copy to cache/ 68 | 69 | stage2-target create a clean BUILD/ 70 | stage2-base populate BUILD/ directory with generic files 71 | stage2-modules populate BUILD/ with stage1 modules 72 | stage2-spool copy spool/ to BUILD/ 73 | stage2-extract-moonbase extract the moonbase to BUILD/ 74 | stage2-moonbase fix the moonbase cache files 75 | stage2-toolchain build stage2 gcc, glibc and binutils 76 | stage2-build build stage2 core modules 77 | stage2 build stage2 from stage1 78 | 79 | pack-base create aaa_base.tar.bz2 80 | pack create packages of alien files 81 | 82 | linux build linux kernel 83 | kernel create kernel for the ISO and installation 84 | 85 | lunar-installer copy the installer to BUILD/ 86 | installer install the insatller on the ISO 87 | 88 | iso-target clean stage2 markers 89 | iso-modules remove modules not needed on the ISO 90 | iso-tools check for mkisofs 91 | iso-files create config files for the ISO 92 | iso-strip strip all executables 93 | iso-isolinux copy isolinux files to BUILD/ 94 | iso create the ISO from stage2 95 | 96 | clean wipes it all away 97 | 98 | The Makefile itself contains no configurable items. Copy the template config 99 | in the conf/ directory to conf/config and adjust the values as needed for 100 | your needs. 101 | 102 | 103 | --- Using git moonbase 104 | 105 | The moonbase.tar.bz2 can be generated from a in-tree git clone. This clone is 106 | located at moonbase-git/core. make moonbase-git will create this clone if it 107 | doesn't exist, otherwise it will only update the moonbase.tar.bz2 in spool/. 108 | 109 | To use the git moonbase run make moonbase-git first to create the clone. Next 110 | make you modification by any means. Make sure to commit all modifications to 111 | the active branch. Only committed changes will be in moonbase.tar.bz2. When 112 | done making modifications run make moonbase-git to update the moonbase.tar.bz2 113 | in spool/. This will make the ISO build start from the beginning when running 114 | make iso. 115 | 116 | To stop using the git moonbase run make download-moonbase. This will overwrite 117 | the custom moonbase.tar.bz2 in spool/ with the current moonbase.tar.bz2 from 118 | Lunar-Linux. 119 | 120 | 121 | --- Tips and tricks 122 | 123 | o Removing BUILD/ will make start from the last finished stage redoing the 124 | next stages: bootstrap, stage1, stage2 125 | 126 | o Some build steps are not file based. These steps use markers. Most of them 127 | are placed in BUILD/ some are in spool/ and cache/. Removing such a marker 128 | can be used to redo that build step. 129 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | * fill the TODO 2 | -------------------------------------------------------------------------------- /conf/config.in: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # config.in - default lunar ISO variables 4 | # 5 | 6 | # copy this file to 'config' and edit your settings as needed 7 | 8 | # Which arch are we compiling for? Hint: i686 or x86_64 9 | 10 | ISO_ARCH = i686 11 | 12 | # the ISO major version number 13 | ISO_MAJOR = 1.7.0 14 | 15 | # minor version (pre, rc, etc). leave empty for final release 16 | ISO_MINOR = 17 | 18 | ifeq (,$(ISO_MINOR)) 19 | ISO_VERSION = $(ISO_MAJOR)-$(ISO_ARCH) 20 | else 21 | ISO_VERSION = $(ISO_MAJOR)-$(ISO_MINOR)-$(ISO_ARCH) 22 | endif 23 | 24 | # the ISO codename (i.e. Lacus Autumni) 25 | # Codename scheme: http://en.wikipedia.org/wiki/List_of_maria_on_the_Moon 26 | # Rotate between lacus, mare and palus for each release to avoid confusion 27 | ISO_CODENAME = Sinus Successus 28 | 29 | # the release/offical date tag - must be in the form of YYYYMMDD 30 | ISO_DATE = 20130531 31 | 32 | # the iso BUILD arch: 33 | ISO_BUILD = $(ISO_ARCH)-pc-linux-gnu 34 | 35 | # this concatenates the full name 36 | ISO_CNAME = $(ISO_VERSION) ($(ISO_CODENAME) - $(ISO_DATE)) 37 | 38 | # the iso label may not contain spaces 39 | ISO_LABEL = $(shell echo -n Lunar-Linux $(ISO_CODENAME) | tr '[:space:]' _) 40 | 41 | # which lunar core tools do we want on the ISO 42 | ISO_LUNAR_MODULE = lunar 43 | 44 | # set this to number of makes for parallel builds or leave empty 45 | # ISO_MAKES = 2 46 | 47 | # set this to the base optimization (e.g. i386, i586, i686, x86-64) 48 | ISO_GCCARCH = i686 49 | -------------------------------------------------------------------------------- /conf/modules.bootstrap: -------------------------------------------------------------------------------- 1 | BOOTSTRAP_MODULES="bash binutils bzip2 coreutils dialog diffutils file findutils flex gawk gcc glib-2 glibc grep gzip installwatch less libcap lunar m4 make openssl patch pbzip2 pcre2 perl pkgconf procps readline sed tar texinfo util-linux xz zlib zstd" 2 | -------------------------------------------------------------------------------- /conf/modules.exclude: -------------------------------------------------------------------------------- 1 | EXCLUDE_MODULES=grub libressl 2 | -------------------------------------------------------------------------------- /conf/modules.exclude.x86_64: -------------------------------------------------------------------------------- 1 | EXCLUDE_MODULES+= 2 | -------------------------------------------------------------------------------- /conf/modules.iso: -------------------------------------------------------------------------------- 1 | ISO_MODULES=acl \ 2 | attr \ 3 | bash \ 4 | btrfs-progs \ 5 | bzip2 \ 6 | coreutils \ 7 | cpio \ 8 | cracklib \ 9 | cryptsetup \ 10 | dbus \ 11 | dhcpcd \ 12 | dialog \ 13 | diffutils \ 14 | dosfstools \ 15 | dracut \ 16 | e2fsprogs \ 17 | e3 \ 18 | ed \ 19 | elfutils \ 20 | expat \ 21 | fhs \ 22 | file \ 23 | findutils \ 24 | flex \ 25 | gawk \ 26 | gc \ 27 | glib-2 \ 28 | glibc \ 29 | gmp \ 30 | gptfdisk \ 31 | grep \ 32 | gzip \ 33 | hdparm \ 34 | inih \ 35 | iproute2 \ 36 | iputils \ 37 | iptables \ 38 | irssi \ 39 | jfsutils \ 40 | json-c \ 41 | kbd \ 42 | kmod \ 43 | less \ 44 | libaio \ 45 | libcap \ 46 | libffi \ 47 | libidn \ 48 | libidn2 \ 49 | libgcrypt \ 50 | libgpg-error \ 51 | libidn \ 52 | libmpc \ 53 | libmnl \ 54 | libnftnl \ 55 | libtool \ 56 | libunistring \ 57 | libxcrypt \ 58 | Linux-PAM \ 59 | linux-firmware \ 60 | lunar \ 61 | lvm2 \ 62 | lzo \ 63 | lz4 \ 64 | mdadm \ 65 | mpfr \ 66 | nano \ 67 | ncurses \ 68 | netcat \ 69 | ntfsprogs \ 70 | openssh \ 71 | openssl \ 72 | parted \ 73 | perl \ 74 | pcre \ 75 | pcre2 \ 76 | procps \ 77 | popt \ 78 | readline \ 79 | sed \ 80 | shadow \ 81 | systemd \ 82 | systemd-sysv \ 83 | tar \ 84 | timezone-data \ 85 | userspace-rcu \ 86 | util-linux \ 87 | vim \ 88 | wget \ 89 | which \ 90 | xfsprogs \ 91 | xz \ 92 | zlib \ 93 | zstd 94 | -------------------------------------------------------------------------------- /conf/modules.kernel: -------------------------------------------------------------------------------- 1 | KERNEL_MODULES=linux 2 | -------------------------------------------------------------------------------- /conf/modules.stage1: -------------------------------------------------------------------------------- 1 | STAGE1_MODULES=acl attr autoconf automake bash binutils bison bzip2 coreutils cpio cracklib dialog diffstat diffutils e2fsprogs expat fhs file findutils flex gawk gcc gettext glib-2 glibc gmp grep gzip installwatch iproute2 iptables kernel-headers less libcap libffi libmnl libmpc libnftnl libtool libxcrypt lunar lunar-tools lz4 make meson mpfr ncurses ninja openssl patch pcre perl procps python python-setuptools python-six re2c readline rpmunpack sed shadow tar texinfo timezone-data unzip util-linux wget which xz zlib zstd 2 | -------------------------------------------------------------------------------- /conf/modules.stage2: -------------------------------------------------------------------------------- 1 | STAGE2_MODULES=fhs kernel-headers glibc gmp mpfr libmpc libxcrypt gcc binutils Linux-PAM pcre2 2 | -------------------------------------------------------------------------------- /conf/modules.toolchain: -------------------------------------------------------------------------------- 1 | TOOLCHAIN_MODULES=fhs kernel-headers bison glibc binutils gcc binutils glibc 2 | -------------------------------------------------------------------------------- /efiboot/loader/entries/lunariso-x86_64-cd.conf: -------------------------------------------------------------------------------- 1 | title Lunar-%VERSION%, %CODENAME% (%DATE%), UEFI CD 2 | linux /isolinux/linux 3 | initrd /isolinux/initrd 4 | options root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 console=tty0 console=ttyS0,38400n8 5 | -------------------------------------------------------------------------------- /efiboot/loader/entries/lunariso-x86_64-usb.conf: -------------------------------------------------------------------------------- 1 | title Lunar-%VERSION%, %CODENAME% (%DATE%), UEFI USB 2 | linux /EFI/lunariso/linux 3 | initrd /EFI/lunariso/initrd 4 | options root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 console=tty0 console=ttyS0,38400n8 5 | -------------------------------------------------------------------------------- /efiboot/loader/loader.conf: -------------------------------------------------------------------------------- 1 | timeout 5 2 | default lunariso-x86_64 3 | -------------------------------------------------------------------------------- /isolinux/README: -------------------------------------------------------------------------------- 1 | 2 | lunar-iso ISOLINUX stuff README 3 | 4 | The files in this directory are needed to generate the .iso file from 5 | a tree of files. The code to build the entire system isn't present in 6 | this directory, but you can still re-create the .ISO file and make 7 | personal adjustments to it. 8 | 9 | 10 | *** WARNING! *** 11 | 12 | Please do NOT distribute your personal modifications as being 'the' 13 | lunar ISO. We do not accept any responsability whatsoever for any ISO 14 | we bring out, especially if it's a non-original version. 15 | 16 | 17 | Usage: 18 | 19 | To recreate the ISO, you will need to unpack the contents of the ISO 20 | into a tree, edit it according to your wishes, and regenerate the .iso 21 | image. This can then be burned to a CDR, after which it should be 22 | bootable and running parts of the lunar installer (or something else). 23 | 24 | To recreate the iso, cd into the directory with this README file and 25 | issue `sh generate-iso.sh`. It will leave te image file in the parent 26 | directory of the unpacked ISO tree, so after the command that would 27 | be in ../../ 28 | 29 | 30 | Tip: 31 | 32 | After booting, the ISO installer code will exit and run any file called 33 | '/run.sh' present in the ISO if it's executable. It expects this to be 34 | a shell script, not a binary. Use it with caution. 35 | -------------------------------------------------------------------------------- /isolinux/f1.txt.i686: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Lunar Linux is distributed under the terms of the GNU GPLv2. Please see 9 | 0dhttp://www.gnu.org/copyleft/gpl.html07 for the GNU GPL. 10 | 11 | Download Lunar Linux and docs from 0dhttp://lunar-linux.org/07 12 | 13 | To continue press ENTER, or use the function keys to select other pages. 14 | 15 | F1 - this page 16 | F2 - booting when you need special drivers loaded 17 | F3 - safe mode booting 18 | 19 | 20 | To continue, press 02ENTER07 21 | 22 | 02F102 install 0aF207 modules 0aF307 safe 23 | -------------------------------------------------------------------------------- /isolinux/f1.txt.x86_64: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Lunar Linux is distributed under the terms of the GNU GPLv2. Please see 9 | 0dhttp://www.gnu.org/copyleft/gpl.html07 for the GNU GPL. 10 | 11 | Download Lunar Linux and docs from 0dhttp://lunar-linux.org/07 12 | 13 | To continue press ENTER, or use the function keys to select other pages. 14 | 15 | F1 - this page 16 | F2 - booting when you need special drivers loaded 17 | F3 - safe mode booting 18 | 19 | 20 | To continue, press 02ENTER07 21 | 22 | 02F102 install 0aF207 modules 0aF307 safe 23 | -------------------------------------------------------------------------------- /isolinux/f2.txt.i686: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Loading additional drivers 9 | 10 | When you need special drivers to install on special IDE hardware or SCSI 11 | cards, or other input devices such as USB, you will need to load certain 12 | kernel modules before installing. 13 | 14 | To load these modules, type 02linux07 and load the modules from the initrd 15 | menu. If you know the name of the module you can also append the name of the 16 | module to the boot prompt: 02linux aacraid uhci-hcd ehci-hcd07. 17 | 18 | The installer will attempt to load some modules automatically. 19 | 20 | 21 | type 02linux07 followed by optional kernel parameters to use this boot option 22 | 23 | 0aF107 install 02F202 modules 0aF307 safe 24 | -------------------------------------------------------------------------------- /isolinux/f2.txt.x86_64: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Loading additional drivers 9 | 10 | When you need special drivers to install on special IDE hardware or SCSI 11 | cards, or other input devices such as USB, you will need to load certain 12 | kernel modules before installing. 13 | 14 | To load these modules, type 02linux07 and load the modules from the initrd 15 | menu. If you know the name of the module you can also append the name of the 16 | module to the boot prompt: 02linux aacraid uhci-hcd ehci-hcd07. 17 | 18 | The installer will attempt to load some modules automatically. 19 | 20 | 21 | type 02linux07 followed by optional kernel parameters to use this boot option 22 | 23 | 0aF107 install 02F202 modules 0aF307 safe 24 | -------------------------------------------------------------------------------- /isolinux/f3.txt.i686: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Safe mode 9 | 10 | In order to boot with certain hardware and kernel features disabled, 11 | type 02safe07 to the boot prompt and press ENTER. This option 12 | also disables MTRR, RAID, LVM, USB keyboard, FireWire and much more such 13 | as APM, ACPI, APIC etc. Some hardware may not function as well. 14 | 15 | This safe mode does not restrict your access to write to devices, so 16 | beware when you need to recover a broken system. If you wish to perform 17 | recovery of a broken system, boot into the installer and use the 03shell07 18 | option to start a rescue shell 19 | 20 | 21 | type 02safe07 followed by optional kernel parameters to use this boot option 22 | 23 | 0aF107 install 0aF207 modules 02F302 safe 24 | -------------------------------------------------------------------------------- /isolinux/f3.txt.x86_64: -------------------------------------------------------------------------------- 1 | 2 | Lunar-%VERSION%.iso, 0c%CODENAME% (%DATE%)07, kernel %KERNEL% 3 | 4 | 0eWelcome07 to 05Lunar Linux07 Copyright (C) %COPYRIGHTYEAR% by the 5 | 09Lunar-Linux team 07 6 | All Rights Reserved. 7 | 8 | Safe mode 9 | 10 | In order to boot with certain hardware and kernel features disabled, 11 | type 02safe07 to the boot prompt and press ENTER. This option 12 | also disables MTRR, RAID, LVM, USB keyboard, FireWire and much more such 13 | as APM, ACPI, APIC etc. Some hardware may not function as well. 14 | 15 | This safe mode does not restrict your access to write to devices, so 16 | beware when you need to recover a broken system. If you wish to perform 17 | recovery of a broken system, boot into the installer and use the 03shell07 18 | option to start a rescue shell 19 | 20 | 21 | type 02safe07 followed by optional kernel parameters to use this boot option 22 | 23 | 0aF107 install 0aF207 modules 02F302 safe 24 | -------------------------------------------------------------------------------- /isolinux/generate-iso.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd .. 4 | 5 | touch .lunar-cd 6 | 7 | mkisofs -o ../lunar-linux.iso -R -J -l \ 8 | -V '%LABEL%' -v \ 9 | -d -D -N -no-emul-boot -boot-load-size 4 -boot-info-table \ 10 | -b isolinux/isolinux.bin \ 11 | -c isolinux/boot.cat \ 12 | -A 'Lunar-%VERSION%' . 13 | 14 | rm -f .lunar.cd 15 | -------------------------------------------------------------------------------- /isolinux/isolinux.cfg.i686: -------------------------------------------------------------------------------- 1 | DEFAULT install 2 | SERIAL 0 38400 3 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 console=tty0 console=ttyS0,38400n8 4 | DISPLAY f1.txt 5 | TIMEOUT 600 6 | PROMPT 1 7 | F1 f1.txt 8 | F2 f2.txt 9 | F3 f3.txt 10 | F4 f1.txt 11 | F5 f1.txt 12 | F6 f1.txt 13 | F7 f1.txt 14 | F8 f1.txt 15 | F9 f1.txt 16 | LABEL install 17 | KERNEL linux 18 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 vga=normal console=tty0 console=ttyS0,38400n8 19 | LABEL novga 20 | KERNEL linux 21 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 nomodeset console=tty0 console=ttyS0,38400n8 22 | -------------------------------------------------------------------------------- /isolinux/isolinux.cfg.x86_64: -------------------------------------------------------------------------------- 1 | DEFAULT install 2 | SERIAL 0 38400 3 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 console=tty0 console=ttyS0,38400n8 4 | DISPLAY f1.txt 5 | TIMEOUT 600 6 | PROMPT 1 7 | F1 f1.txt 8 | F2 f2.txt 9 | F3 f3.txt 10 | F4 f1.txt 11 | F5 f1.txt 12 | F6 f1.txt 13 | F7 f1.txt 14 | F8 f1.txt 15 | F9 f1.txt 16 | LABEL install 17 | KERNEL linux 18 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 vga=normal console=tty0 console=ttyS0,38400n8 19 | LABEL novga 20 | KERNEL linux 21 | APPEND initrd=initrd root=live:CDLABEL=%LABEL% rd.live.image rd.live.overlay.overlayfs=1 loglevel=3 nomodeset console=tty0 console=ttyS0,38400n8 22 | -------------------------------------------------------------------------------- /kernels/README: -------------------------------------------------------------------------------- 1 | Put the appropriate kernel images in here if needed 2 | 3 | -------------------------------------------------------------------------------- /livecd/template/etc/fstab: -------------------------------------------------------------------------------- 1 | # /etc/fstab: static file system information. 2 | # 3 | -------------------------------------------------------------------------------- /livecd/template/etc/issue: -------------------------------------------------------------------------------- 1 | Lunar Linux %VERSION% (%CODENAME% - %DATE%) 2 | Kernel \r on an \m 3 | 4 | -------------------------------------------------------------------------------- /livecd/template/etc/issue.net: -------------------------------------------------------------------------------- 1 | Lunar Linux %VERSION% (%CODENAME% - %DATE%) 2 | Kernel \r on an \m 3 | 4 | -------------------------------------------------------------------------------- /livecd/template/etc/lsb-release: -------------------------------------------------------------------------------- 1 | DISTRIB_ID="Lunar Linux" 2 | DISTRIB_RELEASE="%VERSION%" 3 | DISTRIB_CODENAME="%CODENAME%" 4 | DISTRIB_DESCRIPTION="Lunar Linux %CNAME%" 5 | -------------------------------------------------------------------------------- /livecd/template/etc/motd: -------------------------------------------------------------------------------- 1 | 2 | Welcome to Lunar Linux %VERSION% (%CODENAME%)! 3 | 4 | You are running the system from the lunar ISO - as a Live CD. Not 5 | all tools are available within this system, as it only contains 6 | the base tools. Limited networking tools are also available. 7 | 8 | The install target location is /mnt. You can mount it yourself 9 | there or chroot into it to perform maintenance and rescue. 10 | 11 | -------------------------------------------------------------------------------- /livecd/template/etc/os-release: -------------------------------------------------------------------------------- 1 | NAME="Lunar Linux" 2 | VERSION="%VERSION% (%CODENAME%)" 3 | ID=lunar 4 | VERSION_ID=%VERSION% 5 | PRETTY_NAME="Lunar Linux %CNAME%" 6 | ANSI_COLOR="1;34" 7 | HOME_URL="http://lunar-linux.org/" 8 | -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/autovt@.service: -------------------------------------------------------------------------------- 1 | getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/default.target: -------------------------------------------------------------------------------- 1 | installer.target -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty1.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty2.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty3.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty4.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty5.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty.target.wants/getty@tty6.service: -------------------------------------------------------------------------------- 1 | ../getty@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/getty@.service: -------------------------------------------------------------------------------- 1 | # This file is part of systemd. 2 | # 3 | # systemd is free software; you can redistribute it and/or modify it 4 | # under the terms of the GNU Lesser General Public License as published by 5 | # the Free Software Foundation; either version 2.1 of the License, or 6 | # (at your option) any later version. 7 | 8 | [Unit] 9 | Description=Getty on %I 10 | Documentation=man:agetty(8) man:systemd-getty-generator(8) 11 | Documentation=http://0pointer.de/blog/projects/serial-console.html 12 | After=systemd-user-sessions.service plymouth-quit-wait.service 13 | 14 | # If additional gettys are spawned during boot then we should make 15 | # sure that this is synchronized before getty.target, even though 16 | # getty.target didn't actually pull it in. 17 | Before=getty.target 18 | IgnoreOnIsolate=yes 19 | 20 | # On systems without virtual consoles, don't start any getty. Note 21 | # that serial gettys are covered by serial-getty@.service, not this 22 | # unit. 23 | ConditionPathExists=/dev/tty0 24 | 25 | [Service] 26 | # the VT is cleared by TTYVTDisallocate 27 | ExecStart=-/sbin/agetty --noclear %I -a root 28 | Type=idle 29 | Restart=always 30 | RestartSec=0 31 | UtmpIdentifier=%I 32 | TTYPath=/dev/%I 33 | TTYReset=yes 34 | TTYVHangup=yes 35 | TTYVTDisallocate=yes 36 | KillMode=process 37 | IgnoreSIGPIPE=no 38 | SendSIGHUP=yes 39 | 40 | # Unset locale for the console getty since the console has problems 41 | # displaying some internationalized messages. 42 | Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION= 43 | 44 | [Install] 45 | WantedBy=getty.target 46 | -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/installer.target: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Guided Installer 3 | Requires=multi-user.target 4 | After=multi-user.target 5 | AllowIsolate=yes 6 | 7 | [Install] 8 | Alias=default.target 9 | -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/installer.target.wants/installer@tty1.service: -------------------------------------------------------------------------------- 1 | /etc/systemd/system/installer@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/installer.target.wants/installer@ttyS0.service: -------------------------------------------------------------------------------- 1 | /etc/systemd/system/installer@.service -------------------------------------------------------------------------------- /livecd/template/etc/systemd/system/installer@.service: -------------------------------------------------------------------------------- 1 | # This file is part of Lunar-Linux. 2 | 3 | [Unit] 4 | Description=Installer on %I 5 | After=systemd-user-sessions.service plymouth-quit-wait.service 6 | 7 | # If additional gettys are spawned during boot then we should make 8 | # sure that this is synchronized before getty.target, even though 9 | # getty.target didn't actually pull it in. 10 | Before=getty.target 11 | 12 | # On systems without virtual consoles, don't start any getty. Note 13 | # that serial gettys are covered by serial-getty@.service, not this 14 | # unit. 15 | ConditionPathExists=/dev/tty0 16 | 17 | Conflicts=getty@%i.service 18 | Conflicts=serial-getty@%i.service 19 | 20 | [Service] 21 | # the VT is cleared by TTYVTDisallocate 22 | ExecStart=-/sbin/agetty --noclear %I -n -l /bin/su -o "-l -c /sbin/lunar-install" 23 | Type=idle 24 | Restart=always 25 | RestartSec=0 26 | UtmpIdentifier=%I 27 | TTYPath=/dev/%I 28 | TTYReset=yes 29 | TTYVHangup=yes 30 | TTYVTDisallocate=yes 31 | KillMode=process 32 | IgnoreSIGPIPE=no 33 | 34 | [Install] 35 | WantedBy=installer.target 36 | -------------------------------------------------------------------------------- /lunar-install/.gitignore: -------------------------------------------------------------------------------- 1 | sbin/lunar-install 2 | etc/config 3 | -------------------------------------------------------------------------------- /lunar-install/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | include ../conf/config 4 | 5 | installer_PROGS = sbin/lunar-install sbin/lish 6 | installer_LIBS = $(shell ls -1 lib/*) 7 | installer_CONFIG = etc/config 8 | 9 | all: sbin/lunar-install etc/config 10 | 11 | SBINDIR=$(PREFIX)/sbin 12 | LIBDIR=$(PREFIX)/var/lib/lunar/functions/installer 13 | ETCDIR=$(PREFIX)/etc/lunar/installer 14 | 15 | install: $(installer_PROGS) $(installer_CONFIG) $(installer_LIBS) 16 | install -d $(DESTDIR)$(SBINDIR) 17 | install -d $(DESTDIR)$(ETCDIR) 18 | install -d $(DESTDIR)$(LIBDIR) 19 | for lib in $(installer_LIBS); do \ 20 | install -m0644 $$lib $(DESTDIR)/$(LIBDIR); \ 21 | done 22 | for script in $(installer_PROGS); do \ 23 | install -m0755 $$script $(DESTDIR)$(SBINDIR); \ 24 | done 25 | for config in $(installer_CONFIG); do \ 26 | install -m0644 $$config $(DESTDIR)$(ETCDIR); \ 27 | done 28 | 29 | sbin/lunar-install: sbin/lunar-install.sh 30 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' \ 31 | -e 's:%CODENAME%:$(ISO_CODENAME):g' \ 32 | -e 's:%DATE%:$(ISO_DATE):g' \ 33 | -e 's:%KERNEL%:$(ISO_KERNEL):g' \ 34 | -e 's:%CNAME%:$(ISO_CNAME):g' \ 35 | -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' \ 36 | -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 37 | 38 | etc/config: etc/config.sh 39 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' \ 40 | -e 's:%CODENAME%:$(ISO_CODENAME):g' \ 41 | -e 's:%DATE%:$(ISO_DATE):g' \ 42 | -e 's:%KERNEL%:$(ISO_KERNEL):g' \ 43 | -e 's:%CNAME%:$(ISO_CNAME):g' \ 44 | -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' \ 45 | -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 46 | -------------------------------------------------------------------------------- /lunar-install/etc/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file in released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | LOCALE_LIST="/usr/share/lunar-install/locale.list" 18 | PACKAGES_LIST="/var/cache/lunar/packages" 19 | KERNEL_LIST="/var/cache/lunar/kernels" 20 | KMOD_LIST="/var/spool/lunar/kmodules" 21 | MOONBASE_TAR="/usr/share/lunar-install/moonbase.tar.bz2" 22 | MOTD_FILE="/usr/share/lunar-install/motd" 23 | 24 | ISO_DATE="%DATE%" 25 | 26 | # answers to questions asked at the beginning of installing 27 | BOOTLOADER="none" 28 | TZ="UTC" 29 | 30 | . /etc/lunar/config 31 | for FUNCTION in $FUNCTIONS/installer/*.lunar 32 | do 33 | . $FUNCTION 34 | done 35 | 36 | DIALOG="dialog 37 | --backtitle 38 | Lunar Linux Installer %VERSION% - %CODENAME% (%DATE%) 39 | --stdout" 40 | 41 | LOG="/dev/tty7" 42 | 43 | export IFS=$'\t\n' 44 | ARCH="$(arch)" 45 | -------------------------------------------------------------------------------- /lunar-install/lib/block_devices.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2022 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | _lsblk="lsblk 18 | -rpno" 19 | 20 | block_devices() 21 | { 22 | local N DEVICE 23 | # superfunction to maintain, list, edit partitions and discs 24 | case $1 in 25 | init) 26 | # do we really need to re-do this? it's slow... 27 | if [ "$(md5sum /proc/partitions)" != "$PROC_PARTITIONS_MD5" ]; then 28 | # remove all old disc/part devices 29 | unset DEVICES 30 | # fill the list with devices 31 | for DEVICE in $(list_block_devices); do 32 | block_devices add $DEVICE 33 | done 34 | # and store the checsum for later 35 | PROC_PARTITIONS_MD5="$(md5sum /proc/partitions)" 36 | fi 37 | ;; 38 | add) 39 | DEVICES=( ${DEVICES[@]} $2 ) 40 | # add a device to the list 41 | ;; 42 | use) 43 | # tag a device as used 44 | for (( N=0; N<${#DEVICES[@]} ; N++ )); do 45 | if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then 46 | DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2):used" 47 | fi 48 | done 49 | ;; 50 | free) 51 | # untag a previously used device as used 52 | for (( N=0; N<${#DEVICES[@]} ; N++ )); do 53 | if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f1)" ]; then 54 | DEVICES[$N]="$(echo ${DEVICES[$N]} | cut -d: -f1,2)" 55 | fi 56 | done 57 | ;; 58 | list) 59 | # list all unused devices of type $2 60 | for (( N=0; N<${#DEVICES[@]} ; N++ )); do 61 | if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ] && 62 | [ -z "$(echo ${DEVICES[$N]} | cut -d: -f3)" ]; then 63 | echo ${DEVICES[$N]} | cut -d: -f1 64 | fi 65 | done 66 | ;; 67 | listall) 68 | # list all devices of type $2 69 | for (( N=0; N<${#DEVICES[@]} ; N++ )); do 70 | if [ "$2" == "$(echo ${DEVICES[$N]} | cut -d: -f2)" ]; then 71 | echo ${DEVICES[$N]} | cut -d: -f1 72 | fi 73 | done 74 | ;; 75 | esac 76 | } 77 | 78 | 79 | list_block_devices() 80 | { 81 | local DEVICE TYPE FSTYPE TYPE_FILTER FSTYPE_FILTER 82 | 83 | TYPE_FILTER="dmraid" 84 | FSTYPE_FILTER="(iso9660|isw_raid_member|ddf_raid_member)" 85 | 86 | $_lsblk NAME,TYPE | grep "disk$" | while IFS=$' \t\n' read DEVICE TYPE; do 87 | if [[ ! "$TYPE" =~ $TYPE_FILTER ]] && [[ ! "$($_lsblk FSTYPE $DEVICE)" =~ $FSTYPE_FILTER ]]; then 88 | echo "$DEVICE:$TYPE" 89 | list_block_device_partitions $DEVICE 90 | fi 91 | done 92 | } 93 | 94 | list_block_device_partitions() 95 | { 96 | local DEVICE TYPE FSTYPE FSTYPE_FILTER 97 | 98 | FSTYPE_FILTER="(LVM2_member|crypto_LUKS|linux_raid_member|iso9660)" 99 | 100 | $_lsblk NAME,TYPE $1 | grep "part$" | while IFS=$' \t\n' read DEVICE TYPE; do 101 | if [[ ! "$($_lsblk FSTYPE $DEVICE)" =~ $FSTYPE_FILTER ]]; then 102 | echo "$DEVICE:$TYPE" 103 | fi 104 | done 105 | } 106 | 107 | menu_list_devices() 108 | { 109 | local DEVICE 110 | for DEVICE in $(block_devices list part; block_devices list disk; block_devices list other); do 111 | echo $DEVICE 112 | echo "Block device" 113 | done 114 | } 115 | 116 | 117 | menu_select_device() 118 | { 119 | local TITLE HELP DEVICE 120 | TITLE="Device Selection Menu" 121 | HELP="Please select a block device" 122 | DEVICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 `menu_list_devices` "New" "Add an unlisted device to this list...") 123 | if [ "$DEVICE" == "New" ]; then 124 | DEVICE=$(inputbox "Enter special device node" "/dev/") 125 | if [ ! -b $(readlink -f $DEVICE) ]; then 126 | msgbox "Device $DEVICE does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?" 127 | unset DEVICE 128 | elif echo ${SPECIAL_DEVICES[@]} | grep -qw $DEVICE ; then 129 | msgbox "Device $DEVICE was already added!" 130 | unset DEVICE 131 | else 132 | block_devices add "$DEVICE:other" 133 | fi 134 | fi 135 | echo $DEVICE 136 | } 137 | 138 | 139 | menu_list_discs() 140 | { 141 | for DISC in $(block_devices listall disk); do 142 | echo $DISC 143 | echo "disk" 144 | done 145 | } 146 | 147 | 148 | -------------------------------------------------------------------------------- /lunar-install/lib/bootloader.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | select_bootloader() { 18 | while true 19 | do 20 | BCOMMAND=$($DIALOG --title "Boot loader menu" \ 21 | --default-item "G" \ 22 | --item-help \ 23 | --menu "You will need a boot loader to start linux automatically when your computer boots. You can chose not to install a boot loader now, or pick one of the available boot loaders and options below. You can always change to the other boot loader later." \ 24 | 0 0 0 \ 25 | $(if pkg_avail systemd && [ -d /sys/firmware/efi ]; then echo "S" ; echo "systemd" ; echo "Install systemd-boot as boot loader (UEFI)"; fi) \ 26 | $(if pkg_avail grub2 ; then echo "G" ; echo "grub2" ; echo "Install grub2 as boot loader (BIOS)"; fi) \ 27 | $(if pkg_avail grub ; then echo "B" ; echo "grub" ; echo "Install grub as boot loader (BIOS)"; fi) \ 28 | $(if pkg_avail lilo ; then echo "L" ; echo "lilo" ; echo "Install lilo as boot loader (BIOS)"; fi) \ 29 | "N" "none" "Do not install a boot loader") 30 | 31 | if [ $? != 0 ] ; then 32 | continue 33 | fi 34 | 35 | case $BCOMMAND in 36 | S) BOOTLOADER=systemd ;; 37 | L) BOOTLOADER=lilo ;; 38 | G) BOOTLOADER=grub2 ;; 39 | B) BOOTLOADER=grub ;; 40 | N) BOOTLOADER=none ;; 41 | esac 42 | 43 | case $BOOTLOADER in 44 | grub2) 45 | DISC=$(echo $ROOT | sed 's/[0-9]*$//') 46 | MBR=$($DIALOG --title "grub2 MBR install" --menu "" 0 0 0 \ 47 | "$DISC" "Install grub2 MBR on this device" \ 48 | "C" "Change grub2 MBR install device") 49 | if [ "$MBR" = "C" ]; then 50 | MBR=$(inputbox "Please enter a device where to install the grub2 MBR" "") 51 | fi 52 | ;; 53 | esac 54 | if (( STEP == 6 )); then 55 | (( STEP++ )) 56 | fi 57 | L_OK=\\Z2 58 | T_OK= 59 | return 60 | done 61 | } 62 | 63 | install_bootloader() { 64 | if [[ ! -v BOOTLOADER ]] 65 | then 66 | select_bootloader 67 | fi 68 | 69 | case ${BOOTLOADER:-none} in 70 | systemd) 71 | chroot_run lsh update_plugin $BOOTLOADER "install" 72 | chroot_run bootctl install 73 | ;; 74 | lilo) 75 | transfer_package $BOOTLOADER 76 | chroot_run lsh update_plugin $BOOTLOADER "install" 77 | ;; 78 | grub2) 79 | transfer_package $BOOTLOADER 80 | chroot_run lsh update_plugin $BOOTLOADER "install" 81 | install_grub2 82 | ;; 83 | grub) 84 | transfer_package $BOOTLOADER 85 | chroot_run lsh update_plugin $BOOTLOADER "install" 86 | install_grub 87 | ;; 88 | none) 89 | msgbox "Not installing a boot loader might require you to create a boot floppy, or configure your bootloader manually using another installed operating system. Lunar Linux also did not install lilo or grub on the hard disc." 90 | ;; 91 | esac 92 | 93 | K_OK= 94 | return 95 | } 96 | 97 | -------------------------------------------------------------------------------- /lunar-install/lib/chroot.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | chroot_run() 18 | { 19 | local RESULT 20 | mount --bind /proc $TARGET/proc 21 | mount --bind /dev $TARGET/dev 22 | mount --bind /tmp $TARGET/tmp 23 | mount --bind /sys $TARGET/sys 24 | mount --bind /run $TARGET/run 25 | if mountpoint -q /sys/firmware/efi/efivars; then 26 | mount --bind /sys/firmware/efi/efivars $TARGET/sys/firmware/efi/efivars 27 | fi 28 | if [ -n "$USE_SWAP" ]; then 29 | chroot $TARGET swapon -a 30 | fi 31 | if [ -n "$USE_CLEAR" ]; then 32 | clear 33 | fi 34 | chroot $TARGET "$@" 35 | RESULT=$? 36 | if [ -n "$USE_SWAP" ]; then 37 | chroot $TARGET swapoff -a 38 | fi 39 | umount $TARGET/run 40 | if mountpoint -q $TARGET/sys/firmware/efi/efivars; then 41 | umount $TARGET/sys/firmware/efi/efivars 42 | fi 43 | umount $TARGET/sys 44 | umount $TARGET/tmp 45 | umount $TARGET/dev 46 | umount $TARGET/proc 47 | 48 | # debug the problem in case there is one 49 | if [ $RESULT == 1 ] ; then 50 | ( 51 | echo "" 52 | echo "ERROR: An error occurred while executing a command. The command was:" 53 | echo "ERROR: \"$@\"" 54 | echo "ERROR: " 55 | echo "ERROR: You should inspect any output above and retry the command with" 56 | echo "ERROR: different input or parameters. Please report the problem if" 57 | echo "ERROR: you think this error is displayed by mistake." 58 | echo "" 59 | echo "Press ENTER to continue" 60 | read JUNK 61 | ) >&2 62 | fi 63 | return $RESULT 64 | } 65 | 66 | -------------------------------------------------------------------------------- /lunar-install/lib/consolefont.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | show_consolefonts() 18 | { 19 | local FONT 20 | 21 | for FONT in $(find /usr/share/kbd/consolefonts -maxdepth 1 -name "*.gz" ! -name "*cp.gz" | sed -r 's;^.*/;;g;s;(\.psfu?)?\.gz;;g' | sort); do 22 | echo $FONT 23 | echo font 24 | done 25 | } 26 | 27 | 28 | font_menu() 29 | { 30 | local TITLE HELP 31 | TITLE="Console Font Selection Menu" 32 | HELP="Please select your preferred console fonts." 33 | 34 | CONSOLEFONT=$($DIALOG --title "$TITLE" --default-item "${CONSOLEFONT:-default8x16}" --menu "$HELP" 22 60 16 $(show_consolefonts)) 35 | if [ $? == 0 ]; then 36 | $DIALOG --aspect 30 --infobox "Setting console font '$CONSOLEFONT'..." 0 0 37 | setfont $CONSOLEFONT 38 | D_OK=\\Z2 39 | fi 40 | DEFAULT=E 41 | } 42 | 43 | 44 | -------------------------------------------------------------------------------- /lunar-install/lib/dialogs.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | msgbox() 18 | { 19 | LINES=$(( ${#1} / 55 + 7 )) 20 | $DIALOG --cr-wrap --msgbox "$1" $LINES 60 21 | } 22 | 23 | infobox() { 24 | $DIALOG --aspect ${2:-9} --infobox "$1" 0 0 25 | } 26 | 27 | inputbox() 28 | { 29 | $DIALOG --nocancel --inputbox "$1" 0 0 "$2" 30 | } 31 | 32 | 33 | confirm() 34 | { 35 | if [ "$CONFIRM" == "off" ]; then 36 | if [ -n "$2" ]; then 37 | false 38 | else 39 | true 40 | fi 41 | else 42 | $DIALOG $2 --yesno "$1" 9 60 43 | fi 44 | } 45 | 46 | 47 | percent_msg() 48 | { 49 | echo XXX 50 | echo $(( CNT * 100 / NUM )) 51 | echo "\n$((CNT+1)): $1\n" 52 | echo XXX 53 | (( CNT++ )) 54 | } 55 | 56 | 57 | 58 | toggle() 59 | { 60 | if [ `eval echo \\$$1` == "on" ]; then 61 | eval $1=off 62 | else 63 | eval $1=on 64 | fi 65 | } 66 | 67 | 68 | 69 | goodbye() 70 | { 71 | PROMPT="Reboot now?" 72 | if confirm "$PROMPT" "--defaultno"; then 73 | kill `jobs -p` &> /dev/null 74 | touch /run/initramfs/.need_shutdown 75 | touch /lib/modules/$(uname -r)/initrd 76 | mount --bind /run/initramfs/live/isolinux/initrd /lib/modules/$(uname -r)/initrd 77 | /usr/lib/dracut/dracut-initramfs-restore 78 | shutdown -r now 79 | exit 0 80 | else 81 | # bump the init level so we can exit safely! 82 | systemctl isolate multi-user.target 83 | exit 0 84 | fi 85 | } 86 | 87 | 88 | introduction() 89 | { 90 | $DIALOG --textbox /README 0 0 91 | I_OK="\\Z2" 92 | if (( STEP == 1 )); then 93 | (( STEP++ )) 94 | fi 95 | DEFAULT=C 96 | } 97 | 98 | -------------------------------------------------------------------------------- /lunar-install/lib/discs.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | get_raid_level() 18 | { 19 | LEVEL=`$DIALOG --menu "Select a raid level" 0 0 0 \ 20 | "linear" "append discs to make one large device" \ 21 | "0" "Striping - increase performance" \ 22 | "1" "Mirrorring - 100% redundancy" \ 23 | "5" "Large and safe - high performance and redundancy" \ 24 | "6" "Extends 5 - adds more overhead but more redundancy too"` 25 | echo $LEVEL 26 | } 27 | 28 | 29 | enum_discs() 30 | { 31 | for DISC in $(echo $1 | sed 's/,/\t/g') ; do 32 | echo $DISC 33 | echo $2 34 | done 35 | } 36 | 37 | 38 | list_raid_arrays() 39 | { 40 | for RAIDARRAY in ${RAIDARRAYS[@]}; do 41 | echo $RAIDARRAY | cut -d: -f1 42 | echo "level $(echo $RAIDARRAY | cut -d: -f2) raid array" 43 | done 44 | 45 | } 46 | 47 | 48 | raid_setup() 49 | { 50 | # raid array record looks like: 51 | # device:level:device,device,device:sparedevice,sparedevice,chunksize 52 | # device = { md0 md1 md2 ... } 53 | # level = { lineair 0 1 4 5 } 54 | # device = { hda1, hdb, loop/0 md0 ... } 55 | # sparedevice = { ^^device^^ } 56 | # chunksize = n (kb) 57 | # attempt to setup raid arrays 58 | while true; do 59 | RCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \ 60 | $(list_raid_arrays) \ 61 | "Create" "Create a new RAID array"` 62 | if [ $? != 0 ] ; then 63 | break 64 | fi 65 | case $RCHOICE in 66 | md*) 67 | # don't edit started arrays anymore 68 | if grep -qw $RCHOICE /proc/mdstat; then 69 | msgbox "RAID Array $RCHOICE is already started. You cannot edit the array anymore after starting it." 70 | continue 71 | fi 72 | # edit the array 73 | while true ;do 74 | for (( N=0 ; N<${#RAIDARRAYS[@]} ; N++ )); do 75 | if [ "$RCHOICE" == "$(echo ${RAIDARRAYS[$N]} | cut -d: -f1)" ]; then 76 | break 77 | fi 78 | done 79 | RAIDARRAY=${RAIDARRAYS[$N]} 80 | ARRAYNAME=$(echo $RAIDARRAY | cut -d: -f1) 81 | LEVEL=$(echo $RAIDARRAY | cut -d: -f2) 82 | DISCS=$(echo $RAIDARRAY | cut -d: -f3) 83 | SPARE=$(echo $RAIDARRAY | cut -d: -f4) 84 | RRCHOICE=`$DIALOG --cancel-label "Exit" --menu "Select an option" 0 0 0 \ 85 | "Add disc" "Add a disk to the array" \ 86 | "Add spare" "Add a spare disk to the array" \ 87 | $([ -n "$DISCS" ] && enum_discs $DISCS "RAID array member") \ 88 | $([ -n "$SPARE" ] && enum_discs $SPARE "Spare disc") \ 89 | "start" "Initialize and start the array" \ 90 | ` 91 | if [ $? != 0 ]; then 92 | break 93 | fi 94 | if [ "$RRCHOICE" == "Add disc" -o "$RRCHOICE" == "Add spare" ] ; then 95 | NEW=$(menu_select_device) 96 | if [ -n "$NEW" ]; then 97 | if [ "$RRCHOICE" == "Add disc" ] ; then 98 | DISCS=$(echo "$DISCS,$NEW" | sed -e 's/^,//') 99 | else # if [ "$RRCHOICE" == "Add spare" ] ; then 100 | SPARE=$(echo "$SPARE,$NEW" | sed -e 's/^,//') 101 | fi 102 | block_devices use $NEW 103 | if [ "$(fdisk -l ${NEW/[0-9]*/} | sed 's/\*/ /' | grep "^$NEW" | awk '{print $5}')" != "fd" ]; then 104 | msgbox "The partition type of this device is not 0xFD (Linux RAID Autodetect). You should correct this in the partition table with a partitioning tool, otherwise linux will not automatically enable this RAID array at boot." 105 | fi 106 | fi 107 | elif [ "$RRCHOICE" == "start" ] ; then 108 | # Ask for metadata version 109 | METADATA=$($DIALOG --title " Choose metadata version " --menu "" 0 0 0 \ 110 | "0.90" "Use with LILO bootloader" \ 111 | "1.0" "Use with SYSLINUX bootloader" \ 112 | "1.2" "Use with GRUB bootloader") 113 | # udev might fail to create these devices 114 | if [ ! -b /dev/md/${ARRAYNAME/md/} ]; then 115 | mkdir -p /dev/md 116 | mknod -m 660 /dev/md/${ARRAYNAME/md/} b 9 ${ARRAYNAME/md/} 117 | chgrp disc /dev/md/${ARRAYNAME/md/} 118 | ln -s md/${ARRAYNAME/md/} /dev/$ARRAYNAME 119 | fi 120 | # create and start the array here in a single step 121 | DISCS_A=( $(for DISC in $(echo $DISCS | sed 's/,/\t/g') ; do echo $DISC ; done) ) 122 | SPARE_A=( $(for DISC in $(echo $SPARE | sed 's/,/\t/g') ; do echo $DISC ; done) ) 123 | # note we do not force creation here 124 | mdadm --create --metadata=$METADATA --level $LEVEL -n ${#DISCS_A[@]} -x ${#SPARE_A[@]} /dev/$ARRAYNAME ${DISCS_A[@]} ${SPARE_A[@]} 125 | sleep 2 126 | if ! grep -qw "^$ARRAYNAME" /proc/mdstat ; then 127 | sleep 5 128 | msgbox "Initialization and starting of the RAID array failed. You should inspect the output for errors and try manually to start the array before using it." 129 | else 130 | msgbox "Initialization of $ARRAYNAME succeeded. You can now use this device as a normal, unformatted partition." 131 | block_devices free $ARRAYNAME 132 | break 133 | fi 134 | else 135 | # remove disc from the raid array 136 | DISCS=$(echo $DISCS | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::") 137 | SPARE=$(echo $SPARE | sed -e "s:\\(^\\|,\\)$RRCHOICE\\(,\\|$\\):,:;s:^,::;s:,$::") 138 | msgbox "Deleted $RRCHOICE from this RAID array." 139 | block_devices free $RRCHOICE 140 | fi 141 | # recombine the array options 142 | RAIDARRAYS[$N]="$ARRAYNAME:$LEVEL:$DISCS:$SPARE" 143 | done 144 | ;; 145 | Create) 146 | ARRAY="md${#RAIDARRAYS[@]}" 147 | LEVEL=$(get_raid_level) 148 | if [ -n "$LEVEL" ]; then 149 | RAIDARRAYS[${#RAIDARRAYS[@]}]="$ARRAY:$LEVEL::" 150 | block_devices add "/dev/$ARRAY:other:used" 151 | fi 152 | ;; 153 | esac 154 | done 155 | DEFAULT=M 156 | } 157 | 158 | -------------------------------------------------------------------------------- /lunar-install/lib/editors.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | editor_menu() 18 | { 19 | EDITOR=${EDITOR:-vi} 20 | EDITOR=`$DIALOG --title "Editor Selection Menu" --default-item "$EDITOR" --item-help --cr-wrap \ 21 | --menu "Not all of these editors are available right away. Some require that you compile them yourself (like emacs) or are only available on the target installation, and possibly emulated through another editor" 0 0 0 \ 22 | "e3" "fully available" \ 23 | "an emacs, vim, pico emulator" \ 24 | "emacs" "emulated on this install media by e3, not installed" \ 25 | "Richard Stallmans editor" \ 26 | "joe" "fully available" \ 27 | "WS compatible editor" \ 28 | "nano" "fully available" \ 29 | "a pico clone" \ 30 | "vi" "fully available" \ 31 | "vim - good old vi" \ 32 | "zile" "fully available" \ 33 | "an emacs clone"` 34 | 35 | export EDITOR 36 | J_OK=\\Z2 37 | DEFAULT=F 38 | } 39 | 40 | -------------------------------------------------------------------------------- /lunar-install/lib/express_mkpart.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ############################################################# 4 | # # 5 | # Automatically create a basic partition table on a disk # 6 | # # 7 | ############################################################# 8 | # # 9 | # Copyright 2023 by Dave Brown # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | ########################################################################## 18 | # This creates a partition table with the following entries: 19 | # 20 | # 1) A boot/EFI partition at the beginning of the disk, arbitrarily 21 | # sized at 200M 22 | # 2) A swap partition at the end of the disk, twice the size of RAM, and 23 | # 3) A Linux partition between them taking up the remainder of the disk 24 | # space. 25 | ########################################################################## 26 | 27 | express_mkpart() { 28 | local DISK 29 | local BOOT_FS 30 | local PARTNUM 31 | local START 32 | local FORCE 33 | 34 | DISK=$1 35 | BOOT_FS=fat32 36 | 37 | SWAPSIZE=$(awk ' 38 | /^MemTotal:/ { 39 | memsize=$2 40 | 41 | # Round swap size up a little bit 42 | base_swapsize = (int(memsize/128000)+1)*128 43 | 44 | # If there is more than 8G of RAM, let swap 45 | # be memory plus an extra couple of gigabytes 46 | # 47 | # Otherwise just let it be twice RAM 48 | if(memsize > 8388608) { 49 | print base_swapsize + 2048 50 | } else { 51 | print base_swapsize * 2 52 | } 53 | }' /proc/meminfo) 54 | 55 | DISKSIZE=$(parted $DISK 'unit mib print devices' | 56 | grep $DISK | 57 | sed 's/.*(\(.*\)mib)/\1/i') 58 | 59 | # If swap would be more than 10% disk size, then just use 10% of the 60 | # disk for swap 61 | if (( SWAPSIZE > ( DISKSIZE/10) )) 62 | then 63 | SWAPSIZE=$((DISKSIZE/10)) 64 | fi 65 | 66 | parted $DISK --script mklabel gpt 67 | 68 | PARTNUM=0 69 | START=0 70 | 71 | # If this isn't an EFI system, make a bit of room at the start of the disk 72 | # for grub 73 | if [ ! -d /sys/firmware/efi ] 74 | then 75 | # BIOS boot partition 76 | ((PARTNUM++)) 77 | START=1MB 78 | parted $DISK --script "mkpart primary fat32 0 $START" 79 | parted $DISK --script "set ${PARTNUM} bios_grub on" 80 | BOOT_FS=ext4 81 | fi 82 | 83 | # boot/EFI partition 84 | ((PARTNUM++)) 85 | parted $DISK --script "mkpart primary $BOOT_FS $START 200MB" 86 | parted $DISK --script "set ${PARTNUM} boot on" 87 | case $BOOT_FS in 88 | fat32) 89 | # gparted calls it "fat32", but mkfs wants "vfat", so... 90 | BOOT_FS=vfat 91 | FORCE=-F32 92 | ;; 93 | 94 | *) 95 | FORCE=-F 96 | ;; 97 | esac 98 | 99 | PARTITIONS[${#PARTITIONS[@]}]="${DISK}${PARTNUM}:/boot:${BOOT_FS}:$(determine_mount_opts ${DISK} ${BOOT_FS}):$(determine_fsck_pass /boot)::${FORCE}:yes" 100 | BOOT=${DISK}${PARTNUM} 101 | block_devices use ${DISK}${PARTNUM} 102 | 103 | # Root partition 104 | ((PARTNUM++)) 105 | parted $DISK --script "mkpart primary ext4 200MB -${SWAPSIZE}M" 106 | PARTITIONS[${#PARTITIONS[@]}]="${DISK}${PARTNUM}:/:ext4:$(determine_mount_opts ${DISK} ext4):$(determine_fsck_pass /)::-F:yes" 107 | ROOT=${DISK}${PARTNUM} 108 | block_devices use ${DISK}${PARTNUM} 109 | 110 | # Swap partition 111 | ((PARTNUM++)) 112 | parted $DISK --script "mkpart primary linux-swap -${SWAPSIZE}M 100%" 113 | PARTITIONS[${#PARTITIONS[@]}]="${DISK}${PARTNUM}:swap:swap:$(determine_mount_opts ${DISK} swap):$(determine_fsck_pass /)::-f:yes" 114 | SWAP_ENABLED=1 115 | S_OK=\\Z2 116 | block_devices use ${DISK}${PARTNUM} 117 | 118 | # Make sure the rest of the installer sees the new partitions 119 | sync 120 | partprobe $DISK 121 | 122 | # Now we can skip selecting a swap file (or partition), and we don't 123 | # have to select partitions either if we don't want to 124 | DONE_PARTITIONING=1 125 | L_OK= 126 | T_OK= 127 | STEP=6 128 | } 129 | -------------------------------------------------------------------------------- /lunar-install/lib/filesystems.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | nice_size() 18 | { 19 | echo $1 | sed -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]$\)/\1.\2KB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]KB$\)/\1.\2MB/' -e 's/\(.*[0-9]\)\([0-9]\)\([0-9]\)\([0-9]\)\(\.[0-9]MB$\)/\1.\2GB/' 20 | } 21 | 22 | menu_list_targets() 23 | { 24 | local DEVICE FBLKS FSIZE PTYPE FSTYPE MNTPNT N 25 | for DEVICE in $(block_devices listall part; block_devices listall other); do 26 | if [ -e $DEVICE ]; then 27 | FBLKS=$(sfdisk -s $DEVICE) 28 | if (( FBLKS <= 10 )) ; then 29 | # this prevents listing EXTENDED partitions 30 | continue 31 | fi 32 | FSIZE=$(nice_size `fdisk -l $DEVICE 2>&1 | grep ^Disk | grep bytes | awk '{print $5}'`) 33 | echo $DEVICE 34 | 35 | PTYPE=$(file -Ls $DEVICE 2>&1 | cat) 36 | case $PTYPE in 37 | *ext4*) PTYPE="(ext4)" ;; 38 | *ext3*) PTYPE="(ext3)" ;; 39 | *ext2*) PTYPE="(ext2)" ;; 40 | *XFS*) PTYPE="(XFS)" ;; 41 | *Minix*) PTYPE="(minix)" ;; 42 | *BTRFS*) PTYPE="(btrfs)" ;; 43 | *FAT*) PTYPE="(FAT/FAT32)" ;; 44 | *) PTYPE="(unknown)" ;; 45 | esac 46 | 47 | for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do 48 | if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$DEVICE" ]; then 49 | FSTYPE=$(echo ${PARTITIONS[$N]} | cut -d: -f3) 50 | MNTPNT=$(echo ${PARTITIONS[$N]} | cut -d: -f2) 51 | FSTYPE=${FSTYPE/none/swap} 52 | echo "$MNTPNT partition, size $FSIZE, [$FSTYPE]" 53 | continue 2 54 | fi 55 | done 56 | echo "unassigned, size $FSIZE, $PTYPE" 57 | fi 58 | done 59 | } 60 | 61 | 62 | menu_get_filesystem() 63 | { 64 | TITLE="Filesystem Selection Menu" 65 | HELP="Please select a filesystem. A '*' means that this is a journalling filesystem, which provides better data security against system crashes etc." 66 | 67 | EXT4="Fourth Extended file system (*)" 68 | BTRFS="BTree file system (*)" 69 | EXT3="Third Extended file system (*)" 70 | EXT2="Second Extended file system" 71 | REISER="Reiserfs file system (*)" 72 | XFS="XFS file system (*)" 73 | JFS="JFS file system (*)" 74 | VFAT="FAT32 file system" 75 | SWAP="Swap (Virtual memory or paging filesystem)" 76 | 77 | $DIALOG --title "$TITLE" --default-item "ext4" --menu "$HELP" 0 0 0 \ 78 | "ext4" "$EXT4" \ 79 | "btrfs" "$BTRFS" \ 80 | "ext3" "$EXT3" \ 81 | "ext2" "$EXT2" \ 82 | "xfs" "$XFS" \ 83 | "vfat" "$VFAT" \ 84 | "swap" "$SWAP" 85 | } 86 | 87 | select_swap_file() 88 | { 89 | LOCATION_PROMPT="Please enter the location for the swapfile." 90 | SIZE_PROMPT="Enter the size (in MB) of the swapfile you want to generate. It is recommended make it twice the amount of physical RAM. TMPFS users will need more swap (typically 1000MB)." 91 | 92 | SWAPFILE=$(inputbox "$LOCATION_PROMPT" "/swapfile") && 93 | if [ -n "$SWAPFILE" ]; then 94 | 95 | # strange calc. but it ends up being ~ 2xRAM rounded up to 256MB blocks 96 | SWAPSIZE=$(grep MemTotal: /proc/meminfo | awk '{print $2}' | sed 's/[0-9][0-9][0-9]$//') && 97 | (( SWAPSIZE = ( ( SWAPSIZE / 128 ) + 1 ) * 256 )) && 98 | 99 | SWAPSIZE=$(inputbox "$SIZE_PROMPT" "$SWAPSIZE") 100 | if [ -n "$SWAPSIZE" ]; then 101 | S_OK=\\Z2 102 | else 103 | unset SWAPFILE SWAPSIZE 104 | fi 105 | fi 106 | if (( STEP == 5 )); then 107 | (( STEP++ )) 108 | fi 109 | } 110 | 111 | 112 | determine_mount_opts() 113 | { 114 | # Check for TRIM support 115 | if hdparm -I $1 | grep -q TRIM; then 116 | if [ "$2" == "swap" ]; then 117 | echo "defaults,discard" 118 | else 119 | if [[ "$2" =~ (ext4|btrfs|xfs) ]]; then 120 | echo "defaults,noatime,discard" 121 | else 122 | echo "defaults,noatime" 123 | fi 124 | fi 125 | else 126 | echo "defaults" 127 | fi 128 | } 129 | 130 | determine_fsck_pass() 131 | { 132 | if [ "$1" == "swap" ]; then 133 | echo "0" 134 | else 135 | if [ "$2" == "/" ]; then 136 | echo "1" 137 | else 138 | echo "2" 139 | fi 140 | fi 141 | } 142 | 143 | 144 | get_mount_point() 145 | { 146 | local POINT ROOT_H BOOT_H HOME_H USR_H VAR_H SRV_H OPT_H LOCAL_H C_H 147 | 148 | ROOT_H="The root file system" 149 | BOOT_H="Kernels and static files for the boot loader" 150 | HOME_H="User home directories" 151 | USR_H="Static data" 152 | VAR_H="Variable data (logs, tarball cache etc)" 153 | SRV_H="Data for services" 154 | OPT_H="Add-on application software packages (legacy)" 155 | LOCAL_H="Local hierarchy" 156 | C_H="Enter mount point manually" 157 | 158 | if [ "$1" == "swap" ]; then 159 | echo "swap" 160 | else 161 | POINT=$($DIALOG --title "Select a mount point" --menu "" 0 0 0 \ 162 | "/" "$ROOT_H" \ 163 | "/boot" "$BOOT_H" \ 164 | "/home" "$HOME_H" \ 165 | "/usr" "$USR_H" \ 166 | "/var" "$VAR_H" \ 167 | "/srv" "$SRV_H" \ 168 | "/opt" "$OPT_H" \ 169 | "/usr/local" "$LOCAL_H" \ 170 | "C" "$C_H") 171 | if [ "$POINT" = "C" ]; then 172 | POINT=$(inputbox "Please enter a mount point" "") 173 | fi 174 | if [ -z "$POINT" -a -z "$ROOT" ]; then 175 | echo "/" 176 | else 177 | echo "$POINT" 178 | fi 179 | fi 180 | } 181 | 182 | 183 | -------------------------------------------------------------------------------- /lunar-install/lib/fstab.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | fstab_style_menu() 18 | { 19 | local TITLE HELP DEFAULT STYLE FSTAB_OPTIONS 20 | 21 | TITLE="Fstab Style Menu" 22 | HELP="Please select preferred fstab mount style" 23 | FSTAB_STYLE=`$DIALOG --title "$TITLE" --default-item "$FSTAB_STYLE" --cr-wrap --menu "$HELP" 0 0 0 \ 24 | "DEV" "Device name style" \ 25 | "LABEL" "LABEL style" \ 26 | "UUID" "UUID style"` 27 | FSTAB_STYLE=${FSTAB_STYLE:-UUID} 28 | } 29 | 30 | ## 31 | # fstab_style partition fstype mountpoint 32 | # 33 | fstab_style() 34 | { 35 | local PART PTYPE MNTPT UUID 36 | 37 | PART=$1 38 | PTYPE=$2 39 | MNTPT=$3 40 | 41 | case "$FSTAB_STYLE" in 42 | DEV) 43 | # Do nothing 44 | echo $PART 45 | ;; 46 | LABEL) 47 | set_fs_label $PART $PTYPE $MNTPT 48 | if [ "$PTYPE" == "swap" ]; then 49 | echo "LABEL=swap${PART##*/}" 50 | else 51 | echo "LABEL=$MNTPT" 52 | fi 53 | ;; 54 | UUID) 55 | UUID=$(blkid -s UUID -o value $PART) 56 | echo "UUID=$UUID" 57 | ;; 58 | esac 59 | } 60 | 61 | ## 62 | # set_fs_label partition fstype label 63 | # 64 | set_fs_label() { 65 | local PART PTYPE LABEL 66 | 67 | PART=$1 68 | PTYPE=$2 69 | LABEL=$3 70 | 71 | case "$PTYPE" in 72 | ext*) 73 | tune2fs -L $LABEL $PART &> /dev/null 74 | ;; 75 | btrfs) 76 | btrfs filesystem label $PART $LABEL &> /dev/null 77 | ;; 78 | xfs) 79 | xfs_admin -L $LABEL $PART &> /dev/null 80 | ;; 81 | swap) 82 | mkswap -L swap${PART##*/} $PART &> /dev/null 83 | ;; 84 | esac 85 | } 86 | 87 | -------------------------------------------------------------------------------- /lunar-install/lib/grub.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | make_grub_conf() 18 | { 19 | if ! pkg_avail grub ; then 20 | return 21 | fi 22 | if [ -e $TARGET/boot/grub/menu.lst ] ; then 23 | return 24 | fi 25 | 26 | mkdir -p $TARGET/boot/grub 27 | ( 28 | echo "# uncomment the following 2 lines to enable serial console booting" 29 | echo "serial --unit=0 --speed=38400 --word=8 --parity=no --stop=1" 30 | echo "terminal serial" 31 | echo "" 32 | echo "timeout 30" 33 | echo "default 0" 34 | echo "fallback 1" 35 | echo "color light-gray/blue black/light-gray" 36 | echo "" 37 | ) > $TARGET/boot/grub/menu.lst 38 | } 39 | 40 | 41 | install_grub() 42 | { 43 | if ! pkg_avail grub ; then 44 | return 45 | fi 46 | # grub lives on the "/" partition unless we have a separate 47 | # "/boot" partition. Hence we use $BOOT to determine the grub location. 48 | GRUB_PART=$(lsh map_device_to_grub $BOOT) 49 | # and we go straight to the MBR 50 | GRUB_MBR=$(echo $GRUB_PART | cut -d, -f1) 51 | 52 | ( 53 | echo "root ($GRUB_PART)" 54 | echo "setup ($GRUB_MBR)" 55 | echo "quit" 56 | ) | grub --no-curses 57 | sleep 2 58 | 59 | # setup details needed for frub later: 60 | if [ "$BOOT" == "$ROOT" ]; then 61 | GRUB_BOOT=/boot 62 | else 63 | GRUB_BOOT="" 64 | fi 65 | GRUB_ROOT="($(lsh map_device_to_grub $ROOT))" 66 | export GRUB_ROOT GRUB_BOOT 67 | 68 | echo "" 69 | echo "grub should use the following parameters from now on:" 70 | echo " root $GRUB_ROOT" 71 | echo " kernel $GRUB_BOOT/\${ image name }" 72 | echo "" 73 | 74 | echo "grub was installed on the MBR of $GRUB_MBR" 75 | sleep 4 76 | } 77 | 78 | 79 | -------------------------------------------------------------------------------- /lunar-install/lib/grub2.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | install_grub2() 18 | { 19 | local DISC 20 | 21 | if ! pkg_avail grub2 ; then 22 | return 23 | fi 24 | 25 | case `tty` in 26 | /dev/ttyS*) 27 | mkdir /mnt/etc/default 28 | { 29 | echo 'GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,38400n8"' 30 | echo 'GRUB_TERMINAL="console serial"' 31 | echo 'GRUB_SERIAL_COMMAND="serial --speed=38400 --unit=0 --word=8 --parity=no --stop=1"' 32 | } > /mnt/etc/default/grub 33 | ;; 34 | esac 35 | 36 | if [[ ! -v MBR ]] 37 | then 38 | DISC=$(echo $ROOT | sed 's/[0-9]*$//') 39 | MBR=$($DIALOG --title "grub2 MBR install" --menu "" 0 0 0 \ 40 | "$DISC" "Install grub2 MBR on this device" \ 41 | "C" "Change grub2 MBR install device") 42 | if [ "$MBR" = "C" ]; then 43 | MBR=$(inputbox "Please enter a device where to install the grub2 MBR" "") 44 | fi 45 | fi 46 | 47 | if [[ -d /sys/firmware/efi ]] 48 | then 49 | if grep '/mnt/boot vfat' /proc/mounts > /dev/null 2>&1 50 | then 51 | chroot_run grub-install --efi-directory=/boot $MBR 52 | else 53 | msgbox "Grub2 installation failed. This is an EFI system, but no VFAT boot partition has been detected. You need to create a VFAT /boot partition large enough for the EFI data, your kernels and the initramfs." 54 | return 1 55 | fi 56 | else 57 | chroot_run grub-install $MBR 58 | fi 59 | } 60 | -------------------------------------------------------------------------------- /lunar-install/lib/installer.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | install_menu() 18 | { 19 | if [ -z "$STEPS" ]; then 20 | # the total number of steps in the installer: 21 | STEPS=8 22 | 23 | SH[1]="Please read the introduction if you are new to Lunar Linux. 24 | If you want to know more about the installation procedure 25 | and recent changes please visit http://lunar-linux.org/ 26 | before proceeding." 27 | SH[2]="You can now set various system defaults that 28 | are not vital but make your linux system more friendly 29 | to your users." 30 | SH[3]="You need to create partitions if you are installing on 31 | a new disc or in free space. If you want to delete other 32 | operating systems you will also need to partition your disc." 33 | SH[4]="You need to mount a filesystem so that Lunar Linux can be 34 | transferred to it. Usually you make 3 to 5 separate 35 | partitions like /boot, /var and /usr. After mounting 36 | them the Lunar Linux packages can be transferred to them." 37 | SH[5]="Swap is like temporary memory. It improves your 38 | systems performance. You can create a swapfile or 39 | even whole swap partitions." 40 | SH[6]="To be able to boot linux on reboot, you need to have 41 | a boot loader that loads the kernel when you power on 42 | your computer. Without it linux does not run." 43 | SH[7]="During the transfer all programs and files that you 44 | need to run Lunar Linux will be copied to your system." 45 | SH[8]="You can make some final preparations here before you begin 46 | using your new Lunar Linux system. Setting a root password is strongly 47 | recommended now, but the rest of these operations can also be done after 48 | you've rebooted into your new system." 49 | 50 | B_LABEL="One step back" 51 | B_HELP="Go back one step in the installation procedure" 52 | F_LABEL="One step forward" 53 | F_HELP="Go forward one step in the installation procedure" 54 | 55 | I_LABEL="Introduction into Lunar Linux" 56 | I_HELP="Read about the advantages of using Lunar Linux" 57 | 58 | C_LABEL="Select a keyboard map" 59 | C_HELP="Select keyboard map" 60 | D_LABEL="Select a console font" 61 | D_HELP="Select a console font" 62 | E_LABEL="Set global language" 63 | E_HELP="Set global language" 64 | A_LABEL="Select a timezone" 65 | A_HELP="Select a timezone" 66 | J_LABEL="Select a default editor" 67 | J_HELP="Select a default editor" 68 | 69 | P_LABEL="Partition discs" 70 | P_HELP="Use fdisk or cfdisk to prepare hard drive partitions" 71 | W_LABEL="Setup Linux Software RAID" 72 | W_HELP="Linux software RAID can increase redundancy or speed of hard discs" 73 | M_LABEL="Select target partitions" 74 | L_LABEL="Select boot loader" 75 | L_HELP="Select a boot loader to boot into Lunar" 76 | L_OK="\\Z1" 77 | M_HELP="Select target partitions for installation" 78 | S_LABEL="Select a swapfile" 79 | S_HELP="You don't need to setup a separate swap partition but can use a swapfile" 80 | S_OK="\\Z1" 81 | T_LABEL="Install lunar" 82 | T_HELP="Create filesystems, swapfile and install all packages onto the target system NOW" 83 | T_OK="\\Z1" 84 | O_LABEL="Configure compiler optimizations" 85 | O_HELP="Select architecture and optimizations" 86 | O_OK="\\Z1" 87 | K_LABEL="Install kernel(s)" 88 | K_HELP="Install kernel(s) on the new installation" 89 | K_OK="\\Z1" 90 | 91 | R_LABEL="Set root password" 92 | R_HELP="Set root password needed to access this system (the default password is empty)" 93 | R_OK="\\Z1" 94 | U_LABEL="Setup user accounts" 95 | U_HELP="Create, edit, delete users and group accounts on the system (\"luser\" after reboot)" 96 | U_OK="\\Z1" 97 | H_LABEL="Setup hostname and networking" 98 | H_HELP="Configure your network devices and hostname settings (\"lnet\" after reboot)" 99 | H_OK="\\Z1" 100 | V_LABEL="Administrate services" 101 | V_HELP="Configure services to start automatically at boot time (\"lservices\" after reboot)" 102 | V_OK="\\Z1" 103 | 104 | X_LABEL="Exit into rescue shell or reboot" 105 | X_HELP="This launches a a rescue shell or reboots your system" 106 | Z_LABEL="Finished installing!" 107 | Z_HELP="You're done! Now go reboot and use Lunar Linux!" 108 | Z_OK="\\Z0" 109 | 110 | STEP=1 111 | fi 112 | 113 | choices() 114 | { 115 | ( 116 | export IFS=$' \t\n' 117 | for CHOICE in $@; do 118 | echo $CHOICE 119 | eval echo \$${CHOICE}_OK\$${CHOICE}_LABEL\\\\Z0 120 | eval echo \$${CHOICE}_HELP 121 | done 122 | export IFS=$'\t\n' 123 | ) 124 | } 125 | 126 | if [ "$GUIDE" == "off" ]; then 127 | CHOICES="X I C D E J P W M S T O L R U H V A Z" 128 | STEPHELP="Step $STEP of $STEPS:" 129 | else 130 | case $STEP in 131 | 1) DEFAULT=I ; CHOICES="X I F" ;; 132 | 2) CHOICES="B C D E A J F" ;; 133 | 3) DEFAULT=P ; CHOICES="B P W M F" ;; 134 | 4) DEFAULT=M ; CHOICES="B P W M F" ;; 135 | 5) DEFAULT=S ; CHOICES="B P W M S L T F" ;; 136 | 6) DEFAULT=L ; CHOICES="B P W M S L T F" ;; 137 | 7) DEFAULT=T ; CHOICES="B P W M S L T F" ;; 138 | 8) CHOICES="B R O U H V Z" ;; 139 | esac 140 | fi 141 | COMMAND=`$DIALOG --title "Lunar Linux install menu" --nocancel --default-item "$DEFAULT" --item-help --extra-button --extra-label "Settings" --colors --menu "Step $STEP of $STEPS - \n\n${SH[$STEP]}" 0 0 0 $(choices $CHOICES)` 142 | 143 | case $? in 144 | 3) 145 | COMMAND=S 146 | while true; do 147 | DEFAULT=$COMMAND 148 | COMMAND=`$DIALOG --title "Settings / Special actions" \ 149 | --default-item "$DEFAULT" \ 150 | --cancel-label "Exit" \ 151 | --menu "Installer settings and misc. options" 0 0 0 \ 152 | "G" "Toggle guided menus on/off [$GUIDE]" \ 153 | "C" "Toggle asking of confirmations on/off [$CONFIRM]" \ 154 | "D" "Toggle disabling the ability to perform steps [$DISABLE]" \ 155 | "F" "Configure fstab mount style [$FSTAB_STYLE]" \ 156 | "M" "Load more kernel modules" \ 157 | "S" "Temporarily run a shell" \ 158 | "Q" "Quit the installer"` 159 | if [ $? != 0 ]; then 160 | return 161 | fi 162 | case $COMMAND in 163 | G) toggle GUIDE ;; 164 | C) toggle CONFIRM ;; 165 | D) toggle DISABLE ;; 166 | F) fstab_style_menu ;; 167 | S) shell ;; 168 | M) load_module ;; 169 | Q) goodbye ;; 170 | esac 171 | done 172 | ;; 173 | esac 174 | 175 | eval "TEST=\$${COMMAND}_OK" 176 | if [ "$DISABLE" == "on" -a "$TEST" == "\\Z1" ]; then 177 | $DIALOG --title "Cannot perform this step yet" --colors --msgbox "This action cannot be performed yet. You need to complete one of the earlier steps succesfully first before you can try this action. Please go a step back and perform all the necessary actions before trying this item again. As a guide, the actions that you have performed are \Z2colored green\Z0. The ones that you cannot perform yet are \Z1colored red\Z0." 15 65 178 | return 179 | fi 180 | 181 | case $COMMAND in 182 | F) if (( STEP < $STEPS )); then (( STEP++ )) ; fi ;; 183 | B) if (( STEP > 0 )); then (( STEP-- )) ; fi ;; 184 | 185 | X) goodbye ;; 186 | I) introduction ;; 187 | 188 | C) keymap_menu ;; 189 | D) font_menu ;; 190 | E) lang_menu ;; 191 | A) timezone_menu ;; 192 | J) editor_menu ;; 193 | 194 | P) partition_discs ;; 195 | W) raid_setup ;; 196 | M) select_partitions ;; 197 | L) select_bootloader ;; 198 | S) select_swap_file ;; 199 | T) transfer ;; 200 | 201 | R) set_user_password root ;; 202 | O) chroot_run lunar optimize ; O_OK=\\Z2; DEFAULT=U ;; 203 | U) chroot_run luser ; U_OK=\\Z2; DEFAULT=H ;; 204 | H) chroot_run lnet ; H_OK=\\Z2; DEFAULT=V ;; 205 | V) chroot_run lservices ; V_OK=\\Z2; DEFAULT=Z ;; 206 | 207 | Z) goodbye ;; 208 | esac 209 | } 210 | 211 | 212 | main() 213 | { 214 | export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" 215 | # setting this var is supposed to prevent the enviro_check code now! 216 | export LUNAR_INSTALL=1 217 | 218 | unset EDITOR 219 | 220 | TARGET="/mnt" 221 | CONFIRM=on 222 | GUIDE=on 223 | DISABLE=on 224 | FSTAB_STYLE="UUID" 225 | 226 | block_devices init 227 | 228 | while true; do 229 | install_menu 230 | done 231 | } 232 | 233 | -------------------------------------------------------------------------------- /lunar-install/lib/kernel.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | list_precompiled_kernels() 18 | { 19 | local LINE 20 | while read LINE; do 21 | echo $LINE | cut -d: -f1 22 | echo $LINE | cut -d: -f3- 23 | # same text below - more space for longer description 24 | echo $LINE | cut -d: -f3- 25 | done < $KERNEL_LIST 26 | } 27 | 28 | list_kernel_modules() 29 | { 30 | local LINE 31 | while read LINE; do 32 | ( 33 | unset MISSING 34 | MODULE=$(echo $LINE | cut -d: -f2) 35 | for SOURCE in $(chroot_run lvu sources $MODULE) ; do 36 | if [ ! -e $TARGET/var/spool/lunar/$SOURCE ]; then 37 | MISSING=yes 38 | fi 39 | done 40 | if [ -z "$MISSING" ]; then 41 | echo $LINE | cut -d: -f1 42 | echo $MODULE 43 | echo $LINE | cut -d: -f3- 44 | fi 45 | ) 46 | done < $KMOD_LIST 47 | } 48 | 49 | install_kernels() 50 | { 51 | while true ; do 52 | # Lets shortcut here, if we only have one kernel we just install it without a dialog 53 | KERNELS_AVAIL=$(wc -l $KERNEL_LIST | cut -d' ' -f1) 54 | if [[ $KERNELS_AVAIL == 1 ]]; then 55 | KCOMMAND="P" 56 | else 57 | KCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --default-item "P" --item-help --menu "In order to succesfully run linux you need to install the linux kernel, the heart of the operating system. You can choose between compiling one yourself or select a precompiled modular kernel." 0 0 0 \ 58 | "P" "Install a precompiled kernel" "Fast and safe: these kernels should work on almost all machines" \ 59 | "C" "Compile a kernel" "Custom configure and compile one of the linux kernels"` 60 | fi 61 | 62 | if [ $? != 0 ]; then 63 | return 64 | fi 65 | 66 | case $KCOMMAND in 67 | C) 68 | msgbox "This option is not available from the installer." 69 | ;; 70 | P) 71 | # Lets shortcut here, if we only have one kernel we just install it without a dialog 72 | if [[ $KERNELS_AVAIL == 1 ]]; then 73 | CCOMMAND=$(cut -d: -f1 $KERNEL_LIST) 74 | else 75 | CCOMMAND=`$DIALOG --title "Kernel selection menu" --cancel-label "Exit" --item-help --menu "" 0 0 0 \ 76 | $(list_precompiled_kernels)` 77 | fi 78 | if [ -f "/var/cache/lunar/$CCOMMAND.tar.xz" ]; then 79 | $DIALOG --infobox "\nInstalling kernel $CCOMMAND, please wait..." 5 70 80 | cd $TARGET && tar xf /var/cache/lunar/$CCOMMAND.tar.xz &> /dev/null 81 | chroot_run cp /usr/src/linux/.config /etc/lunar/local/.config.current &> $LOG 82 | 83 | KVER=$(grep "^$CCOMMAND:" $KERNEL_LIST | cut -d: -f2) 84 | KVER_PATCH=$(echo $KVER | cut -d . -f 3) 85 | KVER_FULL=$(echo $KVER | cut -d . -f 1,2).${KVER_PATCH:-0} 86 | 87 | # Register the kernel module as installed 88 | if ! grep -q "^linux:" $TARGET/var/state/lunar/packages; then 89 | echo "linux:${ISO_DATE}:installed:$KVER:101500KB" >> $TARGET/var/state/lunar/packages 90 | fi 91 | 92 | # Generate kernel install log 93 | #tar -tf /var/cache/lunar/$CCOMMAND.tar.xz | sed '/^usr\/src/d;s:^:/:g' >> $TARGET/var/log/lunar/install/linux-${CCOMMAND} 2> /dev/null 94 | 95 | # Generate kernel md5sum log 96 | #cat $TARGET/var/log/lunar/install/linux-${CCOMMAND} | xargs -i md5sum {} >> $TARGET/var/log/lunar/md5sum/linux-${CCOMMAND} 2> /dev/null 97 | 98 | # let the plugin code handle the hard work 99 | chroot_run depmod 100 | chroot_run lsh update_bootloader $KVER_FULL $KVER 101 | 102 | if (( STEP == 7 )); then 103 | (( STEP++ )) 104 | fi 105 | K_OK=\\Z2 106 | R_OK= 107 | U_OK= 108 | H_OK= 109 | V_OK= 110 | G_OK= 111 | A_OK= 112 | break 113 | fi 114 | ;; 115 | esac 116 | done 117 | } 118 | 119 | -------------------------------------------------------------------------------- /lunar-install/lib/kernel_mods.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | show_modules() 18 | { 19 | if [ "$(pwd)" != "/lib/modules" ]; then 20 | echo ".." 21 | echo "Directory" 22 | fi 23 | for ITEM in *; do 24 | case $ITEM in 25 | modules.*) continue ;; 26 | esac 27 | /bin/echo "$ITEM" 28 | if [ -d "$ITEM" ]; then 29 | /bin/echo "Directory" 30 | else 31 | /bin/echo "Module" 32 | fi 33 | done 34 | } 35 | 36 | 37 | load_module() 38 | { 39 | ( 40 | MODULES_ROOT="/lib/modules" 41 | cd $MODULES_ROOT/$(uname -r)/kernel/drivers 42 | TITLE="Module Menu" 43 | HELP="Select a module to load or enter a subdirectory (pwd = $(pwd))" 44 | CHOICE="" 45 | 46 | while true; do 47 | MODULES=$(show_modules $(pwd)) 48 | CHOICE=$($DIALOG --title "$TITLE" --cancel-label "Exit" --menu "$HELP" 0 0 0 $MODULES) 49 | if [ $? != 0 ]; then 50 | return 51 | fi 52 | if [ -f "$CHOICE" ]; then 53 | MODULE=$(basename $CHOICE | sed "s/\.o$//;s/\.ko$//") 54 | PARAMETERS=$(inputbox "Enter module parameters (optional)") && 55 | modprobe $MODULE $PARAMETERS 56 | sleep 1 57 | if ! grep -qw $MODULE /proc/modules ; then 58 | msgbox "The module failed to load!" 59 | else 60 | block_devices init 61 | fi 62 | elif [ -d "$CHOICE" ]; then 63 | cd "$CHOICE" 64 | fi 65 | done 66 | ) 67 | } 68 | 69 | -------------------------------------------------------------------------------- /lunar-install/lib/keymaps.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2022 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | show_keymaps() 18 | { 19 | local MAP 20 | 21 | for MAP in $(localectl list-keymaps --no-pager); do 22 | echo $MAP 23 | echo keymap 24 | done 25 | } 26 | 27 | keymap_error() { 28 | $DIALOG --msgbox "An error occured while loading your keymap, the keymap was not changed." 0 0 29 | } 30 | 31 | keymap_menu() 32 | { 33 | local TITLE HELP 34 | 35 | TITLE="Keymap Selection Menu" 36 | HELP="Please select your preferred key mapping." 37 | KEYMAP=$($DIALOG --title "$TITLE" --default-item "${KEYMAP:-defkeymap}" --menu "$HELP" 22 60 16 $(show_keymaps)) 38 | 39 | if [ -n "$KEYMAP" ]; then 40 | $DIALOG --infobox "Loading keymap '$KEYMAP'..." 0 0 41 | localectl set-keymap "$KEYMAP" || keymap_error 42 | fi 43 | 44 | C_OK=\\Z2 45 | DEFAULT=D 46 | } 47 | 48 | -------------------------------------------------------------------------------- /lunar-install/lib/languages.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2022 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | show_languages() 18 | { 19 | local locale 20 | 21 | for locale in $(localectl list-locales --no-pager); do 22 | echo "$locale" 23 | echo "locale" 24 | done 25 | } 26 | 27 | lang_menu() 28 | { 29 | local TITLE HELP 30 | 31 | TITLE="Language Selection Menu" 32 | HELP="Please select your preferred langauge. This will only set the LANG variable." 33 | ILANG=${ILANG:-en_US.UTF-8} 34 | ILANG=$($DIALOG --title "Language Selection Menu" --default-item "$ILANG" --menu "$HELP" 22 60 16 $(show_languages)) 35 | if [ $? == 0 ]; then 36 | E_OK=\\Z2 37 | fi 38 | DEFAULT=A 39 | } 40 | -------------------------------------------------------------------------------- /lunar-install/lib/lilo.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | make_lilo_conf() 18 | { 19 | local UUID DISC 20 | 21 | if ! pkg_avail lilo ; then 22 | return 23 | fi 24 | if [ -e $TARGET/etc/lilo.conf ]; then 25 | return 26 | fi 27 | 28 | UUID=$(blkid -s UUID -o value $ROOT) 29 | 30 | DISC=$(echo $ROOT | sed 's/[0-9]*$//') 31 | ( 32 | echo "lba32" 33 | echo "prompt" 34 | echo "compact" 35 | echo "delay=100" 36 | echo "timeout=100" 37 | echo "install=menu" 38 | echo "append=\"loglevel=3\"" 39 | echo "read-only" 40 | echo "" 41 | if [[ "$BOOT" =~ ^/dev/md ]]; then 42 | echo "boot=$BOOT" 43 | BOOTDISCS=$(mdadm --detail $BOOT | tail -n2 | awk '{print $7}') 44 | echo "raid-extra-boot=$(echo $BOOTDISCS | sed -e 's@[0-9]@@g' -e 's@\ @,@g')" 45 | else 46 | echo "boot=$DISC" 47 | fi 48 | echo "root=\"UUID=$UUID\"" 49 | if [[ "$DISC" =~ ^/dev/vd ]]; then 50 | echo -e "disk=$DISC\n bios=0x80\n max-partitions=7" 51 | fi 52 | echo "" 53 | ) > $TARGET/etc/lilo.conf 54 | } 55 | 56 | 57 | -------------------------------------------------------------------------------- /lunar-install/lib/packages.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | pkg_avail() 18 | { 19 | grep -q "^$1:" $PACKAGES_LIST 20 | } 21 | 22 | transfer_package() 23 | { 24 | cd $TARGET && 25 | LINE=$(grep "^$1:" $PACKAGES_LIST) 26 | MOD=$(echo $LINE | cut -d: -f1) 27 | VER=$(echo $LINE | cut -d: -f4) 28 | cp /var/cache/lunar/$MOD-$VER-*.tar.xz $TARGET/var/cache/lunar/ 29 | tar xJf $TARGET/var/cache/lunar/$MOD-$VER-*.tar.xz 2> /dev/null 30 | echo $LINE >> $TARGET/var/state/lunar/packages 31 | cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup 32 | } 33 | 34 | -------------------------------------------------------------------------------- /lunar-install/lib/partitions.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # portions Copyright 2023 by Dave Brown # 11 | # # 12 | ############################################################# 13 | # # 14 | # This file is released under the GPLv2 # 15 | # # 16 | ############################################################# 17 | 18 | menu_get_partition() 19 | { 20 | local TITLE HELP PART 21 | TITLE="Partition Selection Menu" 22 | HELP="Please select a partition" 23 | PART=$($DIALOG --title "$TITLE" --ok-label "Edit" --cancel-label "Done" --menu "$HELP" 0 0 0 `menu_list_targets` "New" "Add an unlisted device to this list...") 24 | if [ $? != 0 ]; then 25 | return 1 26 | fi 27 | if [ "$PART" == "New" ]; then 28 | PART=$(inputbox "Enter special device node" "/dev/") 29 | if [ ! -b $(readlink -f $PART) ]; then 30 | msgbox "Device $PART does not exist or is not a valid device node. Perhaps you need to load a kernel module or start a subsystem first?" 31 | unset PART 32 | elif echo ${SPECIAL_DEVICES[@]} | grep -qw $PART ; then 33 | msgbox "Device $PART was already added!" 34 | unset PART 35 | else 36 | block_devices add "$PART:other" 37 | fi 38 | fi 39 | echo $PART 40 | } 41 | 42 | 43 | partition_discs() 44 | { 45 | EXPRESS="Create basic partition table and select target filesystems automatically" 46 | CFDISK="Curses based disk partition table manipulator" 47 | FDISK="Partition table manipulator" 48 | PARTED="Create, destroy, resize, and copy partitions" 49 | HELP="Please create a boot and root partition." 50 | TITLE="Partitioning Menu" 51 | 52 | DISC=$(menu_get_disc) && 53 | PROG=`$DIALOG --title "$TITLE" --menu "$HELP" 0 0 0 \ 54 | "express_mkpart" "$EXPRESS" \ 55 | "cfdisk" "$CFDISK" \ 56 | "fdisk" "$FDISK" \ 57 | "parted" "$PARTED"` && 58 | PROMPT="Are you certain that you want to run $PROG on $DISC? (This will erase any partition selection you might have already performed)" && 59 | if confirm "$PROMPT"; then 60 | unset PARTITIONS 61 | $PROG $DISC 62 | # regenerate list of block devices 63 | block_devices init 64 | if (( STEP == 3 )); then 65 | (( STEP++ )) 66 | fi 67 | P_OK=\\Z2 68 | fi 69 | } 70 | 71 | 72 | check_partition() 73 | { 74 | PROMPT="Check for errors?" 75 | case $1 in 76 | ext2|ext3|ext4|swap) 77 | if confirm "$PROMPT" "--defaultno"; then 78 | echo "-c"; 79 | fi 80 | ;; 81 | *) 82 | true 83 | ;; 84 | esac 85 | } 86 | 87 | 88 | 89 | menu_select_partitions() 90 | { 91 | local PART N MNTPNT FSYS MNT_OPTS FSCK_PASS CHECK FORCE FORMAT 92 | while true; do 93 | PART=$(menu_get_partition) 94 | # Exit pressed - leave the menu and go back up a level 95 | if [ $? != 0 ]; then 96 | break 97 | elif [ "$PART" == "" ]; then 98 | continue 99 | fi 100 | # scan if we are re-assigning a partition 101 | for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do 102 | if [ "$(echo ${PARTITIONS[$N]} | cut -d: -f1)" == "$PART" ]; then 103 | msgbox "Unassigned partition $PART. You can now change the parameters for this partition if you wish." 104 | block_devices free $PART 105 | unset PARTITIONS[$N] 106 | continue 2 107 | fi 108 | done 109 | FSYS=$(menu_get_filesystem) 110 | if [ -z "$FSYS" ]; then 111 | continue 112 | fi && 113 | 114 | case "$FSYS" in 115 | btrfs) 116 | msgbox "Selecting btrfs as /boot is only supported with grub2, you will need to create a /boot partition and format it as ext2, ext3 or ext4 in order to use different bootloaders." 117 | ;; 118 | swap) 119 | SWAP_ENABLED=1 120 | ;; 121 | esac 122 | 123 | MNTPNT=$(get_mount_point $FSYS) && 124 | 125 | PROMPT="$PART might already be formatted with the $FSYS filesystem and may contain data. Formatting it will destroy all the information on this partition. Are you sure you want to format it?" 126 | if confirm "$PROMPT" "--defaultno"; then 127 | FORMAT=yes 128 | CHECK=$(check_partition $FSYS) 129 | else 130 | FORMAT=no 131 | fi 132 | MNT_OPTS=$(determine_mount_opts $PART $FSYS) && 133 | if [ "$MNT_PNT" != "/" ]; then 134 | MNT_PNT=${MNT_PNT%%/} 135 | fi 136 | FSCK_PASS=$(determine_fsck_pass $FSYS $MNTPNT) && 137 | if [ "$FSYS" == "xfs" ]; then 138 | FORCE="-f" 139 | elif [[ "$FSYS" =~ ext[234] ]]; then 140 | FORCE="-F" 141 | elif [[ "$FSYS" == "btrfs" ]]; then 142 | FORCE="-f" 143 | elif [[ "$FSYS" == "vfat" ]]; then # Enforce creation of 32-bit filesystem 144 | FORCE="-F32" 145 | else 146 | unset FORCE 147 | fi 148 | 149 | PARTITIONS[${#PARTITIONS[@]}]="$PART:$MNTPNT:$FSYS:$MNT_OPTS:$FSCK_PASS:$CHECK:$FORCE:$FORMAT" 150 | 151 | if [ "$MNTPNT" == "/" ]; then 152 | ROOT=$PART 153 | # make sure BOOT is set to ROOT ... -> 154 | if [ -z "$BOOT" ]; then 155 | BOOT=$ROOT 156 | fi 157 | fi 158 | if [ "$MNTPNT" == "/boot" ]; then 159 | # ... -> except when this is a /boot partition 160 | BOOT=$PART 161 | fi 162 | block_devices use $PART 163 | done 164 | } 165 | 166 | 167 | select_partitions() 168 | { 169 | if [ -z "$DONE_PARTITIONING" ]; then 170 | if confirm "Are you done making partitions?"; then 171 | DONE_PARTITIONING=1 172 | case $ARCH in 173 | "alpha") 174 | msgbox \ 175 | "The partition on which the kernel is located must 176 | be formatted with the ext2 filesystem. Normally this 177 | means that your root or boot filesystem should be ext2." 178 | ;; 179 | esac 180 | menu_select_partitions 181 | fi 182 | else 183 | menu_select_partitions 184 | fi 185 | 186 | if [ -n "$ROOT" ]; then 187 | if (( STEP <= 4 )) ; then 188 | # Skip swapfile step if swap partition was set 189 | if [ -n "$SWAP_ENABLED" ]; then 190 | S_OK=\\Z2 191 | STEP=6 192 | else 193 | S_OK= 194 | STEP=5 195 | fi 196 | fi 197 | T_OK= 198 | L_OK= 199 | fi 200 | } 201 | 202 | menu_get_disc() 203 | { 204 | TITLE="Disk Selection Menu" 205 | HELP="Please select a disk" 206 | $DIALOG --title "$TITLE" --menu "$HELP" 0 0 0 $(menu_list_discs) 207 | } 208 | 209 | -------------------------------------------------------------------------------- /lunar-install/lib/password.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # Copyright 2022 by Stefan Wold # 5 | # # 6 | ############################################################# 7 | # # 8 | # This file is released under the GPLv2 # 9 | # # 10 | ############################################################# 11 | 12 | set_user_password() { 13 | local PASSWORD PASSWORD2 USERNAME 14 | 15 | USERNAME=$1 16 | 17 | while [ -z "$PASSWORD" ]; do 18 | PASSWORD=$($DIALOG --insecure --passwordbox "Set password for user '$USERNAME'\n\nNew Password:" 0 0) || return 1 19 | PASSWORD2=$($DIALOG --insecure --passwordbox "Set password for user '$USERNAME'\n\nVerify Password:" 0 0) || return 1 20 | 21 | if [[ "$PASSWORD" == "$PASSWORD2" ]]; then 22 | chroot_run passwd $USERNAME < <(printf "%s\n%s" "$PASSWORD" "$PASSWORD") &> /dev/null 23 | else 24 | msgbox "Passwords did not match, please enter again." 25 | unset PASSWORD PASSWORD2 26 | fi 27 | done 28 | 29 | R_OK=\\Z2 30 | DEFAULT=O 31 | } 32 | -------------------------------------------------------------------------------- /lunar-install/lib/proxy.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | configure_proxy() 18 | { 19 | HTTP_PROMPT="Please enter the HTTP proxy server\nExample: http://192.168.1.1:8080/" 20 | FTP_PROMPT="Please enter the FTP proxy server\nExample: http://192.168.1.1:8080/" 21 | NO_PROMPT="Please enter all domains/ip addresses (comma-seperated) proxy should NOT be used for:\nExample: .mit.edu,mysite.com" 22 | HPROXY=`inputbox "$HTTP_PROMPT"` && 23 | FPROXY=`inputbox "$FTP_PROMPT" "$HPROXY"` && 24 | NPROXY=`inputbox "$NO_PROMPT"` 25 | } 26 | 27 | 28 | confirm_proxy_settings() 29 | { 30 | FINISHED=NO 31 | while [ "$FINISHED" != "YES" ]; do 32 | PROMPT="Are these settings correct?" 33 | PROMPT="$PROMPT\nHTTP Proxy: $HPROXY" 34 | PROMPT="$PROMPT\n FTP Proxy: $FPROXY" 35 | PROMPT="$PROMPT\n No Proxy: $NPROXY" 36 | 37 | if confirm "$PROMPT" "--cr-wrap"; then 38 | FINISHED=YES 39 | else 40 | configure_proxy 41 | FINISHED=NO 42 | fi 43 | done 44 | } 45 | 46 | 47 | proxy_exit_message() 48 | { 49 | msgbox \ 50 | "Your proxy configuration has been saved. 51 | 52 | Please note that these proxy settings will only be used by Lunar Linux 53 | (specifically, wget) and possibly some other command-line utilities. 54 | 55 | You will still have to configure proxy settings in your favorite 56 | web browser, etc..." 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /lunar-install/lib/shell.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | shell() 18 | { 19 | echo "Press CTRL-D or type exit to return to the installer" 20 | ( 21 | cd 22 | SHELL=/bin/bash HOME=/root /bin/bash -ls 23 | ) 24 | } 25 | 26 | -------------------------------------------------------------------------------- /lunar-install/lib/timezones.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | show_timezones() 18 | { 19 | for ITEM in $(LANG=C ls --hide=[a-z]* $LOCALTIME/$1); do 20 | echo "$ITEM" 21 | if [ -d $LOCALTIME/$1/$ITEM ]; then 22 | echo "Directory" 23 | else 24 | echo "Timezone" 25 | fi 26 | done 27 | } 28 | 29 | timezone_menu() 30 | { 31 | LOCALTIME=/usr/share/zoneinfo 32 | TITLE="Time Zone Selection Menu" 33 | HELP="Select timezone or directory" 34 | ZONE="" 35 | 36 | local ZDIR 37 | 38 | while 39 | TIMEZONES=`show_timezones ${ZDIR:-$ZONE}` && 40 | if [ -n "$ZDIR" ]; then 41 | T="$TITLE - $ZDIR" 42 | fi 43 | ZONE=`$DIALOG --title "${T:-$TITLE}" \ 44 | --menu \ 45 | "$HELP" \ 46 | 22 60 16 \ 47 | $TIMEZONES` && 48 | [[ -d $LOCALTIME/$ZDIR/$ZONE || -d $LOCALTIME/$ZONE ]] && 49 | ZDIR+="$ZONE/" 50 | do 51 | true 52 | done 53 | 54 | if [ -n "$ZDIR" ]; then 55 | ZONE="$ZDIR$ZONE" 56 | fi 57 | 58 | if [ -f "$LOCALTIME/$ZONE" ]; then 59 | TZ=$ZONE 60 | fi 61 | 62 | A_OK=\\Z2 63 | DEFAULT=J 64 | } 65 | 66 | -------------------------------------------------------------------------------- /lunar-install/lib/transfer.lunar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file is released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | transfer() 18 | { 19 | msgbox "You should now be ready to install Lunar Linux to your system. Lunar Linux will now create filesystems if needed, make a swapfile if it was selected, and install all Lunar Linux packages to the newly setup system. Make sure you are done with partitioning and filesystem selection." 20 | if confirm "Are you ready to install lunar?" ; then 21 | clear 22 | 23 | ORDER=$(for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do echo ${PARTITIONS[$N]} | cut -d: -f2 ; done | sort) 24 | 25 | for MOUNTPOINT in $ORDER; do 26 | for (( N=0 ; N<${#PARTITIONS[@]} ; N++ )); do 27 | M=$(echo ${PARTITIONS[$N]} | cut -d: -f2) 28 | if [ "$M" == "$MOUNTPOINT" ]; then 29 | PART=$(echo ${PARTITIONS[$N]} | cut -d: -f1) 30 | FSYS=$(echo ${PARTITIONS[$N]} | cut -d: -f3) 31 | MNT_OPTS=$(echo ${PARTITIONS[$N]} | cut -d: -f4) 32 | FSCK_PASS=$(echo ${PARTITIONS[$N]} | cut -d: -f5) 33 | CHECK=$(echo ${PARTITIONS[$N]} | cut -d: -f6) 34 | FORCE=$(echo ${PARTITIONS[$N]} | cut -d: -f7) 35 | FORMAT=$(echo ${PARTITIONS[$N]} | cut -d: -f8) 36 | 37 | # handle swap 38 | if [ "$FSYS" == "swap" ]; then 39 | infobox "Setting up swap on $PART..." 30 40 | if ! mkswap $PART &> $LOG; then 41 | msgbox "Problem creating swap on $PART. Installation will continue." 42 | fi 43 | # create the filesystems if needed for every partition 44 | elif [ "$FORMAT" == "yes" ]; then 45 | infobox "Formatting $PART as $FSYS..." 30 46 | if ! mkfs.$FSYS $FORCE $PART $CHECK &> $LOG; then 47 | msgbox "Problem creating $FSYS filesystem on $PART. Installation will continue." 48 | fi 49 | fi 50 | # again, weed out swap first 51 | if [ "$FSYS" == "swap" ]; then 52 | # We need to check that the swap device wasn't added already 53 | # or we end up with double entries in fstab if more than one 54 | # swap device was added 55 | if ! echo $FSTAB | grep -q $PART; then 56 | LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT) 57 | infobox "Activating swap space" 30 58 | if swapon $PART &> $LOG; then 59 | FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t\t0 $FSCK_PASS" 60 | swapoff $PART &> $LOG 61 | else 62 | msgbox "Problem mounting swap on $PART. Installation will continue." 63 | fi 64 | fi 65 | # then try to mount normal FS's 66 | else 67 | if [ ! -d $TARGET$MOUNTPOINT ] ; then 68 | mkdir -p $TARGET$MOUNTPOINT &> $LOG 69 | fi 70 | if [ "$MNT_OPTS" != "defaults" ]; then 71 | MNTOPTARGS="-e $MNT_OPTS" 72 | else 73 | MNTOPTARGS="" 74 | fi 75 | infobox "Mounting $PART as $FSYS" 30 76 | LABEL=$(fstab_style $PART $FSYS $MOUNTPOINT) 77 | if mount -n $PART $TARGET$MOUNTPOINT -t $FSYS $MNTOPTSARGS &> $LOG; then 78 | FSTAB="$FSTAB\n$LABEL\t$MOUNTPOINT\t$FSYS\t$MNT_OPTS\t0 $FSCK_PASS" 79 | if [ "$FSYS" == "swap" ]; then 80 | umount -n $PART &> $LOG 81 | fi 82 | else 83 | msgbox "Problem mounting $FSYS filesystem on $PART. Installation will continue." 84 | fi 85 | fi 86 | fi 87 | done 88 | done 89 | 90 | # last we create the swapfile on the target 91 | if [ -n "$SWAPFILE" ]; then 92 | mkdir -p $TARGET$(dirname $SWAPFILE) &> $LOG 93 | infobox "Creating a swapfile of $SWAPSIZE MB at \"$SWAPFILE\"..." 30 94 | if dd if=/dev/zero of=$TARGET$SWAPFILE bs=1M count=$SWAPSIZE &> $LOG && 95 | mkswap $TARGET$SWAPFILE &> $LOG && 96 | chmod 000 $TARGET$SWAPFILE &> $LOG 97 | then 98 | FSTAB="$FSTAB\n$SWAPFILE\tswap\tswap\tdefaults\t\t0 0" 99 | else 100 | msgbox "Problem creating swapfile. Installation will continue." 101 | fi 102 | fi 103 | 104 | # calculate the total so we can display progress 105 | NUM=$(wc -l $PACKAGES_LIST | awk '{print $1}') 106 | # add the number of times we call percent_msg, subtract 2 for lilo/grub 107 | (( NUM = NUM + 10 - 2 )) 108 | 109 | cd $TARGET 110 | 111 | ( 112 | percent_msg "Creating base LSB directories" 113 | mkdir -p bin boot dev etc home lib mnt media 114 | mkdir -p proc root sbin srv tmp usr var opt 115 | mkdir -p sys 116 | if [ `arch` == "x86_64" ]; then 117 | ln -sf lib lib64 118 | ln -sf lib usr/lib64 119 | fi 120 | mkdir -p usr/{bin,games,include,lib,libexec,local,sbin,share,src} 121 | mkdir -p usr/share/{dict,doc,info,locale,man,misc,terminfo,zoneinfo} 122 | mkdir -p usr/share/man/man{1,2,3,4,5,6,7,8} 123 | ln -sf share/doc usr/doc 124 | ln -sf share/man usr/man 125 | ln -sf share/info usr/info 126 | mkdir -p etc/lunar/local/depends 127 | mkdir -p run/lock 128 | ln -sf ../run var/run 129 | ln -sf ../run/lock var/lock 130 | mkdir -p var/log/lunar/{install,md5sum,compile,queue} 131 | mkdir -p var/{cache,empty,lib,log,spool,state,tmp} 132 | mkdir -p var/{cache,lib,log,spool,state}/lunar 133 | mkdir -p var/state/discover 134 | mkdir -p var/spool/mail 135 | mkdir -p media/{cdrom0,cdrom1,floppy0,floppy1,mem0,mem1} 136 | chmod 0700 root 137 | chmod 1777 tmp var/tmp 138 | 139 | if [ -f /var/cache/lunar/aaa_base.tar.xz ]; then 140 | percent_msg "Installing aaa_base: base directories and files" 141 | tar xJf /var/cache/lunar/aaa_base.tar.xz 2> /dev/null 142 | fi 143 | if [ -f /var/cache/lunar/aaa_dev.tar.xz ]; then 144 | percent_msg "Installing aaa_dev: device nodes" 145 | tar xJf /var/cache/lunar/aaa_dev.tar.xz 2> /dev/null 146 | fi 147 | 148 | for LINE in $(cat $PACKAGES_LIST | grep -v -e '^lilo:' -e '^grub:' -e '^grub2:') ; do 149 | MOD=$(echo $LINE | cut -d: -f1) 150 | VER=$(echo $LINE | cut -d: -f4) 151 | SIZ=$(echo $LINE | cut -d: -f5) 152 | percent_msg "Installing $MOD-$VER ($SIZ)\n\n($(basename /var/cache/lunar/$MOD-$VER-*.tar.xz))" 153 | transfer_package $MOD 154 | done 155 | 156 | percent_msg "Installing moonbase" 157 | ( 158 | cd $TARGET/var/lib/lunar 159 | tar xjf $MOONBASE_TAR 2> /dev/null 160 | tar j --list -f $MOONBASE_TAR | sed 's:^:/var/lib/lunar/:g' > $TARGET/var/log/lunar/install/moonbase-${ISO_DATE} 161 | mkdir -p moonbase/zlocal 162 | ) &> $LOG 163 | 164 | # transfer sources 165 | #percent_msg "Copying sources" 166 | #cp /var/spool/lunar/* $TARGET/var/spool/lunar/ 167 | 168 | # setup list of installed packages etc. 169 | percent_msg "Updating administrative files" 170 | ( 171 | echo "moonbase:${ISO_DATE}:installed:${ISO_DATE}:37000KB" >> $TARGET/var/state/lunar/packages 172 | cp $TARGET/var/state/lunar/packages $TARGET/var/state/lunar/packages.backup 173 | cp /var/state/lunar/depends $TARGET/var/state/lunar/ 174 | cp /var/state/lunar/depends.backup $TARGET/var/state/lunar/ 175 | chroot_run lsh create_module_index 176 | chroot_run lsh create_depends_cache 177 | ) &> $LOG 178 | # more moonbase related stuff 179 | percent_msg "Updating moonbase plugins" 180 | chroot_run lsh update_plugins &> $LOG 181 | 182 | # just to make sure 183 | percent_msg "Running ldconfig" 184 | chroot_run ldconfig &> $LOG 185 | 186 | # pass through some of the configuration at this point: 187 | percent_msg "Finishing up installation" 188 | ( 189 | chroot_run systemd-machine-id-setup &> $LOG 190 | chroot_run systemctl preset-all &> $LOG 191 | chroot_run systemctl set-default multi-user.target &> $LOG 192 | echo -e "KEYMAP=$KEYMAP\nFONT=$CONSOLEFONT" > $TARGET/etc/vconsole.conf 193 | echo -e "LANG=${ILANG:-en_US.UTF-8}\nLC_ALL=${ILANG:-en_US.UTF-8}" > $TARGET/etc/locale.conf 194 | [ -z "$EDITOR" ] || echo "export EDITOR=\"$EDITOR\"" > $TARGET/etc/profile.d/editor.rc 195 | 196 | if [[ $TZ != UTC ]] 197 | then 198 | ln -fs /usr/share/zoneinfo/$TZ etc/localtime &> /dev/null 199 | fi 200 | 201 | # post-first-boot message: 202 | cp /README $TARGET/root/README 203 | cp $MOTD_FILE $TARGET/etc/motd 204 | 205 | # save proxies 206 | if [ -n "$HPROXY" -o -n "$FPROXY" -o -n "$NPROXY" ]; then 207 | ( 208 | echo "# these proxy settings apply to wget only" 209 | [ -z "$HPROXY" ] || echo "export http_proxy=\"$HPROXY\"" 210 | [ -z "$FPROXY" ] || echo "export ftp_proxy=\"$FPROXY\"" 211 | [ -z "$NPROXY" ] || echo "export no_proxy=\"$NPROXY\"" 212 | ) > $TARGET/etc/profile.d/proxy.rc 213 | fi 214 | 215 | if [ -e etc/fstab ]; then 216 | cp etc/fstab etc/fstab- 217 | fi 218 | 219 | echo -e "$FSTAB" >> etc/fstab 220 | make_lilo_conf 221 | make_grub_conf 222 | 223 | # some more missing files: 224 | cp /etc/lsb-release $TARGET/etc/ 225 | cp /etc/os-release $TARGET/etc/ 226 | cp /etc/issue{,.net} $TARGET/etc/ 227 | 228 | # Some sane defaults 229 | GCCVER=$(chroot_run lvu installed gcc | awk -F\. '{ print $1"_"$2 }') 230 | 231 | cat < $TARGET/etc/lunar/local/config 232 | LUNAR_COMPILER="GCC_$GCCVER" 233 | LUNAR_MODULE="lunar" 234 | LUNAR_ALIAS_UDEV="systemd" 235 | LUNAR_ALIAS_KMOD="kmod" 236 | LUNAR_ALIAS_KERNEL_HEADERS="kernel-headers" 237 | LUNAR_ALIAS_SSL="openssl" 238 | LUNAR_ALIAS_OSSL="openssl" 239 | EOF 240 | 241 | # Disable services (user can choose to enable them using services menu) 242 | rm -f $TARGET/etc/systemd/system/network.target.wants/wpa_supplicant.service 243 | rm -f $TARGET/etc/systemd/system/sockets.target.wants/sshd.socket 244 | 245 | # root user skel files 246 | find $TARGET/etc/skel ! -type d | xargs -i cp '{}' $TARGET/root 247 | 248 | # initialize the new machine: 249 | touch $TARGET/var/log/{btmp,utmp,wtmp,lastlog} 250 | chmod 0644 $TARGET/var/log/{utmp,wtmp,lastlog} 251 | chmod 0600 $TARGET/var/log/btmp 252 | 253 | # Tell dracut to auto enable md devices if used during install 254 | if [ -e /proc/mdstat ]; then 255 | if egrep -q ^md[0-9]+ /proc/mdstat; then 256 | mdadm --examine --scan > $TARGET/etc/mdadm.conf 257 | cat < $TARGET/etc/dracut.conf.d/02-raid.conf 258 | # Enable software raid automatically using dracut. 259 | # -- AUTO-GENERATED FILE DO NOT MODIFY -- 260 | kernel_cmdline+=" rd.auto=1" 261 | mdadmconf="yes" 262 | EOF 263 | fi 264 | fi 265 | ) &> $LOG 266 | # really we are done now ;^) 267 | ) | $DIALOG --title " Installing Lunar Linux " --gauge "" 10 70 0 268 | 269 | cd / 270 | 271 | if (( STEP == 7 )); then 272 | (( STEP++ )) 273 | fi 274 | T_OK=\\Z2 275 | O_OK= 276 | 277 | install_bootloader && 278 | install_kernels 279 | fi 280 | } 281 | 282 | -------------------------------------------------------------------------------- /lunar-install/sbin/lish: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # quick hack to jump in and out of a lunar installer environment 4 | # 5 | 6 | . /etc/lunar/install/config 7 | 8 | export TARGET=/mnt 9 | 10 | set_priority 11 | 12 | if (($# > 0)); then 13 | eval "$@" 14 | else 15 | export PS1="\[\033[0;31m\][lunar-install] \u@\h \w \\$ \[\033[0m\]" 16 | message "\n ${PROBLEM_COLOR}Warning:${DEFAULT_COLOR}${MESSAGE_COLOR}" \ 17 | "lsh is potentially hazardous to your system.${DEFAULT_COLOR}\n" 18 | bash --rcfile $BOOTSTRAP 19 | fi 20 | -------------------------------------------------------------------------------- /lunar-install/sbin/lunar-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################# 3 | # # 4 | # portions Copyright 2001 by Kyle Sallee # 5 | # portions Copyright 2002 by Kagan Kongar # 6 | # portions Copyright 2002 by rodzilla # 7 | # portions Copyright 2003-2004 by tchan, kc8apf # 8 | # portions Copyright 2004-2007 by Auke Kok # 9 | # portions Copyright 2008-2017 by Stefan Wold # 10 | # # 11 | ############################################################# 12 | # # 13 | # This file in released under the GPLv2 # 14 | # # 15 | ############################################################# 16 | 17 | # start up the code 18 | . /etc/lunar/installer/config 19 | 20 | trap ":" INT QUIT 21 | 22 | $DIALOG --infobox "Lunar Linux Installer %VERSION% - %CODENAME% starting... " 4 60 23 | 24 | # turn off console blanking 25 | /usr/bin/setterm -blank 0 26 | cd / 27 | 28 | # load modules when passed on the boot prompt$ 29 | IFS=$' \t\n' 30 | for module in $(cat /proc/cmdline); do 31 | if grep -q "/${module}.ko:" /lib/modules/`uname -r`/modules.dep ; then 32 | modprobe $module 33 | fi 34 | done 35 | IFS=$'\t\n' 36 | 37 | # allow custom startup scripts to run instead of the installer 38 | if [ -x /run.sh ]; then 39 | echo "" 40 | echo " /--------------------------------------------------\\" 41 | echo " | |" 42 | echo " | Executing /run.sh instead of the Lunar Linux |" 43 | echo " | Installer! If something goes wrong then you're |" 44 | echo " | on your own, sorry... |" 45 | echo " | |" 46 | echo " \\--------------------------------------------------/" 47 | /run.sh 48 | else 49 | main 50 | fi 51 | -------------------------------------------------------------------------------- /mkfiles/bootstrap.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: target bootstrap bootstrap-base bootstrap-lunar 2 | 3 | .SECONDARY: $(ISO_TARGET)/.target $(ISO_TARGET)/.base $(ISO_TARGET)/.modules $(ISO_SOURCE)/cache/.copied 4 | 5 | bootstrap: bootstrap-base bootstrap-lunar 6 | 7 | 8 | # this rule is shared with the download 9 | $(ISO_TARGET)/.target: 10 | @rm -rf $(ISO_TARGET) 11 | @mkdir -p $(ISO_TARGET) 12 | @touch $@ 13 | 14 | target: $(ISO_TARGET)/.target 15 | 16 | 17 | # fill the target with the base file required 18 | $(ISO_TARGET)/.base: target 19 | @echo bootstrap-base 20 | @mkdir -p $(ISO_TARGET)/{dev,proc,run,sys,tmp,lib,usr/{lib,src},var} 21 | @ln -sf lib $(ISO_TARGET)/lib32 22 | @ln -sf lib $(ISO_TARGET)/lib64 23 | @ln -sf lib $(ISO_TARGET)/usr/lib32 24 | @ln -sf lib $(ISO_TARGET)/usr/lib64 25 | @ln -sf ../run/lock $(ISO_TARGET)/var/lock 26 | @ln -sf ../run $(ISO_TARGET)/var/run 27 | @cp -r $(ISO_SOURCE)/template/etc $(ISO_TARGET) 28 | @echo MAKES=$(ISO_MAKES) > $(ISO_TARGET)/etc/lunar/local/optimizations.GNU_MAKE 29 | @touch $@ 30 | 31 | bootstrap-base: $(ISO_TARGET)/.base 32 | 33 | 34 | # bootstrap on a lunar host 35 | $(ISO_SOURCE)/cache/.copied: 36 | @echo bootstrap-lunar-cache 37 | @$(ISO_SOURCE)/scripts/bootstrap-lunar-cache 38 | @touch $@ 39 | 40 | # note: use cat after grep to ignore the exit code of grep 41 | $(ISO_TARGET)/.modules: $(ISO_SOURCE)/cache/.copied 42 | @echo bootstrap-lunar 43 | @mkdir -p $(ISO_TARGET) 44 | @for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.xz ; do \ 45 | tar -xJf "$$archive" -C $(ISO_TARGET) || exit 1 ; \ 46 | done 47 | @mkdir -p $(ISO_TARGET)/var/state/lunar 48 | @touch $(ISO_TARGET)/var/state/lunar/packages.backup 49 | @grep -v "`sed 's/^/^/;s/:.*/:/' $(ISO_SOURCE)/cache/packages`" $(ISO_TARGET)/var/state/lunar/packages.backup | cat > $(ISO_TARGET)/var/state/lunar/packages 50 | @cat $(ISO_SOURCE)/cache/packages >> $(ISO_TARGET)/var/state/lunar/packages 51 | @cp $(ISO_TARGET)/var/state/lunar/packages $(ISO_TARGET)/var/state/lunar/packages.backup 52 | @touch $@ 53 | 54 | bootstrap-lunar: $(ISO_TARGET)/.modules 55 | -------------------------------------------------------------------------------- /mkfiles/download.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: download install-moonbase download-lunar 2 | .PHONY: download-moonbase moonbase-git 3 | 4 | .SECONDARY: $(ISO_TARGET)/.install-moonbase 5 | 6 | download: download-lunar 7 | 8 | 9 | # download the moonbase 10 | download-moonbase $(ISO_SOURCE)/spool/moonbase.tar.bz2: 11 | @echo download-moonbase 12 | @mkdir -p $(ISO_SOURCE)/spool 13 | @wget -O $@.tmp "`lsh echo '$$MOONBASE_URL'`/moonbase.tar.bz2" 14 | @mv $@.tmp $@ 15 | 16 | 17 | # note: this installs an empty installed packages list 18 | $(ISO_TARGET)/.install-moonbase: $(ISO_SOURCE)/spool/moonbase.tar.bz2 target 19 | @echo install-moonbase 20 | @mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase 21 | @rm -r $(ISO_TARGET)/var/lib/lunar/moonbase 22 | @tar -xjf $< -C $(ISO_TARGET)/var/lib/lunar moonbase/core moonbase/aliases 23 | @mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase/zlocal 24 | @mkdir -p $(ISO_TARGET)/var/state/lunar/moonbase 25 | @touch $(ISO_TARGET)/var/state/lunar/{packages,depends}{,.backup} 26 | @touch $@ 27 | 28 | install-moonbase: $(ISO_TARGET)/.install-moonbase 29 | 30 | 31 | # download on a lunar host 32 | $(ISO_SOURCE)/spool/.copied: install-moonbase 33 | @echo download-lunar 34 | @$(ISO_SOURCE)/scripts/download-lunar-spool 35 | @touch $@ 36 | 37 | download-lunar: $(ISO_SOURCE)/spool/.copied 38 | 39 | 40 | # Update the moonbase.tar.bz2 file from git 41 | moonbase-git: 42 | @echo moonbase-git 43 | @$(ISO_SOURCE)/scripts/pack-moonbase-git 44 | -------------------------------------------------------------------------------- /mkfiles/installer.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: lunar-install 2 | 3 | installer: lunar-install 4 | 5 | # Install the Lunar installer 6 | $(ISO_TARGET)/sbin/lunar-install: 7 | @echo lunar-install 8 | @make -C lunar-install install DESTDIR=$(ISO_TARGET) 9 | 10 | $(ISO_TARGET)/usr/share/lunar-install/moonbase.tar.bz2: $(ISO_SOURCE)/spool/moonbase.tar.bz2 iso-target 11 | @install -Dm644 $< $@ 12 | 13 | $(ISO_TARGET)/README: $(ISO_SOURCE)/template/README iso-target 14 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%KERNEL%:$(ISO_KERNEL):g' -e 's:%CNAME%:$(ISO_CNAME):g' -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 15 | 16 | $(ISO_TARGET)/usr/share/lunar-install/motd: $(ISO_SOURCE)/template/motd iso-target 17 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%KERNEL%:$(ISO_KERNEL):g' -e 's:%CNAME%:$(ISO_CNAME):g' -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 18 | 19 | lunar-install: $(ISO_TARGET)/sbin/lunar-install \ 20 | $(ISO_TARGET)/usr/share/lunar-install/moonbase.tar.bz2 \ 21 | $(ISO_TARGET)/README \ 22 | $(ISO_TARGET)/usr/share/lunar-install/motd 23 | -------------------------------------------------------------------------------- /mkfiles/iso.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: iso iso-target iso-modules iso-tools iso-files iso-strip iso-isolinux iso-efi iso-sfs 2 | .PHONY: iso-tools 3 | 4 | iso: $(ISO_SOURCE)/lunar-$(ISO_VERSION).iso 5 | 6 | # Blank for i686 builds for now 7 | XORRISO_EFI_OPTS := 8 | 9 | # Clean stage2 markers and mark the start of iso 10 | $(ISO_TARGET)/.iso-target: kernel pack 11 | @echo iso-target 12 | @rm -f $(ISO_TARGET)/.stage2* 13 | @touch $@ 14 | 15 | iso-target: $(ISO_TARGET)/.iso-target 16 | 17 | 18 | # Host system iso tools 19 | iso-tools: 20 | @which xorriso &> /dev/null || lin libisoburn 21 | @which isohybrid &> /dev/null || lin syslinux 22 | @which efitool-mkusb &> /dev/null || lin efitools 23 | @which mksquashfs &> /dev/null || lin squashfs 24 | @which rsync &> /dev/null || lin rsync 25 | 26 | # Remove non iso modules 27 | include $(ISO_SOURCE)/conf/modules.iso 28 | 29 | SYSLINUX_FILES=isolinux.bin isohdpfx.bin ldlinux.c32 libcom32.c32 libutil.c32 30 | 31 | $(ISO_TARGET)/.iso-modules: iso-target $(addprefix $(ISO_TARGET)/isolinux/, $(SYSLINUX_FILES)) 32 | @echo iso-modules 33 | @yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lrm -n $(filter-out $(ISO_MODULES), $(ALL_MODULES)) 34 | @rm -rf $(ISO_TARGET)/usr/lib/python* 35 | @touch $@ 36 | 37 | iso-modules: $(ISO_TARGET)/.iso-modules 38 | 39 | 40 | # Prepare target files 41 | ISO_ETC_FILES=lsb-release os-release fstab motd issue issue.net 42 | 43 | $(ISO_TARGET)/etc/%: $(ISO_SOURCE)/livecd/template/etc/% iso-modules 44 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%KERNEL%:$(ISO_KERNEL):g' -e 's:%CNAME%:$(ISO_CNAME):g' -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 45 | 46 | # Symlinks need special care 47 | $(ISO_TARGET)/.iso-files: iso-target 48 | @echo iso-files 49 | @rm -f $(ISO_TARGET)/etc/dracut.conf.d/02-lunar-live.conf $(ISO_TARGET)/etc/ssh/ssh_host_* 50 | @for unit in sockets.target.wants/sshd.socket multi-user.target.wants/sshd.service multi-user.target.wants/sshd-keys.service ; do \ 51 | rm -f $(ISO_TARGET)/etc/systemd/system/$$unit ; \ 52 | done 53 | @$(ISO_SOURCE)/scripts/chroot-build bash -c 'for unit in systemd-networkd systemd-resolved ; do systemctl disable $$unit; done' 54 | @[ ! -d $(ISO_TARGET)/etc/dracut.conf.d ] || rmdir --ignore-fail-on-non-empty $(ISO_TARGET)/etc/dracut.conf.d 55 | @cp -r $(ISO_SOURCE)/livecd/template/etc/systemd $(ISO_TARGET)/etc 56 | @> $(ISO_TARGET)/etc/machine-id 57 | @ln -sf ../../../tmp/random-seed $(ISO_TARGET)/var/lib/systemd/random-seed 58 | @mkdir -p $(ISO_TARGET)/var/cache/man 59 | @find $(ISO_TARGET)/etc/skel/ -type f -exec cp {} $(ISO_TARGET)/root/ \; 60 | @ln -sf /tmp/resolv.conf $(ISO_TARGET)/etc/resolv.conf 61 | @ln -sf /tmp/dhcpcd.duid $(ISO_TARGET)/etc/dhcpcd.duid 62 | @touch $@ 63 | 64 | iso-files: $(ISO_TARGET)/.iso-files $(addprefix $(ISO_TARGET)/etc/, $(ISO_ETC_FILES)) 65 | 66 | 67 | # Strip executables and libraries 68 | $(ISO_TARGET)/.iso-strip: iso-modules 69 | @echo iso-strip 70 | @find $(ISO_TARGET) \( -type f -perm /u=x -o -name 'lib*.so*' -o -name '*.ko' \) -exec strip --strip-unneeded {} \; 71 | @touch $@ 72 | 73 | iso-strip: $(ISO_TARGET)/.iso-strip 74 | 75 | 76 | # Copy the isolinux files to the target 77 | ISOLINUX_FILES=README f1.txt f2.txt f3.txt generate-iso.sh isolinux.cfg 78 | 79 | .SECONDARY: $(addprefix $(ISO_TARGET)/usr/share/syslinux/, $(SYSLINUX_FILES)) 80 | $(addprefix $(ISO_TARGET)/usr/share/syslinux/, $(SYSLINUX_FILES)): $(ISO_TARGET)/.iso-isolinux 81 | @test -f $@ 82 | @touch $@ 83 | 84 | $(ISO_TARGET)/isolinux/isolinux.bin: $(ISO_TARGET)/usr/share/syslinux/isolinux.bin 85 | @cp $< $@ 86 | 87 | $(ISO_TARGET)/isolinux/isohdpfx.bin: $(ISO_TARGET)/usr/share/syslinux/isohdpfx.bin 88 | @cp $< $@ 89 | 90 | $(ISO_TARGET)/isolinux/ldlinux.c32: $(ISO_TARGET)/usr/share/syslinux/ldlinux.c32 91 | @cp $< $@ 92 | 93 | $(ISO_TARGET)/isolinux/libcom32.c32: $(ISO_TARGET)/usr/share/syslinux/libcom32.c32 94 | @cp $< $@ 95 | 96 | $(ISO_TARGET)/isolinux/libutil.c32: $(ISO_TARGET)/usr/share/syslinux/libutil.c32 97 | @cp $< $@ 98 | 99 | $(ISO_TARGET)/boot/linux: $(ISO_TARGET)/.iso-isolinux 100 | @test -f $@ 101 | @touch $@ 102 | 103 | $(ISO_TARGET)/isolinux/linux: $(ISO_TARGET)/boot/linux 104 | @cp $< $@ 105 | 106 | $(ISO_TARGET)/boot/initrd: $(ISO_TARGET)/.iso-isolinux 107 | @test -f $@ 108 | @touch $@ 109 | 110 | $(ISO_TARGET)/isolinux/initrd: $(ISO_TARGET)/boot/initrd 111 | @cp $< $@ 112 | 113 | $(ISO_TARGET)/isolinux/%: $(ISO_SOURCE)/isolinux/% $(ISO_TARGET)/.iso-isolinux 114 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%KERNEL%:$(ISO_KERNEL):g' -e 's:%CNAME%:$(ISO_CNAME):g' -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 115 | 116 | $(ISO_TARGET)/isolinux/%: $(ISO_SOURCE)/isolinux/%.$(ISO_ARCH) $(ISO_TARGET)/.iso-isolinux 117 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%KERNEL%:$(ISO_KERNEL):g' -e 's:%CNAME%:$(ISO_CNAME):g' -e 's:%COPYRIGHTYEAR%:$(ISO_COPYRIGHTYEAR):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 118 | 119 | $(ISO_TARGET)/.iso-isolinux: iso-target 120 | @echo iso-isolinux 121 | @mkdir -p $(ISO_TARGET)/isolinux 122 | @touch $@ 123 | 124 | iso-isolinux: $(ISO_TARGET)/.iso-isolinux $(addprefix $(ISO_TARGET)/isolinux/, $(SYSLINUX_FILES)) $(ISO_TARGET)/isolinux/linux $(ISO_TARGET)/isolinux/initrd $(addprefix $(ISO_TARGET)/isolinux/, $(ISOLINUX_FILES)) 125 | 126 | # Setup EFI for USB and CD 127 | $(ISO_TARGET)/.iso-efi: iso-target 128 | @echo "Setting up iso-efi" 129 | @mkdir -p $(ISO_TARGET)/EFI/boot $(ISO_TARGET)/loader/entries $(ISO_TARGET)/EFI/lunariso 130 | @touch $@ 131 | 132 | $(ISO_TARGET)/EFI/boot/bootx64.efi: /usr/share/efitools/efi/PreLoader.efi 133 | @cp $< $@ 134 | 135 | $(ISO_TARGET)/EFI/boot/HashTool.efi: /usr/share/efitools/efi/HashTool.efi 136 | @cp $< $@ 137 | 138 | $(ISO_TARGET)/EFI/boot/loader.efi: $(ISO_TARGET)/usr/lib/systemd/boot/efi/systemd-bootx64.efi 139 | @cp $< $@ 140 | 141 | $(ISO_TARGET)/loader/loader.conf: $(ISO_SOURCE)/efiboot/loader/loader.conf 142 | @cp $< $@ 143 | 144 | $(ISO_TARGET)/loader/entries/lunariso-x86_64.conf: $(ISO_SOURCE)/efiboot/loader/entries/lunariso-x86_64-cd.conf $(ISO_TARGET)/.iso-efi 145 | @sed -e 's:%VERSION%:$(ISO_VERSION):g' -e 's:%CODENAME%:$(ISO_CODENAME):g' -e 's:%DATE%:$(ISO_DATE):g' -e 's:%LABEL%:LUNAR_$(ISO_MAJOR):' $< > $@ 146 | 147 | $(ISO_TARGET)/EFI/lunariso/efiboot.img: $(ISO_TARGET)/.iso-efi 148 | @echo "Creating EFI boot image" 149 | @$(ISO_SOURCE)/scripts/create-efi-image 150 | 151 | ifeq ($(ISO_ARCH),x86_64) 152 | XORRISO_EFI_OPTS := -append_partition 2 0xef $(ISO_TARGET)/EFI/lunariso/efiboot.img -eltorito-alt-boot -e --interval:appended_partition_2:all:: -no-emul-boot -isohybrid-gpt-basdat 153 | iso-efi: $(ISO_TARGET)/.iso-efi $(ISO_TARGET)/EFI/boot/bootx64.efi $(ISO_TARGET)/EFI/boot/HashTool.efi $(ISO_TARGET)/EFI/boot/loader.efi $(ISO_TARGET)/loader/loader.conf $(ISO_TARGET)/loader/entries/lunariso-x86_64.conf $(ISO_TARGET)/EFI/lunariso/efiboot.img 154 | else 155 | iso-efi: 156 | @$(SHELL) -c true 157 | endif 158 | 159 | # Generate squashfs image 160 | $(ISO_TARGET)/.iso-sfs: iso-target iso-strip installer 161 | @echo "Preparing squashfs image" 162 | @mkdir -p $(ISO_TARGET)/LiveOS 163 | @touch $@ 164 | 165 | $(ISO_TARGET)/LiveOS/squashfs.img: $(ISO_TARGET)/.iso-sfs 166 | @echo "Creating squashfs image" 167 | @$(ISO_SOURCE)/scripts/make-squashfs 168 | 169 | iso-sfs: $(ISO_TARGET)/LiveOS/squashfs.img 170 | 171 | # Generate the actual image 172 | $(ISO_SOURCE)/lunar-$(ISO_VERSION).iso: iso-tools iso-files iso-isolinux iso-efi iso-strip iso-sfs 173 | @echo iso 174 | @xorriso -as mkisofs \ 175 | -iso-level 3 \ 176 | -full-iso9660-filenames \ 177 | -joliet \ 178 | -joliet-long \ 179 | -rational-rock \ 180 | -o $@.tmp -l \ 181 | -partition_offset 16 \ 182 | -eltorito-boot isolinux/isolinux.bin \ 183 | -eltorito-catalog isolinux/boot.cat \ 184 | -no-emul-boot -boot-load-size 4 -boot-info-table \ 185 | -isohybrid-mbr $(ISO_TARGET)/isolinux/isohdpfx.bin \ 186 | --mbr-force-bootable \ 187 | $(XORRISO_EFI_OPTS) \ 188 | -m '$(ISO_TARGET)/.*' \ 189 | -m '$(ISO_TARGET)/boot' \ 190 | -m '$(ISO_TARGET)/bin' \ 191 | -m '$(ISO_TARGET)/sbin' \ 192 | -m '$(ISO_TARGET)/usr' \ 193 | -m '$(ISO_TARGET)/dev' \ 194 | -m '$(ISO_TARGET)/etc' \ 195 | -m '$(ISO_TARGET)/home' \ 196 | -m '$(ISO_TARGET)/lib*' \ 197 | -m '$(ISO_TARGET)/root' \ 198 | -m '$(ISO_TARGET)/var' \ 199 | -m '$(ISO_TARGET)/media' \ 200 | -m '$(ISO_TARGET)/mnt' \ 201 | -m '$(ISO_TARGET)/opt' \ 202 | -m '$(ISO_TARGET)/run' \ 203 | -m '$(ISO_TARGET)/proc' \ 204 | -m '$(ISO_TARGET)/srv' \ 205 | -m '$(ISO_TARGET)/sys' \ 206 | -m '$(ISO_TARGET)/tmp' \ 207 | -publisher "Lunar Linux - http://www.lunar-linux.org/" \ 208 | -volid 'LUNAR_$(ISO_MAJOR)' \ 209 | -appid 'Lunar-$(ISO_VERSION)' $(ISO_TARGET) 210 | @mv $@.tmp $@ 211 | -------------------------------------------------------------------------------- /mkfiles/kernel.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: kernel linux 2 | 3 | kernel: linux 4 | 5 | 6 | .SECONDARY: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar 7 | $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar: stage2 8 | @echo linux 9 | @cp $(ISO_SOURCE)/kernels/conf/generic.$(ISO_ARCH) $(ISO_TARGET)/etc/lunar/local/.config.current 10 | @yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build lin -c linux 11 | @mv $(ISO_TARGET)/boot/vmlinuz-* $(ISO_TARGET)/boot/linux 12 | @mv $(ISO_TARGET)/boot/initramfs-*.img $(ISO_TARGET)/boot/initrd 13 | @xz -d -c $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.xz > $@.tmp 14 | @rm $(ISO_TARGET)/var/cache/lunar/linux-$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux)-$(ISO_BUILD).tar.xz 15 | @mv $@.tmp $@ 16 | 17 | .INTERMEDIATE: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files 18 | $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar 19 | @find $(ISO_TARGET)/usr/src -path '$(ISO_TARGET)/usr/src/linux*' ! -type d \( \ 20 | -type l -o \ 21 | -path '$(ISO_TARGET)/usr/src/linux-*/.config' -o \ 22 | -path '$(ISO_TARGET)/usr/src/linux-*/Module.symvers' -o \ 23 | -path '$(ISO_TARGET)/usr/src/linux-*/scripts/*' -o \ 24 | -path '$(ISO_TARGET)/usr/src/linux-*/include/*' -o \ 25 | -name 'Makefile*' -o \ 26 | -name 'Kconfig*' \) -printf 'usr/src/%P\n' > $@ 27 | 28 | $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.xz: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files 29 | @tar -rf $< -C $(ISO_TARGET) -T $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files 30 | @rm $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).files 31 | @echo "linux-$(ISO_ARCH):$$($(ISO_SOURCE)/scripts/chroot-build lvu installed linux):You have no choice" > $(ISO_TARGET)/var/cache/lunar/kernels 32 | @xz $< 33 | 34 | linux: $(ISO_TARGET)/var/cache/lunar/linux-$(ISO_ARCH).tar.xz 35 | -------------------------------------------------------------------------------- /mkfiles/pack.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: pack pack-base 2 | 3 | pack: pack-base 4 | 5 | 6 | # Create listing of all potention installed files 7 | .INTERMEDIATE: $(ISO_TARGET)/.aaa_base.found 8 | $(ISO_TARGET)/.aaa_base.found: stage2 9 | @echo pack-find 10 | @find $(ISO_TARGET) ! -path '$(ISO_TARGET)/.*' -a \ 11 | ! -path '$(ISO_TARGET)/etc/machine-id' -a \ 12 | ! -path '$(ISO_TARGET)/etc/ssh/ssh_host_*' -a \ 13 | ! -path '$(ISO_TARGET)/etc/dracut.conf.d/02-lunar-live.conf' \ 14 | -printf '/%P\n' \( \ 15 | -path '$(ISO_TARGET)/dev' -o \ 16 | -path '$(ISO_TARGET)/etc/lunar/local' -o \ 17 | -path '$(ISO_TARGET)/mnt' -o \ 18 | -path '$(ISO_TARGET)/proc' -o \ 19 | -path '$(ISO_TARGET)/root' -o \ 20 | -path '$(ISO_TARGET)/sys' -o \ 21 | -path '$(ISO_TARGET)/tmp' -o \ 22 | -path '$(ISO_TARGET)/boot' -o \ 23 | -path '$(ISO_TARGET)/lib/modules' -o \ 24 | -path '$(ISO_TARGET)/usr/include' -o \ 25 | -path '$(ISO_TARGET)/usr/lib' -o \ 26 | -path '$(ISO_TARGET)/usr/libexec' -o \ 27 | -path '$(ISO_TARGET)/usr/share' -o \ 28 | -path '$(ISO_TARGET)/usr/src' -o \ 29 | -path '$(ISO_TARGET)/var/cache' -o \ 30 | -path '$(ISO_TARGET)/var/lib/lunar' -o \ 31 | -path '$(ISO_TARGET)/var/log' -o \ 32 | -path '$(ISO_TARGET)/var/spool' -o \ 33 | -path '$(ISO_TARGET)/var/state/lunar' \) -prune > $@ 34 | 35 | # Create listing of all installed files 36 | .INTERMEDIATE: $(ISO_TARGET)/.aaa_base.tracked 37 | $(ISO_TARGET)/.aaa_base.tracked: stage2 38 | @echo pack-tracked 39 | @sort -u $(ISO_TARGET)/var/log/lunar/install/* > $@ 40 | 41 | # Filter listing of all installed files 42 | .INTERMEDIATE: $(ISO_TARGET)/.aaa_base.filtered 43 | $(ISO_TARGET)/.aaa_base.filtered: $(ISO_TARGET)/.aaa_base.found $(ISO_TARGET)/.aaa_base.tracked 44 | @echo pack-filtered 45 | @sort $^ | uniq -d > $@ 46 | 47 | # Diff listing of files 48 | .INTERMEDIATE: $(ISO_TARGET)/.aaa_base.list 49 | $(ISO_TARGET)/.aaa_base.list: $(ISO_TARGET)/.aaa_base.found $(ISO_TARGET)/.aaa_base.filtered 50 | @echo pack-list 51 | @sort $^ | uniq -u | sed 's:^/::' > $@ 52 | 53 | # Create tar with not tracked files 54 | $(ISO_TARGET)/var/cache/lunar/aaa_base.tar.xz: $(ISO_TARGET)/.aaa_base.list 55 | @echo pack-base 56 | @tar -cJf $@ -C $(ISO_TARGET) --no-recursion -T $< 57 | 58 | pack-base: $(ISO_TARGET)/var/cache/lunar/aaa_base.tar.xz 59 | -------------------------------------------------------------------------------- /mkfiles/stage1.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: stage1 stage1-spool stage1-moonbase stage1-toolchain stage1-build stage1-cache 2 | 3 | .SECONDARY: $(ISO_TARGET)/.stage1-spool $(ISO_TARGET)/.stage1-moonbase $(ISO_TARGET)/.stage1-toolchain $(ISO_TARGET)/.stage1 4 | 5 | stage1: stage1-cache 6 | 7 | 8 | # install the sources 9 | $(ISO_TARGET)/.stage1-spool: download 10 | @echo stage1-spool 11 | @mkdir -p $(ISO_TARGET)/var/spool/lunar 12 | @ln $(ISO_SOURCE)/spool/* $(ISO_TARGET)/var/spool/lunar/ 13 | @touch $@ 14 | 15 | stage1-spool: $(ISO_TARGET)/.stage1-spool 16 | 17 | 18 | # generate the required cache files 19 | $(ISO_TARGET)/.stage1-moonbase: bootstrap install-moonbase 20 | @echo stage1-moonbase 21 | @$(ISO_SOURCE)/scripts/chroot-build lsh create_module_index 22 | @$(ISO_SOURCE)/scripts/chroot-build lsh create_depends_cache 23 | @$(ISO_SOURCE)/scripts/chroot-build lsh update_plugins 24 | @touch $@ 25 | 26 | stage1-moonbase: $(ISO_TARGET)/.stage1-moonbase 27 | 28 | 29 | # first build sequence to get the toolchain installed properly 30 | include $(ISO_SOURCE)/conf/modules.toolchain 31 | 32 | $(ISO_TARGET)/.stage1-toolchain: stage1-moonbase stage1-spool 33 | @echo stage1-toolchain 34 | @yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build bash -c 'for mod in $(TOOLCHAIN_MODULES); do lin -rc $$mod || exit 1; done' 35 | @touch $@ 36 | 37 | stage1-toolchain: $(ISO_TARGET)/.stage1-toolchain 38 | 39 | 40 | # first time build all the require modules for a minimal system 41 | include $(ISO_SOURCE)/conf/modules.stage1 42 | 43 | $(ISO_TARGET)/.stage1: stage1-toolchain 44 | @echo stage1-build 45 | @yes n | tr -d '\n' | $(ISO_SOURCE)/scripts/chroot-build bash -c 'for mod in `lsh sort_by_dependency $(filter-out $(TOOLCHAIN_MODULES),$(STAGE1_MODULES))`; do lin -rc $$mod || exit 1; done' 46 | @touch $@ 47 | 48 | stage1-build: $(ISO_TARGET)/.stage1 49 | 50 | 51 | # replace the cache with the new build cache 52 | $(ISO_SOURCE)/cache/.stage1: stage1-build 53 | @echo stage1-cache 54 | @rm -rf $(ISO_SOURCE)/cache 55 | @cp -r $(ISO_TARGET)/var/cache/lunar $(ISO_SOURCE)/cache 56 | @grep $(patsubst %,-e^%:,$(STAGE1_MODULES)) $(ISO_TARGET)/var/state/lunar/packages | cat > $(ISO_SOURCE)/cache/packages 57 | @touch $@ 58 | 59 | stage1-cache: $(ISO_SOURCE)/cache/.stage1 60 | -------------------------------------------------------------------------------- /mkfiles/stage2.mk: -------------------------------------------------------------------------------- 1 | .INTERMEDIATE: stage2 stage2-target stage2-base stage2-modules stage2-spool stage2-extract-moonbase stage2-moonbase stage2-toolchain stage2-build 2 | 3 | .SECONDARY: $(ISO_TARGET)/.stage2-target $(ISO_TARGET)/.stage2-base $(ISO_TARGET)/.stage2-modules $(ISO_TARGET)/.stage2-spool $(ISO_TARGET)/.stage2-extract-moonbase $(ISO_TARGET)/.stage2-moonbase $(ISO_TARGET)/.stage2-toolchain $(ISO_TARGET)/.stage2 4 | 5 | stage2: stage2-build $(ISO_TARGET)/var/cache/lunar/packages 6 | 7 | 8 | # clean the target directory for stage2 9 | $(ISO_TARGET)/.stage2-target: stage1 10 | @echo stage2-target 11 | @rm -rf $(ISO_TARGET) 12 | @mkdir $(ISO_TARGET) 13 | @touch $@ 14 | 15 | stage2-target: $(ISO_TARGET)/.stage2-target 16 | 17 | 18 | # create base directory structure 19 | $(ISO_TARGET)/.stage2-base: stage2-target 20 | @echo stage2-base 21 | @ln -sf lib $(ISO_TARGET)/lib32 22 | @ln -sf lib $(ISO_TARGET)/lib64 23 | @mkdir -p $(ISO_TARGET)/usr 24 | @ln -sf lib $(ISO_TARGET)/usr/lib32 25 | @ln -sf lib $(ISO_TARGET)/usr/lib64 26 | @cp -r $(ISO_SOURCE)/template/etc $(ISO_TARGET) 27 | @cp $(ISO_SOURCE)/kernels/conf/generic.$(ISO_ARCH) $(ISO_TARGET)/etc/lunar/local/.config.current 28 | @echo MAKES=$(ISO_MAKES) > $(ISO_TARGET)/etc/lunar/local/optimizations.GNU_MAKE 29 | @touch $@ 30 | 31 | stage2-base: $(ISO_TARGET)/.stage2-base 32 | 33 | 34 | # install the module caches 35 | $(ISO_TARGET)/.stage2-modules: stage2-target 36 | @echo stage2-modules 37 | @for archive in $(ISO_SOURCE)/cache/*-$(ISO_BUILD).tar.xz ; do \ 38 | tar -xJf "$$archive" -C $(ISO_TARGET) || exit 1 ; \ 39 | done 40 | @mkdir -p $(ISO_TARGET)/var/state/lunar 41 | @touch $(ISO_TARGET)/var/state/lunar/packages.backup 42 | @grep -v "`sed 's/^/^/;s/:.*/:/' $(ISO_SOURCE)/cache/packages`" $(ISO_TARGET)/var/state/lunar/packages.backup | cat > $(ISO_TARGET)/var/state/lunar/packages 43 | @cat $(ISO_SOURCE)/cache/packages >> $(ISO_TARGET)/var/state/lunar/packages 44 | @cp $(ISO_TARGET)/var/state/lunar/packages $(ISO_TARGET)/var/state/lunar/packages.backup 45 | @touch $@ 46 | 47 | stage2-modules: $(ISO_TARGET)/.stage2-modules 48 | 49 | 50 | # copy the source files 51 | $(ISO_TARGET)/.stage2-spool: stage2-target download 52 | @echo stage2-spool 53 | @mkdir -p $(ISO_TARGET)/var/spool/lunar 54 | @ln $(ISO_SOURCE)/spool/* $(ISO_TARGET)/var/spool/lunar/ 55 | @touch $@ 56 | 57 | stage2-spool: $(ISO_TARGET)/.stage2-spool 58 | 59 | 60 | $(ISO_TARGET)/.stage2-extract-moonbase: stage2-target $(ISO_SOURCE)/spool/moonbase.tar.bz2 61 | @echo stage2-extract-moonbase 62 | @mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase 63 | @rm -r $(ISO_TARGET)/var/lib/lunar/moonbase 64 | @tar -xjf $(ISO_SOURCE)/spool/moonbase.tar.bz2 -C $(ISO_TARGET)/var/lib/lunar moonbase/core moonbase/aliases 65 | @mkdir -p $(ISO_TARGET)/var/lib/lunar/moonbase/zlocal 66 | @mkdir -p $(ISO_TARGET)/var/state/lunar/moonbase 67 | @touch $(ISO_TARGET)/var/state/lunar/packages{,.backup} 68 | @cp $(ISO_SOURCE)/template/var/state/lunar/depends $(ISO_TARGET)/var/state/lunar/depends 69 | @cp $(ISO_TARGET)/var/state/lunar/depends{,.backup} 70 | @touch $@ 71 | 72 | stage2-extract-moonbase: $(ISO_TARGET)/.stage2-extract-moonbase 73 | 74 | 75 | # generate the required cache files 76 | $(ISO_TARGET)/.stage2-moonbase: stage2-base stage2-modules stage2-extract-moonbase 77 | @echo stage2-build-moonbase 78 | @$(ISO_SOURCE)/scripts/chroot-build lsh create_module_index 79 | @$(ISO_SOURCE)/scripts/chroot-build lsh create_depends_cache 80 | @$(ISO_SOURCE)/scripts/chroot-build lsh update_plugins 81 | @touch $@ 82 | 83 | stage2-moonbase: $(ISO_TARGET)/.stage2-moonbase 84 | 85 | 86 | # build all the require modules for the iso 87 | $(ISO_SOURCE)/conf/modules.all: $(ISO_SOURCE)/spool/moonbase.tar.bz2 88 | @echo ALL_MODULES=`tar -tf $< | sed -n 's@^moonbase/core/\([^/]*/\)*\([^/]\+\)/DETAILS$$@\2@p'` > $@ 89 | 90 | ifneq ($(MAKECMDGOALS),clean) 91 | -include $(ISO_SOURCE)/conf/modules.all 92 | endif 93 | include $(ISO_SOURCE)/conf/modules.stage2 94 | include $(ISO_SOURCE)/conf/modules.kernel 95 | include $(ISO_SOURCE)/conf/modules.exclude 96 | -include $(ISO_SOURCE)/conf/modules.exclude.$(ISO_ARCH) 97 | 98 | $(ISO_TARGET)/.stage2-toolchain: stage2-moonbase stage2-spool $(ISO_SOURCE)/conf/modules.all 99 | @echo stage2-toolchain 100 | @ASK_FOR_REBUILDS=n PROMPT_DELAY=0 $(ISO_SOURCE)/scripts/chroot-build lin -c $(STAGE2_MODULES) 101 | @touch $@ 102 | 103 | stage2-toolchain: $(ISO_TARGET)/.stage2-toolchain 104 | 105 | $(ISO_TARGET)/.stage2: stage2-toolchain 106 | @echo stage2-build 107 | @cp /etc/resolv.conf $(ISO_TARGET)/etc/resolv.conf 108 | @ASK_FOR_REBUILDS=n PROMPT_DELAY=0 $(ISO_SOURCE)/scripts/chroot-build bash -c 'for mod in `lsh sort_by_dependency $(filter-out $(KERNEL_MODULES) $(STAGE2_MODULES) $(EXCLUDE_MODULES),$(ALL_MODULES))`; do lin -c $$mod || exit 1; done' 109 | # Rebuild systemd again to enable cryptsetup (cyclic dependency) 110 | @perl -pe -i 'if(/^systemd:cryptsetup/) { s/:off:/:on:/; }' $(ISO_TARGET)/var/state/lunar/depends 111 | @ASK_FOR_REBUILDS=n PROMPT_DELAY=0 $(ISO_SOURCE)/scripts/chroot-build bash -c 'lin -c systemd' 112 | @rm -f $(ISO_TARGET)/etc/resolv.conf 113 | @touch $@ 114 | 115 | stage2-build: $(ISO_TARGET)/.stage2 116 | 117 | $(ISO_TARGET)/var/cache/lunar/packages: stage2-build 118 | @mkdir -p $(ISO_TARGET)/var/cache/lunar 119 | @cp $(ISO_TARGET)/var/state/lunar/packages $@ 120 | -------------------------------------------------------------------------------- /scripts/bootstrap-lunar-cache: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . $ISO_SOURCE/conf/modules.bootstrap 4 | 5 | mkdir -p "$ISO_SOURCE/cache" 6 | 7 | NEED_MODULES= 8 | LUNAR_CACHE=`lsh echo '$INSTALL_CACHE'` 9 | NEED_CACHE= 10 | NO_CACHE= 11 | 12 | # make a list of all the required caches 13 | for mod in $BOOTSTRAP_MODULES ; do 14 | # if this module isn't installed it probebly isn't required 15 | if lsh module_installed $mod ; then 16 | NEED_MODULES="$NEED_MODULES $mod" 17 | for dep in `lvu links $mod` ; do 18 | MODULE_NAME="$dep" 19 | # find the correct name of this module 20 | while echo "$MODULE_NAME" | grep -q - ; do 21 | MODULE_NAME=${MODULE_NAME%-*} 22 | lsh module_installed $MODULE_NAME && break 23 | done || continue 24 | NEED_MODULES="$NEED_MODULES $MODULE_NAME" 25 | done 26 | fi 27 | done 28 | 29 | # make a unique list of module 30 | NEED_MODULES=`for mod in $NEED_MODULES ; do echo $mod ; done | sort -u | grep -v '^moonbase$'` 31 | 32 | echo Required modules: 33 | for mod in $NEED_MODULES ; do 34 | echo " $mod" 35 | done 36 | 37 | for mod in $NEED_MODULES ; do 38 | # check for cache file presence 39 | MODULE_VERSION=`lsh installed_version $mod` 40 | CACHE="$mod-$MODULE_VERSION-$ISO_BUILD.tar.xz" 41 | if [ ! -f "$ISO_SOURCE/cache/$CACHE" ] ; then 42 | cp "$LUNAR_CACHE/$CACHE" "$ISO_SOURCE/cache/$CACHE" && echo "$mod:$(date --date=@$(stat -c%Z $LUNAR_CACHE/$CACHE) +%Y%m%d):installed:$MODULE_VERSION:0KB" >> "$ISO_SOURCE/cache/packages" || NEED_CACHE="$NEED_CACHE $mod" 43 | fi 44 | done 45 | 46 | if [ -z "$NEED_CACHE" ] ; then 47 | exit 0 48 | fi 49 | 50 | echo Rebuild modules to create cache: 51 | for mod in $NEED_CACHE ; do 52 | echo " $mod" 53 | done 54 | 55 | if [ -n "$REBUILD_MANUAL" ] ; then 56 | exit 1 57 | fi 58 | 59 | OLD_ARCHIVE=`lunar set ACHIVE` 60 | OLD_COMPRESS_METHOD=`lunar set COMPRESS_METHOD` 61 | lunar set ARCHIVE on 62 | lunar set COMPRESS_METHOD xz 63 | lin -c $NEED_CACHE 64 | OLD_ARCHIVE=${OLD_ARCHIVE#*=} 65 | if [ -z "$OLD_ARCHIVE" ] ; then 66 | lunar unset ARCHIVE 67 | else 68 | lunar set ARCHIVE $OLD_ARCHIVE 69 | fi 70 | OLD_COMPRESS_METHOD=${OLD_COMPRESS_METHOD#*=} 71 | if [ -z "$OLD_COMPRESS_METHOD" ] ; then 72 | lunar unset COMPRESS_METHOD 73 | else 74 | lunar set COMPRESS_METHOD $OLD_COMPRESS_METHOD 75 | fi 76 | 77 | for mod in $NEED_CACHE ; do 78 | # check for cache file presence 79 | CACHE="$mod-$(lsh installed_version $mod)-$ISO_BUILD.tar.xz" 80 | if [ ! -f "$ISO_SOURCE/cache/$CACHE" ] ; then 81 | cp "$LUNAR_CACHE/$CACHE" "$ISO_SOURCE/cache/$CACHE" && echo "$mod:$(date --date=@$(stat -c%Z $LUNAR_CACHE/$CACHE) +%Y%m%d):installed:$MODULE_VERSION:0KB" >> "$ISO_SOURCE/cache/packages" || NO_CACHE="$NO_CACHE $mod" 82 | fi 83 | done 84 | 85 | if [ -z "$NO_CACHE" ] ; then 86 | exit 0 87 | fi 88 | 89 | echo No module cache files: 90 | for mod in $NO_CACHE ; do 91 | echo " $mod" 92 | done 93 | 94 | exit 1 95 | -------------------------------------------------------------------------------- /scripts/chroot-build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function mount_system_fs () 4 | { 5 | for mpoint in proc sys dev ; do 6 | mount --bind /${mpoint} $ISO_TARGET/${mpoint} || return 1 7 | done 8 | for mpoint in run tmp ; do 9 | mount -t tmpfs tmpfs $ISO_TARGET/${mpoint} || return 1 10 | done 11 | } 12 | 13 | function umount_system_fs () 14 | { 15 | for mpoint in proc sys dev run tmp ; do 16 | if ! umount $ISO_TARGET/${mpoint} &> /dev/null ; then 17 | umount -l -f $ISO_TARGET/${mpoint} &> /dev/null 18 | fi 19 | done 20 | } 21 | 22 | mount_system_fs && 23 | 24 | mkdir $ISO_TARGET/run/lock && 25 | mkdir $ISO_TARGET/run/lock/lunar && 26 | 27 | chroot "$ISO_TARGET" "$@" 28 | RESULT=$? 29 | 30 | umount_system_fs 31 | 32 | exit $RESULT 33 | -------------------------------------------------------------------------------- /scripts/create-efi-image: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | MNTDIR=$(mktemp -d /tmp/efiboot-XXXXXX) 6 | BOOTIMGSIZE="${1:-50}M" 7 | BOOTIMGFILE="${2:-$ISO_TARGET/EFI/lunariso/efiboot.img}" 8 | 9 | finishScript() { 10 | umount -d $MNTDIR 11 | rmdir $MNTDIR 12 | } 13 | 14 | trap finishScript 0 2 3 15 15 | 16 | if [ ! -d "$(dirname $BOOTIMGFILE)" ]; then 17 | echo "Missing EFI dir in $ISO_TARGET, previous step failed..." 18 | exit 1 19 | fi 20 | 21 | truncate -s $BOOTIMGSIZE $BOOTIMGFILE 22 | mkfs.fat -n LUNAR_EFI $BOOTIMGFILE > /dev/null 23 | mount $BOOTIMGFILE $MNTDIR 24 | mkdir -p $MNTDIR/EFI/{lunariso,boot} $MNTDIR/loader/entries 25 | cp $ISO_TARGET/boot/{linux,initrd} $MNTDIR/EFI/lunariso/ 26 | cp $ISO_TARGET/EFI/boot/{bootx64.efi,HashTool.efi} $MNTDIR/EFI/boot/ 27 | cp $ISO_TARGET/usr/lib/systemd/boot/efi/systemd-bootx64.efi $MNTDIR/EFI/boot/loader.efi 28 | cp $ISO_SOURCE/efiboot/loader/loader.conf $MNTDIR/loader/loader.conf 29 | sed -e "s:%VERSION%:${ISO_VERSION}:g" \ 30 | -e "s:%CODENAME%:${ISO_CODENAME}:g" \ 31 | -e "s:%DATE%:${ISO_DATE}:g" \ 32 | -e "s:%LABEL%:LUNAR_${ISO_MAJOR}:g" \ 33 | $ISO_SOURCE/efiboot/loader/entries/lunariso-x86_64-usb.conf > $MNTDIR/loader/entries/lunariso-x86_64.conf 34 | -------------------------------------------------------------------------------- /scripts/download-lunar-spool: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CORE_MODULES=`find "$ISO_TARGET/var/lib/lunar/moonbase/core" -name DETAILS -printf "%h\n" | sed 's@.*/@@'` 4 | 5 | mkdir -p "$ISO_SOURCE/spool" 6 | 7 | LUNAR_CACHE=`lsh echo '$SOURCE_CACHE'` 8 | NO_CACHE= 9 | 10 | echo Required modules: 11 | for mod in $CORE_MODULES ; do 12 | echo " $mod" 13 | done 14 | 15 | for mod in $CORE_MODULES ; do 16 | lsh MOONBASE="$ISO_TARGET/var/lib/lunar/moonbase" download_module "$mod" 17 | # check for cache file presence 18 | for src in `lsh MOONBASE="$ISO_TARGET/var/lib/lunar/moonbase" sources "$mod"` ; do 19 | if [ ! -f "$ISO_SOURCE/spool/$src" ] ; then 20 | cp "$LUNAR_CACHE/$src" "$ISO_SOURCE/spool/$src" || NO_CACHE="$NO_CACHE $mod" 21 | fi 22 | done 23 | done 24 | 25 | if [ -z "$NO_CACHE" ] ; then 26 | exit 0 27 | fi 28 | 29 | # make a unique list of module 30 | NO_CACHE=`for mod in $NO_CACHE ; do echo $mod ; done | sort -u` 31 | 32 | echo No module source files: 33 | for mod in $NO_CACHE ; do 34 | echo " $mod" 35 | done 36 | 37 | exit 1 38 | -------------------------------------------------------------------------------- /scripts/make-squashfs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # !!! DO NOT CHANGE THE IMG NAMES !!! 6 | # Dracut requires a very specific fs hiearchy for squashfs 7 | # /LiveOS 8 | # |- squashfs.img 9 | # !(mount) 10 | # /LiveOS 11 | # |- rootfs.img 12 | ROOTFSMNTDIR=$(mktemp -d /tmp/rootfs-XXXXXX) 13 | SFSDIR=$ISO_SOURCE/_SFS 14 | ROOTFSIMGDIR=$SFSDIR/LiveOS 15 | ROOTFSIMG=$ROOTFSIMGDIR/rootfs.img 16 | 17 | finishScript() { 18 | umount -d $ROOTFSMNTDIR || true 19 | rmdir $ROOTFSMNTDIR 20 | rm -rf "$SFSDIR" 21 | } 22 | 23 | trap finishScript 0 2 3 15 24 | 25 | mkdir -p $ROOTFSIMGDIR 26 | truncate -s 16G $ROOTFSIMG 27 | mkfs.ext4 -O ^has_journal,^resize_inode -E lazy_itable_init=0 -m 0 -F "$ROOTFSIMG" 28 | tune2fs -i 0 -c 0 $ROOTFSIMG &> /dev/null 29 | mount $ROOTFSIMG $ROOTFSMNTDIR 30 | rsync -av $ISO_TARGET/ $ROOTFSMNTDIR --exclude .iso* \ 31 | --exclude .aaa_base* \ 32 | --exclude LiveOS \ 33 | --exclude boot/* \ 34 | --exclude isolinux/ \ 35 | --exclude EFI/ \ 36 | --exclude etc/lunar/local/* \ 37 | --exclude tmp/* \ 38 | --exclude var/tmp/* \ 39 | --exclude var/spool/* \ 40 | --exclude var/log/* \ 41 | --exclude usr/include \ 42 | --exclude usr/share/man \ 43 | --exclude usr/share/info \ 44 | --exclude usr/share/doc \ 45 | --exclude usr/share/gtk-doc \ 46 | --exclude usr/src \ 47 | --exclude var/state/lunar/module_history 48 | umount $ROOTFSMNTDIR 49 | mkdir -p $ISO_TARGET/LiveOS 50 | mksquashfs "$SFSDIR" "$ISO_TARGET/LiveOS/squashfs.img" -noappend -comp "xz" -no-progress 51 | -------------------------------------------------------------------------------- /scripts/pack-moonbase-git: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # pack a moonbase consisting of several separate 5 | # git trees. There are no duplicate packages. Ordering 6 | # matters! 7 | # 8 | 9 | GIT_DIR=$ISO_SOURCE/moonbase-git 10 | 11 | # The ISO is only interrested in core 12 | #REPOS=(core xorg other xfce efl kde gnome) 13 | REPOS=(core) 14 | 15 | mkdir -p $GIT_DIR 16 | 17 | rm -rf $GIT_DIR/moonbase 18 | mkdir $GIT_DIR/moonbase 19 | 20 | for n in ${REPOS[@]}; do 21 | P="$GIT_DIR/$n" 22 | if [ -d "$P" ]; then 23 | # Don't update the repos. Using git for manual control 24 | : #( cd $P; git pull ) 25 | else 26 | # Clone the repo if it doesn't exists. Helping the user here. 27 | git clone https://github.com/lunar-linux/moonbase-$n $P 28 | fi 29 | ( cd $P; git archive -o ../$n.tar --format=tar --prefix=$n/ HEAD ) 30 | tar -tf $P.tar \ 31 | | grep '/DETAILS$' \ 32 | | sed 's/\/DETAILS$//' \ 33 | | sed 's/\([a-zA-Z0-9/_-]*\)\/\([a-zA-Z0-9_+-]*\)/\2:\1/' > $P/module.index 34 | tar -xf $P.tar -C $GIT_DIR/moonbase 35 | rm $P.tar 36 | done 37 | 38 | # why does this not work? 39 | for n in ${REPOS[@]} ; do INDEXES=( ${INDEXES[@]} $GIT_DIR/$n/module.index) ; done 40 | DUPES=`cut -d: -f1 ${INDEXES[@]} | sort | uniq -d` 41 | 42 | # scan for duplicates 43 | for n in $DUPES; do 44 | echo "WARNING: Duplicate module $n" 45 | p="" 46 | for r in ${REPOS[@]}; do 47 | if grep -q "^$n:" $GIT_DIR/$r/module.index ; then 48 | if [ -n "$p" ]; then 49 | echo " removing $n from $r" 50 | rm -rf $GIT_DIR/moonbase/$(grep "^$n:" $GIT_DIR/$r/module.index | cut -d: -f2)/$n 51 | sed "/^$n:/d" -i $GIT_DIR/$r/module.index 52 | else 53 | echo " preserving $n from $r" 54 | p=$r 55 | fi 56 | fi 57 | done 58 | done 59 | 60 | # collate aliases and indices 61 | for n in ${REPOS[@]}; do 62 | cp $GIT_DIR/$n/module.index $GIT_DIR/moonbase/$n/module.index 63 | cat $GIT_DIR/$n/module.index >> $GIT_DIR/moonbase/module.index 64 | if [ -f $GIT_DIR/$n/aliases ]; then 65 | cat $GIT_DIR/$n/aliases >> $GIT_DIR/moonbase/aliases 66 | fi 67 | done 68 | 69 | # export 70 | mkdir -p $ISO_SOURCE/spool 71 | tar cjf $ISO_SOURCE/spool/moonbase.tar.bz2.tmp -C $GIT_DIR moonbase 72 | mv $ISO_SOURCE/spool/moonbase.tar.bz2{.tmp,} 73 | -------------------------------------------------------------------------------- /template/README: -------------------------------------------------------------------------------- 1 | 2 | //// \\\\ 3 | WELCOME TO LUNAR_LINUX ! 4 | \\\\ //// 5 | 6 | 7 | You are reading the README file which is present in the root of the ISO. 8 | This version comes with the following ISO: 9 | 10 | %VERSION% - %CODENAME% (%DATE%) 11 | 12 | To navigate through this file, use PgUp, PgDn, Up, Down etc. to browse 13 | through this file, or start your favorite editor on this file. Please 14 | read on for some general tips and hints first, and more detailed info 15 | on the installer procedure below. 16 | 17 | ======== 18 | 19 | 20 | Index: 21 | 22 | 1. About lunar-linux 23 | 2. General tips and hints 24 | 3. Installer procedure 25 | 4. After installation 26 | 5. Where to get more help 27 | 6. What more to do with this ISO 28 | 29 | ======== 30 | 31 | 32 | 1. About lunar-linux 33 | 34 | Lunar-Linux is a source based distribution. This means that lunar is just 35 | like any other distribution, except that you compile packages instead 36 | of installing precompiled packages. That really is the only difference 37 | with so-called "binary" distributions. 38 | 39 | This means that you have the control over how you compile packages 40 | yourself, instead of relying on the willingness of others to provide 41 | you the features of software that you need or want. This control is 42 | what allows you to do the following with lunar that other distributions 43 | typically don't allow you to do: 44 | 45 | * optimize your entire system for speed, or size 46 | * sacrifice stability for speed or vice versa 47 | * insert or remove features of packages that require recompiling 48 | * upgrade core system components without reinstalling 49 | 50 | But this is just an incomplete list. There are many more benefits that 51 | are not mentioned here. 52 | 53 | The downside is that you need to spend time compiling packages. However, 54 | with the current power of systems, this hardly stops people from choosing 55 | such an approach! 56 | 57 | A little history about lunar: Lunar-Linux was born as a fork from Sorcerer 58 | GNU Linux (SGL). Nowadays SGL doesn't exist anymore because the original 59 | author (Kyle Sallee) retracted his GPL code and distributes it under a 60 | non-OSI approved license, and renamed it "Sorcerer". Another group of 61 | people also forked SGL into SourceMage GNU Linux, and they work side by 62 | side Lunar-Linux, often sharing concepts and ideas. Lunar exists since 63 | early 2002. 64 | 65 | Lunar will provide you with an excellent platform for the following tasks: 66 | 67 | * server oriented systems 68 | * development and programming systems 69 | * high-performance computing and clustering 70 | * High-end gaming 71 | * Desktop computing 72 | 73 | But be warned: depending on your needs you might need to invest a large 74 | amount of time into your system. Lunar is not a hands-off distribution 75 | per se, although it can be under specific circumstances. 76 | 77 | It is all up to you! 78 | 79 | ======== 80 | 81 | 82 | 2. General tips and hints 83 | 84 | There are many tips that we can give you now but a few are more important 85 | than others: 86 | 87 | * Know your system's hardware or get to know it 88 | 89 | Picking good drivers, configuring your system is important. Choose wisely 90 | and get to know your system by reading `lspci` and /proc/cpuinfo. Read 91 | documentation and howto's, and other people's experiences online. 92 | 93 | * Don't over-optimize! 94 | 95 | Optimizations are nice, but they can break your entire system. Start 96 | with modest optimizations, and increase them slowly as you understand 97 | what they do and how dangerous they can be. 98 | 99 | * Make backups! 100 | 101 | Always make sure you can fall back to a known-good state if you are 102 | changing vital parts of your system! 103 | 104 | * RTFM, search, ask, document 105 | 106 | There is always someone who has solved a problem before you. First use 107 | the documentation provided as much as possible (man, info, howtos), 108 | then search the internet first. If you can't find anything to help you, 109 | ask on the lunar mailinglists (see our website), and last, let others 110 | know how you solved your problem. 111 | 112 | 113 | I hope you realize with these tips that you can help yourself much more 114 | than we can help you. 115 | 116 | ======== 117 | 118 | 119 | 3. Installer procedure 120 | 121 | The lunar ISO installer consists of 3 major stages. Globally they are: 122 | 123 | I - prepare your system 124 | 125 | In this stage you prepare partitions and select the filesystems that 126 | you wish to use. The partitioning is done instantly, so be careful with 127 | what you choose. If you already have proper partitions you can select 128 | them and choose filesytems for them. Lunar will not format them initially. 129 | 130 | II - installation 131 | 132 | In this stage all partitions are formatted if needed and requested, 133 | swap or swapfiles are created, and all required packages are installed 134 | onto your system. 135 | 136 | The second part of this phase allows you to select and install a 137 | bootloader, which allows you to boot any kernels you choose next. Without 138 | this, your box would be quite useless. 139 | 140 | III - configuration 141 | 142 | After your box is finished installing and made ready for operation, 143 | you can configure certain parts before actualy booting the system. This 144 | includes setting a root password, administrating your network already 145 | and a few more settings can be set. 146 | 147 | ======== 148 | 149 | 150 | 4. After installation 151 | 152 | * Update lunar toolset 153 | 154 | Update your core tools (lunar or theedge) before you update your 155 | moonbase, this way new features in the moonbase will be recognized 156 | and you can use them. Then update your moonbase. 157 | 158 | * Update moonbase 159 | 160 | You might want to start doing an update first, before you start working 161 | on installing new modules. Even the ISO can be outdated within a week 162 | after it is released - this is how fast lunar packages change sometimes. 163 | Run a 'lunar update' and let it finish. Make sure you check that any 164 | broken compiles get recompiled by repeating this, letting the AUTOFIX 165 | feature clean them up. 166 | 167 | * Optionally rebuild your system or parts 168 | 169 | If you're paranoid or want to re-optimize your system to a different 170 | level, higher or lower, for more speed or more stability, then do 171 | it now and do a 'lunar rebuild' - this will recompile all installed 172 | modules. A rebuild is actually quite scary and might break on your 173 | system. Often I myself skip this step and only recompile the most 174 | important packages manually - such as the kernel, glibc, gcc and 175 | binutils. This is a highly personal choice. 176 | 177 | 178 | This is the end of the general install procedure. After this you are 179 | on your own and should customize, configure and tweak your own box 180 | to your wishes. Here are some general hints and tips: 181 | 182 | 183 | * read 'man lfirsttime'. This manual page should provide you with the 184 | things that you really should know and do first after you installed 185 | lunar on your system. 186 | 187 | * setup users and permissions. Run 'luser' and start working as a normal 188 | user as fast as possible. If you don't have to be root, don't. 189 | 190 | * install services and support libraries. Nothing is worse then a blank 191 | box that doesn't provide basic programs. Look through the module list 192 | and sections, and figure out what features you wish to have installed. 193 | 194 | * keep your system up2date. As soon as you are done installing, your 195 | system most likely will need some updates already. Keep your system 196 | up2date! This will prevent people from breaking into your box, or from 197 | serious defects to cause harm to your system. 198 | 199 | * keep your system clean. Run 'lunar prune' to minimize old sources lying 200 | around. Remove packages that you don't really need anymore. A clean box 201 | is a safe box, and nothing can be so dangerous as tons of old programs 202 | luring around. 203 | 204 | ======== 205 | 206 | 207 | 5. Where to get more help 208 | 209 | If you need more help and the provided information is not sufficient, 210 | you can get more help the following way: 211 | 212 | HINT: Once you're done installing and have internet working, you can use 213 | the text-mode web browser 'links' right away! 214 | 215 | * The Internet - websites 216 | 217 | Countless websites describe pretty much every problem out there. Most of 218 | the time they can be solved without the need of a person, and some very 219 | good documentation websites provide very detailed help on most common 220 | tasks. Good website to start: tldp.org (linux documentation project) 221 | 222 | * lunar-linux.org 223 | 224 | As everyone out there, we have a website with specific lunar documentation 225 | that is constantly adjusted. 226 | 227 | * mailing lists and mailing lists archives 228 | 229 | Visit our homepage and you will find the way to subscribe to our mailing- 230 | list. From there you can contact many lunar-fanatics who are willing to 231 | help you with your problems. 232 | 233 | * IRC: #lunar on irc.libera.chat 234 | 235 | Join our IRC (Internet Relay Chat) channel #lunar on the Libera 236 | IRC network. There you can contact not only many lunar developers and 237 | users almost 24 hours a day, but also 50.000 other linux users and OSS 238 | developers online. Once you're done installing you can use the irc client 239 | 'irssi' right away! But remember, *never* irc as the root user! (actually, 240 | most networks don't even allow you to do this, so make a normal user 241 | account and use that instead). 242 | 243 | * e-mail 244 | 245 | If all else fails, and you have no way of contacting use 246 | through the mentioned methods above, you can send an e-mail to 247 | maintainer@lunar-linux.org 248 | 249 | ======== 250 | 251 | 252 | 6. What more to do with this ISO 253 | 254 | Next to installing Lunar on your system, the ISO also provides you with 255 | a well-filled live-ISO image with many installation and rescue system 256 | components. This can help you in case you have problems with your 257 | installed system. 258 | 259 | The ISO provides cache tarballs for the most critical components too, 260 | in /var/cache/lunar. These can help you recover from serious problems 261 | with your system instantly. These tarballs will also get copied to the 262 | installed system, allowing you to resurrect any single one of them 263 | quickly (read "man lin" about resurrecting modules). 264 | 265 | You can also use the ISO to boot a system that has problematic bootloader 266 | configurations, and correct them. 267 | 268 | This is just a short summary of possibilities. Many more things are 269 | possible! 270 | 271 | ======== 272 | 273 | 274 | 275 | Lunar-Linux - hope you enjoy using it as much as we enjoy making it! 276 | 277 | -------------------------------------------------------------------------------- /template/etc/dracut.conf.d/02-lunar-live.conf: -------------------------------------------------------------------------------- 1 | # Dracut config file for Lunar Linux CD 2 | add_dracutmodules+=" dmsquash-live lunar-live " 3 | hostonly="no" 4 | compress="xz" 5 | -------------------------------------------------------------------------------- /template/etc/fstab: -------------------------------------------------------------------------------- 1 | # /etc/fstab: static file system information. 2 | # 3 | 4 | -------------------------------------------------------------------------------- /template/etc/group: -------------------------------------------------------------------------------- 1 | root:x:0: 2 | daemon:x:1: 3 | bin:x:2: 4 | sys:x:3: 5 | adm:x:4: 6 | tty:x:5: 7 | disk:x:6: 8 | lp:x:7: 9 | mail:x:8: 10 | news:x:9: 11 | uucp:x:10: 12 | backup:x:11: 13 | ftp:x:12: 14 | vcsa:x:13: 15 | sshd:x:14: 16 | kmem:x:15: 17 | ppp:x:16: 18 | fax:x:17: 19 | voice:x:18: 20 | cdrom:x:19: 21 | floppy:x:20: 22 | tape:x:21: 23 | audio:x:22: 24 | shadow:x:23: 25 | utmp:x:24: 26 | video:x:25: 27 | games:x:26: 28 | proxy:x:27: 29 | dialout:x:27: 30 | wheel:x:30: 31 | systemd-journal-gateway:x:31: 32 | systemd-bus-proxy:x:32: 33 | systemd-network:x:33: 34 | systemd-resolve:x:34: 35 | systemd-timesync:x:35: 36 | systemd-journal-remote:x:36: 37 | users:x:100: 38 | nogroup:x:65534: 39 | -------------------------------------------------------------------------------- /template/etc/host.conf: -------------------------------------------------------------------------------- 1 | order hosts,bind 2 | multi on 3 | -------------------------------------------------------------------------------- /template/etc/hosts: -------------------------------------------------------------------------------- 1 | # 2 | # hosts This file describes a number of hostname-to-address 3 | # mappings for the TCP/IP subsystem. It is mostly 4 | # used at boot time, when no name servers are running. 5 | # On small systems, this file can be used instead of a 6 | # "named" name server. Just add the names, addresses 7 | # and any aliases to this file... 8 | # 9 | 127.0.0.1 localhost 10 | 11 | -------------------------------------------------------------------------------- /template/etc/ld.so.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar-iso/7b17c7a44e171196e354c3fa114950fbdb2c2a81/template/etc/ld.so.conf -------------------------------------------------------------------------------- /template/etc/lunar/local/.config.current: -------------------------------------------------------------------------------- 1 | # 2 | # Stub config file for building core modules 3 | # 4 | CONFIG_FANOTIFY=y 5 | CONFIG_DEVTMPFS=y 6 | CONFIG_CGROUPS=y 7 | CONFIG_MODULES=y 8 | CONFIG_BLK_DEV_INITRD=y 9 | CONFIG_INOTIFY_USER=y 10 | -------------------------------------------------------------------------------- /template/etc/lunar/local/config: -------------------------------------------------------------------------------- 1 | FUZZY=off 2 | ARCHIVE=on 3 | AUTOFIX=off 4 | AUTOPRUNE=off 5 | MAIL_REPORTS=off 6 | PRESERVE=on 7 | SOUND=off 8 | SUSTAIN=on 9 | VIEW_REPORTS=off 10 | VOYEUR=on 11 | REAP=on 12 | GARBAGE=on 13 | TMPFS=off 14 | XFCE4_PREFIX=/usr 15 | QT_PREFIX=/usr 16 | KDE_PREFIX=/usr 17 | KDEDIR=/usr 18 | QTDIR=/usr/lib 19 | AUTORESURRECT=off 20 | KEEP_SOURCE=off 21 | VERBOSE=off 22 | ZLOCAL_OVERRIDES=on 23 | COLOR=on 24 | CVS_THRESHOLD=120 25 | PROBE_EXPIRED=on 26 | SAFE_OPTIMIZATIONS=on 27 | LUNAR_ALIAS_SSL="openssl" 28 | LUNAR_ALIAS_OSSL="openssl" 29 | BOOTLOADER="none" 30 | LUNAR_RESTART_SERVICES=off 31 | KEEP_OPSOLETE_LIBS=off 32 | -------------------------------------------------------------------------------- /template/etc/lunar/local/depends/glibc: -------------------------------------------------------------------------------- 1 | OPTS="$OPTS --disable-profile" 2 | CONFIGURED=y 3 | -------------------------------------------------------------------------------- /template/etc/lunar/local/depends/lilo: -------------------------------------------------------------------------------- 1 | RUN_LILO="n" 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/depends/net-tools: -------------------------------------------------------------------------------- 1 | CONFIGURED="y" 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/depends/systemd: -------------------------------------------------------------------------------- 1 | NEW_NAME_SCHEME="y" 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/net-tools.config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * config.h Automatically generated configuration includefile 3 | * 4 | * NET-TOOLS A collection of programs that form the base set of the 5 | * NET-3 Networking Distribution for the LINUX operating 6 | * system. 7 | * 8 | * DO NOT EDIT DIRECTLY 9 | * 10 | */ 11 | 12 | /* 13 | * 14 | * Internationalization 15 | * 16 | * The net-tools package has currently been translated to French, 17 | * German and Brazilian Portugese. Other translations are, of 18 | * course, welcome. Answer `n' here if you have no support for 19 | * internationalization on your system. 20 | * 21 | */ 22 | #define I18N 1 23 | 24 | /* 25 | * 26 | * Protocol Families. 27 | * 28 | */ 29 | #define HAVE_AFUNIX 1 30 | #define HAVE_AFINET 1 31 | #define HAVE_AFINET6 1 32 | #define HAVE_AFIPX 0 33 | #define HAVE_AFATALK 0 34 | #define HAVE_AFAX25 0 35 | #define HAVE_AFNETROM 0 36 | #define HAVE_AFROSE 0 37 | #define HAVE_AFX25 0 38 | #define HAVE_AFECONET 0 39 | #define HAVE_AFDECnet 0 40 | #define HAVE_AFASH 0 41 | 42 | /* 43 | * 44 | * Device Hardware types. 45 | * 46 | */ 47 | #define HAVE_HWETHER 1 48 | #define HAVE_HWARC 0 49 | #define HAVE_HWSLIP 1 50 | #define HAVE_HWPPP 1 51 | #define HAVE_HWTUNNEL 1 52 | #define HAVE_HWSTRIP 1 53 | #define HAVE_HWTR 0 54 | #define HAVE_HWAX25 0 55 | #define HAVE_HWROSE 0 56 | #define HAVE_HWNETROM 0 57 | #define HAVE_HWX25 0 58 | #define HAVE_HWFR 0 59 | #define HAVE_HWSIT 1 60 | #define HAVE_HWFDDI 0 61 | #define HAVE_HWHIPPI 0 62 | #define HAVE_HWASH 0 63 | #define HAVE_HWHDLCLAPB 0 64 | #define HAVE_HWIRDA 1 65 | #define HAVE_HWEC 0 66 | 67 | /* 68 | * 69 | * Other Features. 70 | * 71 | */ 72 | #define HAVE_FW_MASQUERADE 1 73 | #define HAVE_IP_TOOLS 1 74 | #define HAVE_MII 1 75 | -------------------------------------------------------------------------------- /template/etc/lunar/local/optimizations.CCACHE: -------------------------------------------------------------------------------- 1 | USE_CCACHE=no 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/optimizations.GCC: -------------------------------------------------------------------------------- 1 | BOPT=Faster 2 | SPD=( Noplt Exceptions ) 3 | CC_OPTS=( Pipe Fortify ClashProtection ) 4 | -------------------------------------------------------------------------------- /template/etc/lunar/local/optimizations.GNU_LD: -------------------------------------------------------------------------------- 1 | LDF=( Strip Relro Now SortCommon ) 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/optimizations.GNU_MAKE: -------------------------------------------------------------------------------- 1 | MAKES= 2 | -------------------------------------------------------------------------------- /template/etc/lunar/local/optimizations.WRAPPERS: -------------------------------------------------------------------------------- 1 | USE_WRAPPERS=yes 2 | -------------------------------------------------------------------------------- /template/etc/modules: -------------------------------------------------------------------------------- 1 | # /etc/modules: kernel modules to load at boot time. 2 | # 3 | # This file should contain the names of kernel modules that are 4 | # to be loaded at boot time, one per line. Comments begin with 5 | # a '#', and everything on the line after them are ignored. 6 | 7 | -------------------------------------------------------------------------------- /template/etc/modules.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lunar-linux/lunar-iso/7b17c7a44e171196e354c3fa114950fbdb2c2a81/template/etc/modules.conf -------------------------------------------------------------------------------- /template/etc/nsswitch.conf: -------------------------------------------------------------------------------- 1 | # 2 | # /etc/nsswitch.conf 3 | # 4 | # An example Name Service Switch config file. This file should be 5 | # sorted with the most-used services at the beginning. 6 | # 7 | # The entry '[NOTFOUND=return]' means that the search for an 8 | # entry should stop if the search in the previous entry turned 9 | # up nothing. Note that if the search failed due to some other reason 10 | # (like no NIS server responding) then the search continues with the 11 | # next entry. 12 | # 13 | # Legal entries are: 14 | # 15 | # nisplus or nis+ Use NIS+ (NIS version 3) 16 | # nis or yp Use NIS (NIS version 2), also called YP 17 | # dns Use DNS (Domain Name Service) 18 | # files Use the local files 19 | # db Use the local database (.db) files 20 | # compat Use NIS on compat mode 21 | # [NOTFOUND=return] Stop searching if not found so far 22 | # 23 | 24 | # To use db, put the "db" in front of "files" for entries you want to be 25 | # looked up first in the databases 26 | # 27 | # Example: 28 | #passwd: db files nisplus nis 29 | #shadow: db files nisplus nis 30 | #group: db files nisplus nis 31 | 32 | passwd: files nisplus nis 33 | shadow: files nisplus nis 34 | group: files nisplus nis 35 | 36 | #hosts: db files nisplus nis dns 37 | hosts: files nisplus nis dns 38 | 39 | services: nisplus [NOTFOUND=return] files 40 | networks: nisplus [NOTFOUND=return] files 41 | protocols: nisplus [NOTFOUND=return] files 42 | rpc: nisplus [NOTFOUND=return] files 43 | ethers: nisplus [NOTFOUND=return] files 44 | netmasks: nisplus [NOTFOUND=return] files 45 | bootparams: nisplus [NOTFOUND=return] files 46 | 47 | netgroup: nisplus 48 | 49 | publickey: nisplus 50 | 51 | automount: files nisplus 52 | aliases: files nisplus 53 | 54 | -------------------------------------------------------------------------------- /template/etc/passwd: -------------------------------------------------------------------------------- 1 | root:x:0:0:root:/root:/bin/bash 2 | daemon:x:1:1:daemon:/usr/sbin:/bin/false 3 | bin:x:2:2:bin:/bin:/bin/false 4 | sys:x:3:3:sys:/dev:/bin/false 5 | sync:x:4:4:sync:/bin:/bin/sync 6 | man:x:6:6:man:/var/cache/man:/bin/false 7 | lp:x:7:7:lp:/var/spool/lpd:/bin/false 8 | mail:x:8:8:mail:/var/spool/mail:/bin/false 9 | news:x:9:9:news:/var/spool/news:/bin/false 10 | uucp:x:10:10:uucp:/var/spool/uucp:/bin/false 11 | backup:x:11:11:backup:/var/backups:/bin/false 12 | ftp:x:12:12::/home/ftp:/bin/false 13 | vcsa:x:13:13::/dev:/bin/false 14 | sshd:x:14:14::/var/empty:/bin/false 15 | games:x:25:25:games:/usr/games:/bin/false 16 | nobody:x:65534:65534:nobody:/home:/bin/false 17 | systemd-journal-gateway:x:996:996:systemd Journal Gateway:/:/sbin/nologin 18 | systemd-bus-proxy:x:995:995:systemd Bus Proxy:/:/sbin/nologin 19 | systemd-network:x:994:994:systemd Network Management:/:/sbin/nologin 20 | systemd-resolve:x:993:993:systemd Resolver:/:/sbin/nologin 21 | systemd-timesync:x:992:992:systemd Time Synchronization:/:/sbin/nologin 22 | -------------------------------------------------------------------------------- /template/etc/protocols: -------------------------------------------------------------------------------- 1 | # 2 | # protocols This file describes the various protocols that are 3 | # available from the TCP/IP subsystem. It should be 4 | # consulted instead of using the numbers in the ARPA 5 | # include files, or, worse, just guessing them. 6 | # 7 | 8 | ip 0 IP # internet protocol, pseudo protocol number 9 | icmp 1 ICMP # internet control message protocol 10 | igmp 2 IGMP # internet group multicast protocol 11 | ggp 3 GGP # gateway-gateway protocol 12 | tcp 6 TCP # transmission control protocol 13 | pup 12 PUP # PARC universal packet protocol 14 | udp 17 UDP # user datagram protocol 15 | idp 22 IDP # WhatsThis? 16 | raw 255 RAW # RAW IP interface 17 | 18 | # End. 19 | -------------------------------------------------------------------------------- /template/etc/securetty: -------------------------------------------------------------------------------- 1 | console 2 | vc/1 3 | vc/2 4 | vc/3 5 | vc/4 6 | vc/5 7 | vc/6 8 | vc/7 9 | vc/8 10 | vc/9 11 | vc/10 12 | vc/11 13 | tty1 14 | tty2 15 | tty3 16 | tty4 17 | tty5 18 | tty6 19 | tty7 20 | tty8 21 | tty9 22 | tty10 23 | tty11 24 | -------------------------------------------------------------------------------- /template/etc/services: -------------------------------------------------------------------------------- 1 | # 2 | # Network services, Internet style 3 | # 4 | # Note that it is presently the policy of IANA to assign a single well-known 5 | # port number for both TCP and UDP; hence, most entries here have two entries 6 | # even if the protocol doesn't support UDP operations. 7 | # 8 | # The list below is a compilation of the numbers in RFC 1340 and common 9 | # unix ports that that specific RFC leaves out but are widespread in use. 10 | # 11 | 12 | 13 | tcpmux 1/tcp # TCP port service multiplexer 14 | echo 7/tcp 15 | echo 7/udp 16 | discard 9/tcp sink null 17 | discard 9/udp sink null 18 | systat 11/tcp users 19 | daytime 13/tcp 20 | daytime 13/udp 21 | netstat 15/tcp 22 | qotd 17/tcp quote 23 | msp 18/tcp # message send protocol 24 | msp 18/udp # message send protocol 25 | chargen 19/tcp ttytst source 26 | chargen 19/udp ttytst source 27 | ftp-data 20/tcp 28 | ftp 21/tcp 29 | ssh 22/tcp 30 | telnet 23/tcp 31 | smtp 25/tcp mail 32 | time 37/tcp timserver 33 | time 37/udp timserver 34 | rlp 39/udp resource # resource location 35 | nameserver 42/tcp name # IEN 116 36 | whois 43/tcp nicname 37 | domain 53/tcp nameserver # name-domain server 38 | domain 53/udp nameserver 39 | mtp 57/tcp # deprecated 40 | bootps 67/tcp # BOOTP server 41 | bootps 67/udp 42 | bootpc 68/tcp # BOOTP client 43 | bootpc 68/udp 44 | tftp 69/udp 45 | gopher 70/tcp # Internet Gopher 46 | gopher 70/udp 47 | rje 77/tcp netrjs 48 | finger 79/tcp 49 | http 80/tcp 50 | www 80/tcp http # WorldWideWeb HTTP 51 | link 87/tcp ttylink 52 | kerberos 88/tcp krb5 # Kerberos v5 53 | kerberos 88/udp 54 | supdup 95/tcp 55 | # 100 - reserved 56 | hostnames 101/tcp hostname # usually from sri-nic 57 | iso-tsap 102/tcp tsap # part of ISODE. 58 | csnet-ns 105/tcp cso-ns # also used by CSO name server 59 | csnet-ns 105/udp cso-ns 60 | rtelnet 107/tcp # Remote Telnet 61 | rtelnet 107/udp 62 | pop2 109/tcp postoffice # POP version 2 63 | pop3 110/tcp # POP version 3 64 | sunrpc 111/tcp 65 | sunrpc 111/udp 66 | auth 113/tcp tap ident authentication 67 | sftp 115/tcp 68 | uucp-path 117/tcp 69 | nntp 119/tcp readnews untp # USENET News Transfer Protocol 70 | ntp 123/tcp 71 | ntp 123/udp # Network Time Protocol 72 | netbios-ns 137/tcp # NETBIOS Name Service 73 | netbios-ns 137/udp 74 | netbios-dgm 138/tcp # NETBIOS Datagram Service 75 | netbios-dgm 138/udp 76 | netbios-ssn 139/tcp # NETBIOS session service 77 | netbios-ssn 139/udp 78 | imap2 143/tcp # Interim Mail Access Proto v2 79 | snmp 161/udp # Simple Net Mgmt Proto 80 | snmp-trap 162/udp snmptrap # Traps for SNMP 81 | cmip-man 163/tcp # ISO mgmt over IP (CMOT) 82 | cmip-man 163/udp 83 | cmip-agent 164/tcp 84 | cmip-agent 164/udp 85 | xdmcp 177/tcp # X Display Mgr. Control Proto 86 | xdmcp 177/udp 87 | nextstep 178/tcp NeXTStep NextStep # NeXTStep window 88 | nextstep 178/udp NeXTStep NextStep # server 89 | bgp 179/tcp # Border Gateway Proto. 90 | bgp 179/udp 91 | prospero 191/tcp # Cliff Neuman's Prospero 92 | prospero 191/udp 93 | irc 194/tcp # Internet Relay Chat 94 | irc 194/udp 95 | smux 199/tcp # SNMP Unix Multiplexer 96 | smux 199/udp 97 | at-rtmp 201/tcp # AppleTalk routing 98 | at-rtmp 201/udp 99 | at-nbp 202/tcp # AppleTalk name binding 100 | at-nbp 202/udp 101 | at-echo 204/tcp # AppleTalk echo 102 | at-echo 204/udp 103 | at-zis 206/tcp # AppleTalk zone information 104 | at-zis 206/udp 105 | z3950 210/tcp wais # NISO Z39.50 database 106 | z3950 210/udp wais 107 | ipx 213/tcp # IPX 108 | ipx 213/udp 109 | imap3 220/tcp # Interactive Mail Access 110 | ulistserv 372/tcp # UNIX Listserv 111 | ulistserv 372/udp 112 | https 443/tcp 113 | smb 445/tcp 114 | exec 512/tcp 115 | biff 512/udp comsat 116 | login 513/tcp 117 | who 513/udp whod 118 | shell 514/tcp cmd # no passwords used 119 | syslog 514/udp 120 | printer 515/tcp spooler # line printer spooler 121 | talk 517/udp 122 | ntalk 518/udp 123 | route 520/udp router routed # RIP 124 | timed 525/udp timeserver 125 | tempo 526/tcp newdate 126 | courier 530/tcp rpc 127 | conference 531/tcp chat 128 | netnews 532/tcp readnews 129 | netwall 533/udp # -for emergency broadcasts 130 | uucp 540/tcp uucpd # uucp daemon 131 | remotefs 556/tcp rfs_server rfs # Brunhoff remote filesystem 132 | klogin 543/tcp # Kerberized `rlogin' (v5) 133 | kshell 544/tcp # Kerberized `rsh' (v5) 134 | kerberos-adm 749/tcp # Kerberos `kadmin' (v5) 135 | webster 765/tcp # Network dictionary 136 | webster 765/udp 137 | rsync 873/tcp 138 | swat 901/tcp 139 | imaps 993/tcp 140 | pop3s 995/tcp 141 | 142 | 143 | # 144 | # From ``Assigned Numbers'': 145 | # 146 | #> The Registered Ports are not controlled by the IANA and on most systems 147 | #> can be used by ordinary user processes or programs executed by ordinary 148 | #> users. 149 | # 150 | #> Ports are used in the TCP [45,106] to name the ends of logical 151 | #> connections which carry long term conversations. For the purpose of 152 | #> providing services to unknown callers, a service contact port is 153 | #> defined. This list specifies the port used by the server process as its 154 | #> contact port. While the IANA can not control uses of these ports it 155 | #> does register or list uses of these ports as a convienence to the 156 | #> community. 157 | # 158 | 159 | 160 | ingreslock 1524/tcp 161 | ingreslock 1524/udp 162 | prospero-np 1525/tcp # Prospero non-privileged 163 | prospero-np 1525/udp 164 | cvspserver 2401/tcp # cvs network server, cvspserver 165 | cvspserver 2401/udp # cvs network server, cvspserver 166 | mysql 3306/tcp # mysql server 167 | rfe 5002/tcp # Radio Free Ethernet 168 | rfe 5002/udp # Actually uses UDP only 169 | 170 | -------------------------------------------------------------------------------- /template/etc/shadow: -------------------------------------------------------------------------------- 1 | root:1aNCmZkoD3ePs:11521:0:99999:7::: 2 | daemon:x:11521:0:99999:7::: 3 | bin:x:11521:0:99999:7::: 4 | sys:x:11521:0:99999:7::: 5 | sync:x:11521:0:99999:7::: 6 | games:x:11521:0:99999:7::: 7 | man:x:11521:0:99999:7::: 8 | lp:x:11521:0:99999:7::: 9 | mail:x:11521:0:99999:7::: 10 | news:x:11521:0:99999:7::: 11 | uucp:x:11521:0:99999:7::: 12 | backup:x:11521:0:99999:7::: 13 | ftp:x:11521:0:99999:7::: 14 | operator:x:11521:0:99999:7::: 15 | sshd:x:11521:0:99999:7::: 16 | postfix:x:11521:0:99999:7::: 17 | postdrop::x:11521:0:99999:7::: 18 | mysql::x:11521:0:99999:7::: 19 | nobody:x:11521:0:99999:7::: 20 | -------------------------------------------------------------------------------- /template/etc/shells: -------------------------------------------------------------------------------- 1 | /bin/sh 2 | /bin/bash 3 | /bin/bash_static 4 | -------------------------------------------------------------------------------- /template/motd: -------------------------------------------------------------------------------- 1 | 2 | Welcome to Lunar Linux %VERSION% (%CODENAME%)! 3 | 4 | Read `man lfirsttime` if you are a new Lunar Linux user. It contains 5 | many hints that are useful if you do not know what to do next. Read 6 | `man lunar` about the Lunar Linux package management system, to find 7 | out how to install additional packages. Also read the "/root/README" 8 | file for more hints on what you can do with the ISO itself in case 9 | of problems. 10 | 11 | You are reading the contents of "/etc/motd". If you do not edit or 12 | remove it, it will continue to bug you with this message. 13 | 14 | -------------------------------------------------------------------------------- /template/var/state/lunar/depends: -------------------------------------------------------------------------------- 1 | irssi:perl:off:optional::--without-perl 2 | tar:pbzip2:off:optional:--with-bzip2=/usr/bin/pbzip2: 3 | --------------------------------------------------------------------------------