LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Blogs > Unpopular Positions: One Geek's Take
User Name
Password

Notices


A space to ponder, discuss, speculate, disagree, and learn.

Expected topics include:
  • Technology
  • Politics
  • Defense
  • Philosophy
  • Humanism and Transhumanism
  • The Future
Rate this Entry

Automating custom Slackware install tarball and post-setup tweaks

Posted 07-31-2015 at 10:47 AM by ttk

The other day I thought, not for the first time, that it was kind of dumb to be manually building my stripped-down Slackware install tarball, and having to remember the tweaks I like having done to the system after "setup" but before the first system boot. I end up forgetting things, getting frustrated at the minimalist busybox-based setup environment, and going back and making some changes after first boot instead of before (and as often as not sneakernetting files to the new system pending a functioning network).

Unlike those other times, though, I did something about it -- wrote a perl script (which might as well be a bash script; it's not doing anything particularly complex yet) which builds an install tarball from a "slackware64-XX.Y" release directory (minus KDE, KDEI, XFCE, and source) and a "ttkslackXX_Y" directory containing the custom scripts/patches/modules/packages, an sbopkg package, and other such things.

That was the easy part. I'm in the process of populating "ttkslack14_1" with those customizations in scripted form. They have to be /bin/sh scripts because they'd be running under busybox after "setup", which is stretching my sh skills a bit (perl has spoiled me).

I'm remembering some of the tweaks before I'm ready to implement them, and most of my scripts lack documentation, so I'm going to make a github account soon where I can keep track of what needs to get done and document the scripts.

Some of the useful little programs in my ~/bin directory were written more than a decade ago, and in desperate need of reworking. A few got rewritten yesterday before I tarred them up for ttkslack14_1 -- my perl skills in 2003 were kind of horrible.

When it's all done, my typical interactive Slackware installation workflow will look like:

(1) run the perl script to make an approx 2GB tswXX_Y.tar file,

(2) cat usbboot.img > /dev/sdx (the usb thumbdrive),

(3) dd tswXX_Y.tar beyond the boot image on the thumbdrive,

(4) boot the new system from the thumbdrive,

(5) partition /dev/sda and format /dev/sda1,

(6) mkdir /m and mount /dev/sda1 to /m,

(7) dd/untar the tswXX_Y.tar file from the usb drive to /m/tsw14_1,

(8) run "setup" and install Slackware from /m/tsw14_1/slackware64 to /dev/sda1,

(9) run /m/tsw14_1/ttkslack-post-install.sh, which will run the other scripts that apply patches and install custom things etc,

(10) reboot into the new install.

Eventually I'll want to automate more of this, and build a pxe-install rig so the usb thumbdrive can be omitted altogether, but this is a good first step.

Fully automating the usb-install process will stretch my sh skills again. I would need to put a script into the usbboot.img's initrd which could identify the drives and the usb drive, create partitions (but only if needed), create filesystems (but only if needed -- don't want to wipe out data if there's already a filesystem and I'm just re-installing the OS), extract the installation tarball, and then perform the same steps as Slackware's "setup" non-interactively, and finally run ttkslack-post-install.sh and reboot.

I did something similar for Debian installation at archive.org, and it should be easier now (the hardware and software are better than they were in 2004, and my scripting skills are better), but in some ways doing it for archive.org was a lot simpler too. All of the configuration went into the OS image on the thumbdrive, and the hardware was always the same so there was no need to figure out which /dev/sd* was what.

Still, it shouldn't be hard, just a "slight matter of programming" :-P

Baby steps, right? I'll make the github project later today. Need to shower and go to work now.
Views 2220 Comments 3
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment
    Please be sure to post a link to your GitHub account in this comments section. I would be very interested in looking at your work.
    Posted 07-31-2015 at 11:21 AM by mralk3 mralk3 is offline
  2. Old Comment
    Quote:
    Originally Posted by mralk3 View Comment
    Please be sure to post a link to your GitHub account in this comments section. I would be very interested in looking at your work.
    Regrettably, most of my work is still in private cvs repos. I've been meaning to move them to Github, but mostly haven't.

    Some of my older work is browsable at http://ciar.org/ttk/codecloset/ and my Github page is https://github.com/ttkciar/ (there's not much there).

    Most of the scripts in the ttk-slackware-customizations repo are horrible, horrible. I'll be taking advantage of this project to clean them up, and wean them off of oddball module dependencies (KS and DR, primarily). Oh yeah, a lot of them don't work without modules which haven't been added to that repo yet, too.

    It's very much a work in progress.
    Posted 07-31-2015 at 04:46 PM by ttk ttk is offline
  3. Old Comment
    Alright no problem. I have you added to my github rss feed.
    Posted 07-31-2015 at 10:27 PM by mralk3 mralk3 is offline
 

  



All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration