Join our Discord Server
Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 570+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 8900+ members and discord server close to 2200+ members. You can follow him on Twitter(@ajeetsraina).

How to reconstruct Parted Magic ISO through adding packages from Slackware

3 min read

Parted Magic is a complete hard disk management solution.Parted Magic is a small live CD/USB/PXE with its elemental purpose being to partition hard drives. As per the definition on partedmagic.com,

“PartedMagic has the tools to get the job done. With the Partition Editor you can re-size, copy, and move partitions. You can grow or shrink your C: drive. Create space for new operating systems. Attempt data rescue from lost partitions.”

Recently I dirtied my hands on reconstructing Parted Magic ISO through adding packages from Slackware. Here is how I achieved it –

Step-1:

Starting with Parted Magic 5.9 the mkgriso script is provided in the root of the iso. It is recommended to follow the instructions in there and to use that script to recreate the iso.

Follow the below steps:

#mkdir /mnt/cdrom
#mount -o loop pmagic-x.x.iso /mnt/cdrom
#cp -a /mnt/cdrom .
#umount /mnt/cdrom

Step-2: Adding Slackware Packages:

Parted Magic is not Slackware based, but the main tool chain was compiled on Slackware. If you would like to add programs your best bet is to use TXZ packages from Slackware 13.x.

If you would like to add programs, put the txz files in cdrom/pmagic/pmodules directory.Parted Magic will install any packages it finds in the /pmagic/pmodules directory.

The most comprehensive place for Slackware packages is slackbuilds.org. You download the source and a build file which you use to compile the program and make the package. Slackware packages are basically just ordinary compressed tar files.

Let’s download an example build, say apache-maven

ls
PMAGIC_2015_01_13.SQFS  scripts
[root@localhost pmodules]# wget http://slackbuilds.org/slackbuilds/14.1/development/apache-maven.tar.gz
–2015-04-20 05:17:34–  http://slackbuilds.org/slackbuilds/14.1/development/apache-maven.tar.gz
Resolving moxy.us.dell.com (moxy.us.dell.com)… 10.35.178.212
Connecting to moxy.us.dell.com (moxy.us.dell.com)|10.35.178.212|:3128… connected.
Proxy request sent, awaiting response… 200 OK
Length: 2160 (2.1K) [application/x-gzip]
Saving to: ‘apache-maven.tar.gz’

100%[======================================>] 2,160       –.-K/s   in 0s

2015-04-20 05:17:35 (120 MB/s) – ‘apache-maven.tar.gz’ saved [2160/2160]

[root@localhost pmodules]# wget http://archive.apache.org/dist/maven/binaries/apache-maven-3.1.1-bin.tar.gz
–2015-04-20 05:17:43–  http://archive.apache.org/dist/maven/binaries/apache-maven-3.1.1-bin.tar.gz
Proxy request sent, awaiting response… 200 OK
Length: 5494427 (5.2M) [application/x-gzip]
Saving to: ‘apache-maven-3.1.1-bin.tar.gz’

100%[======================================>] 5,494,427    144KB/s   in 43s

2015-04-20 05:18:27 (126 KB/s) – ‘apache-maven-3.1.1-bin.tar.gz’ saved [5494427/5494427]

[root@localhost pmodules]#

#pwd
/mnt/isoss/pmagic/pmodules
[root@localhost pmodules]# ls
PMAGIC_2015_01_13.SQFS  scripts
[root@localhost pmodules]#

So, now we have the following source and builds downloaded

[root@localhost pmodules]# ls
apache-maven-3.1.1-bin.tar.gz  PMAGIC_2015_01_13.SQFS
apache-maven.tar.gz            scripts

Step-3: Remastering the ISO

Now as I have added these sources(packages) into pmodules directory.
Its time to run mkgriso script:

cp -rf mkgriso pmagic-custom/
cp: overwrite ‘pmagic-custom/mkgriso’? y
[root@localhost opt]# ls
GPL  mkgriso  pmagic-custom
[root@localhost opt]# cd pmagic-custom/
[root@localhost pmagic-custom]# ls
boot  EFI  GPL  mkgriso  pmagic  rh
[root@localhost pmagic-custom]# chmod +x mkgriso
[root@localhost pmagic-custom]# ./mkgriso
Warning: creating filesystem that does not conform to ISO-9660.
I: -input-charset not specified, using utf-8 (detected in locale settings)
genisoimage 1.1.11 (Linux)
Scanning .
Scanning ./boot
Scanning ./boot/chntpw
Scanning ./boot/grub
Scanning ./boot/ipxe
Scanning ./boot/memtest
Scanning ./boot/mhdd
Scanning ./boot/plpbt
Scanning ./boot/pxelinux
Scanning ./boot/sgd
Scanning ./boot/syslinux
Scanning ./EFI
Scanning ./EFI/boot
Scanning ./EFI/boot/x86_64-efi
Scanning ./pmagic
Scanning ./pmagic/pmodules
Scanning ./pmagic/pmodules/scripts
Scanning ./rh
Writing:   Initial Padblock                        Start Block 0
Done with: Initial Padblock                        Block(s)    16
Writing:   Primary Volume Descriptor               Start Block 16
Done with: Primary Volume Descriptor               Block(s)    1
Writing:   Eltorito Volume Descriptor              Start Block 17
Size of boot image is 4 sectors -> No emulation
Size of boot image is 6600 sectors -> No emulation
Done with: Eltorito Volume Descriptor              Block(s)    1
Writing:   Joliet Volume Descriptor                Start Block 18
Done with: Joliet Volume Descriptor                Block(s)    1
Writing:   End Volume Descriptor                   Start Block 19
Done with: End Volume Descriptor                   Block(s)    1
Writing:   Version block                           Start Block 20
Done with: Version block                           Block(s)    1
Writing:   Path table                              Start Block 21
Done with: Path table                              Block(s)    4
Writing:   Joliet path table                       Start Block 25
Done with: Joliet path table                       Block(s)    4
Writing:   Directory tree                          Start Block 29
Done with: Directory tree                          Block(s)    35
Writing:   Joliet directory tree                   Start Block 64
Done with: Joliet directory tree                   Block(s)    25
Writing:   Directory tree cleanup                  Start Block 89
Done with: Directory tree cleanup                  Block(s)    0
Writing:   Extension record                        Start Block 89
Done with: Extension record                        Block(s)    1
Writing:   The File(s)                             Start Block 90
2.22% done, estimate finish Mon Apr 20 05:41:18 2015
4.44% done, estimate finish Mon Apr 20 05:41:40 2015
6.66% done, estimate finish Mon Apr 20 05:41:33 2015
8.87% done, estimate finish Mon Apr 20 05:41:29 2015
11.09% done, estimate finish Mon Apr 20 05:41:27 2015
13.31% done, estimate finish Mon Apr 20 05:41:33 2015
15.53% done, estimate finish Mon Apr 20 05:41:30 2015
17.75% done, estimate finish Mon Apr 20 05:41:29 2015
19.96% done, estimate finish Mon Apr 20 05:41:28 2015
22.18% done, estimate finish Mon Apr 20 05:41:27 2015
24.40% done, estimate finish Mon Apr 20 05:41:26 2015
26.61% done, estimate finish Mon Apr 20 05:41:25 2015
28.83% done, estimate finish Mon Apr 20 05:41:28 2015
31.05% done, estimate finish Mon Apr 20 05:41:27 2015
33.27% done, estimate finish Mon Apr 20 05:41:27 2015
35.49% done, estimate finish Mon Apr 20 05:41:29 2015
37.70% done, estimate finish Mon Apr 20 05:41:28 2015
39.92% done, estimate finish Mon Apr 20 05:41:28 2015
42.14% done, estimate finish Mon Apr 20 05:41:27 2015
44.36% done, estimate finish Mon Apr 20 05:41:29 2015
46.57% done, estimate finish Mon Apr 20 05:41:28 2015
48.79% done, estimate finish Mon Apr 20 05:41:30 2015
51.01% done, estimate finish Mon Apr 20 05:41:29 2015
53.23% done, estimate finish Mon Apr 20 05:41:31 2015
55.44% done, estimate finish Mon Apr 20 05:41:30 2015
57.66% done, estimate finish Mon Apr 20 05:41:30 2015
59.88% done, estimate finish Mon Apr 20 05:41:29 2015
62.10% done, estimate finish Mon Apr 20 05:41:29 2015
64.31% done, estimate finish Mon Apr 20 05:41:28 2015
66.53% done, estimate finish Mon Apr 20 05:41:30 2015
68.75% done, estimate finish Mon Apr 20 05:41:29 2015
70.97% done, estimate finish Mon Apr 20 05:41:29 2015
73.18% done, estimate finish Mon Apr 20 05:41:28 2015
75.40% done, estimate finish Mon Apr 20 05:41:28 2015
77.62% done, estimate finish Mon Apr 20 05:41:29 2015
79.84% done, estimate finish Mon Apr 20 05:41:29 2015
82.05% done, estimate finish Mon Apr 20 05:41:28 2015
84.27% done, estimate finish Mon Apr 20 05:41:28 2015
86.49% done, estimate finish Mon Apr 20 05:41:29 2015
88.71% done, estimate finish Mon Apr 20 05:41:29 2015
90.92% done, estimate finish Mon Apr 20 05:41:28 2015
93.14% done, estimate finish Mon Apr 20 05:41:29 2015
95.36% done, estimate finish Mon Apr 20 05:41:29 2015
97.58% done, estimate finish Mon Apr 20 05:41:30 2015
99.79% done, estimate finish Mon Apr 20 05:41:30 2015
Total translation table size: 2048
Total rockridge attributes bytes: 29243
Total directory bytes: 69632
Path table size(bytes): 244
Done with: The File(s)                             Block(s)    225233
Writing:   Ending Padblock                         Start Block 225323
Done with: Ending Padblock                         Block(s)    150
Max brk space used 5d000
225473 extents written (440 MB)
>>> /opt/pmagic_2015_01_13T.iso created
[root@localhost pmagic-custom]# ls
boot  EFI  GPL  mkgriso  pmagic  rh
[root@localhost pmagic-custom]# cd ..
[root@localhost opt]# ls
GPL  mkgriso  pmagic_2015_01_13T.iso  pmagic-custom

Hence the pmagic_2015_01_13T.iso is created.

Just mount the ISO and you will see the particular packages and module is loaded. If the module is bind to kernel, you might need to compile the kernel.

Hope it helps !!!

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 570+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 8900+ members and discord server close to 2200+ members. You can follow him on Twitter(@ajeetsraina).
Join our Discord Server